Skip to content

Commit

Permalink
Applied spotless formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Clayton Tabone <taboneclayton@gmail.com>
  • Loading branch information
taboneclayton committed Sep 10, 2020
1 parent b817f4c commit 50bf3e4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ public class GreeBindingConstants {
public static final int DIGITS_TEMP = 1;

/**
* The internal offset for the temperature sensor which is set to a constant of -40 degrees Celsius. GREE airconditioners usually
* return a value from the temperature sensor which is offset by +40 degrees Celsius. The temperature value shown on the device
* LCD display should match the value shown by this binding when the config parameter currentTemperatureOffset is set to 0.
* The internal offset for the temperature sensor which is set to a constant of -40 degrees Celsius. GREE
* airconditioners usually return a value from the temperature sensor which is offset by +40 degrees Celsius. The
* temperature value shown on the device LCD display should match the value shown by this binding when the config
* parameter currentTemperatureOffset is set to 0.
*
* @See https://github.com/tomikaa87/gree-remote#getting-the-current-temperature-reading-from-the-internal-sensor for more details.
* @See https://github.com/tomikaa87/gree-remote#getting-the-current-temperature-reading-from-the-internal-sensor
* for more details.
*/
public static final double INTERNAL_TEMP_SENSOR_OFFSET = -40.0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.openhab.binding.gree.internal;

import java.math.BigDecimal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
Expand All @@ -27,12 +28,14 @@ public class GreeConfiguration {
public String broadcastAddress = "";
public int refresh = 60;
/**
* The currentTemperatureOffset is configureable in case the user wants to offset this temperature for calibration of the temperature sensor.
* The currentTemperatureOffset is configureable in case the user wants to offset this temperature for calibration
* of the temperature sensor.
*/
public BigDecimal currentTemperatureOffset = new BigDecimal(0.0);

@Override
public String toString() {
return "Config: ipAddress=" + ipAddress + ", broadcastAddress=" + broadcastAddress + ", refresh=" + refresh + ", currentTemperatureOffset=" + currentTemperatureOffset;
return "Config: ipAddress=" + ipAddress + ", broadcastAddress=" + broadcastAddress + ", refresh=" + refresh
+ ", currentTemperatureOffset=" + currentTemperatureOffset;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ private void publishChannel(ChannelUID channelUID) {

private @Nullable State updateCurrentTemp() throws GreeException {
if (device.hasStatusValChanged(GREE_PROP_CURRENT_TEMP_SENSOR)) {
return new DecimalType(device.getIntStatusVal(GREE_PROP_CURRENT_TEMP_SENSOR) + INTERNAL_TEMP_SENSOR_OFFSET + config.currentTemperatureOffset.doubleValue());
return new DecimalType(device.getIntStatusVal(GREE_PROP_CURRENT_TEMP_SENSOR) + INTERNAL_TEMP_SENSOR_OFFSET
+ config.currentTemperatureOffset.doubleValue());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
<thing-type id="airconditioner">
<label>@text/thing-type.gree.airconditioner.label</label>
<channels>
<channel id="power" typeId="system.power" />
<channel id="mode" typeId="mode" />
<channel id="temperature" typeId="targetTemperature" />
<channel id="currentTemperature" typeId="currentTemperature" />
<channel id="air" typeId="air" />
<channel id="dry" typeId="dry" />
<channel id="turbo" typeId="turbo" />
<channel id="windspeed" typeId="windspeed" />
<channel id="quiet" typeId="quiet" />
<channel id="swingUpDown" typeId="swingUpDown" />
<channel id="swingLeftRight" typeId="swingLeftRight" />
<channel id="powersave" typeId="powersave" />
<channel id="light" typeId="light" />
<channel id="health" typeId="health" />
<channel id="power" typeId="system.power"/>
<channel id="mode" typeId="mode"/>
<channel id="temperature" typeId="targetTemperature"/>
<channel id="currentTemperature" typeId="currentTemperature"/>
<channel id="air" typeId="air"/>
<channel id="dry" typeId="dry"/>
<channel id="turbo" typeId="turbo"/>
<channel id="windspeed" typeId="windspeed"/>
<channel id="quiet" typeId="quiet"/>
<channel id="swingUpDown" typeId="swingUpDown"/>
<channel id="swingLeftRight" typeId="swingLeftRight"/>
<channel id="powersave" typeId="powersave"/>
<channel id="light" typeId="light"/>
<channel id="health" typeId="health"/>
</channels>

<config-description>
Expand Down

0 comments on commit 50bf3e4

Please sign in to comment.