Skip to content

Commit f52ac2b

Browse files
committed
Added additional logging
Signed-off-by: Konstantin Panchenko <kpanchen@konstantech.com>
1 parent 3d516ef commit f52ac2b

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

META-INF/MANIFEST.MF

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ Bundle-Version: 2.5.0.qualifier
1111
Import-Package:
1212
com.google.gson,
1313
com.google.gson.annotations,
14+
javax.measure.quantity,
1415
org.apache.commons.lang,
1516
org.eclipse.jdt.annotation;resolution:=optional,
16-
org.eclipse.jetty.client;version="9.4.11",
17-
org.eclipse.jetty.client.api;version="9.4.11",
18-
org.eclipse.jetty.client.util;version="9.4.11",
19-
org.eclipse.jetty.http;version="9.4.11",
20-
org.eclipse.jetty.util;version="9.4.11",
21-
org.eclipse.jetty.util.component;version="9.4.11",
17+
org.eclipse.jetty.client,
18+
org.eclipse.jetty.client.api,
19+
org.eclipse.jetty.client.util,
20+
org.eclipse.jetty.http,
21+
org.eclipse.jetty.util,
22+
org.eclipse.jetty.util.component,
2223
org.eclipse.smarthome.config.core,
24+
org.eclipse.smarthome.config.discovery,
2325
org.eclipse.smarthome.core.library.types,
2426
org.eclipse.smarthome.core.library.unit,
2527
org.eclipse.smarthome.core.thing,
@@ -28,10 +30,8 @@ Import-Package:
2830
org.eclipse.smarthome.core.thing.type,
2931
org.eclipse.smarthome.core.types,
3032
org.eclipse.smarthome.core.util,
33+
org.eclipse.smarthome.io.net.http,
34+
org.osgi.framework,
3135
org.slf4j
3236
Service-Component: OSGI-INF/*.xml
33-
Require-Bundle: org.eclipse.smarthome.config.discovery,
34-
org.eclipse.smarthome.io.net,
35-
org.apache.commons.lang,
36-
javax.measure.unit-api,
37-
org.eclipse.osgi
37+

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,23 @@ HeatSetPoint - Heat set point for the zone (Read / Write)<br />
6060
Thing example:
6161

6262
```
63-
Bridge icomfortwifi:account:demoaccount "My Acoount" @ "My House" [ userName = "johndoe", password = "supersecret", refreshInterval = 60] {<br />
64-
Thing zone home_zone_1 "Zone 1" @ "Whole House" [ id = "WS12A34567_0", name = "Main Zone" ]<br />
65-
}<br />
63+
Bridge icomfortwifi:account:demoaccount "My Acoount" @ "My House" [ userName = "johndoe", password = "supersecret", refreshInterval = 60] {
64+
Thing zone home_zone_1 "Zone 1" @ "Whole House" [ id = "WS12A34567_0", name = "Main Zone" ]
65+
}
6666
```
6767

6868
Items example:
6969

7070
```
71-
//Zone items<br />
72-
Number:Temperature Thermostat_Temperature "Temperature [%.1f %unit%]" <temperature> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:Temperature"}<br />
73-
Number:Dimensionless Thermostat_Humudity "Humidity [%.1f %unit%]" <humidity> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:Humidity"}<br />
74-
String Thermostat_Status "System Status [%s]" <heating> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:SystemStatus"}<br />
75-
String Thermostat_Mode "Operation Mode [%s]" <heating> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:OperationMode"}<br />
76-
String Thermostat_Away_Mode "Away Mode [%s]" <heating> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:AwayMode"}<br />
77-
String Thermostat_Fan_Mode "Fan Mode [%s]" <fan> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:FanMode"}<br />
78-
Number:Temperature Thermostat_Cool_Point "Cool Set Point [%.1f %unit%]" <temperature> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:CoolSetPoint"}<br />
79-
Number:Temperature Thermostat_Heat_Point "Heat Set Point [%.1f %unit%]" <temperature> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:HeatSetPoint"}<br />
71+
//Zone items
72+
Number:Temperature Thermostat_Temperature "Temperature [%.1f %unit%]" <temperature> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:Temperature"}
73+
Number:Dimensionless Thermostat_Humudity "Humidity [%.1f %unit%]" <humidity> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:Humidity"}
74+
String Thermostat_Status "System Status [%s]" <heating> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:SystemStatus"}
75+
String Thermostat_Mode "Operation Mode [%s]" <heating> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:OperationMode"}
76+
String Thermostat_Away_Mode "Away Mode [%s]" <heating> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:AwayMode"}
77+
String Thermostat_Fan_Mode "Fan Mode [%s]" <fan> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:FanMode"}
78+
Number:Temperature Thermostat_Cool_Point "Cool Set Point [%.1f %unit%]" <temperature> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:CoolSetPoint"}
79+
Number:Temperature Thermostat_Heat_Point "Heat Set Point [%.1f %unit%]" <temperature> (gWholeHouse) {channel="icomfortwifi:zone:demoaccount:home_zone_1:HeatSetPoint"}
8080
```
8181

8282
## Foot note!

src/main/java/org/openhab/binding/icomfortwifi/handler/iComfortWiFiHeatingZoneHandler.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package org.openhab.binding.icomfortwifi.handler;
1010

1111
import javax.measure.quantity.Temperature;
12-
//import javax.measure.quantity.Time;
1312

1413
import org.eclipse.smarthome.core.library.types.QuantityType;
1514
import org.eclipse.smarthome.core.library.types.StringType;
@@ -23,6 +22,8 @@
2322
import org.eclipse.smarthome.core.types.RefreshType;
2423
import org.openhab.binding.icomfortwifi.iComfortWiFiBindingConstants;
2524
import org.openhab.binding.icomfortwifi.internal.api.models.response.ZoneStatus;
25+
import org.slf4j.Logger;
26+
import org.slf4j.LoggerFactory;
2627

2728
/**
2829
* The {@link iComfortWiFiHeatingZoneHandler} is responsible for handling commands, which are
@@ -32,6 +33,7 @@
3233
*/
3334
public class iComfortWiFiHeatingZoneHandler extends BaseiComfortWiFiHandler {
3435

36+
private final Logger logger = LoggerFactory.getLogger(iComfortWiFiHeatingZoneHandler.class);
3537
// private static final int CANCEL_SET_POINT_OVERRIDE = 0;
3638
private ThingStatus tcsStatus;
3739
private ZoneStatus zoneStatus;
@@ -82,6 +84,9 @@ public void update(ThingStatus tcsStatus, ZoneStatus zoneStatus) {
8284
@SuppressWarnings("unchecked")
8385
@Override
8486
public void handleCommand(ChannelUID channelUID, Command command) {
87+
logger.debug("Entering Heating Zone Handler for Gateway {}, zone {}", zoneStatus.gatewaySN,
88+
zoneStatus.zoneNumber);
89+
logger.debug("Executing command {}", command.toString());
8590

8691
if (command == RefreshType.REFRESH) {
8792
update(tcsStatus, zoneStatus);
@@ -93,6 +98,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
9398
bridge.setZoneAwayMode(zoneStatus,
9499
ZoneStatus.AwayStatus.valueOf(command.toString()).getAwayValue());
95100
} else if (zoneStatus.awayMode == ZoneStatus.AwayStatus.AWAY_OFF) {
101+
logger.debug("Zone is not in Away mode, executing the command");
96102
if (iComfortWiFiBindingConstants.ZONE_COOL_SET_POINT_CHANNEL.equals(channelId)
97103
&& command instanceof QuantityType) {
98104
bridge.setZoneCoolingPoint(zoneStatus, ((QuantityType<Temperature>) command).doubleValue());
@@ -110,6 +116,8 @@ public void handleCommand(ChannelUID channelUID, Command command) {
110116
ZoneStatus.FanMode.valueOf(command.toString()).getFanModeValue());
111117

112118
}
119+
} else {
120+
logger.debug("Zone is in Away mode, not executing the command");
113121
}
114122
}
115123
}

src/main/java/org/openhab/binding/icomfortwifi/internal/api/iComfortWiFiApiClientException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
public class iComfortWiFiApiClientException extends Exception {
1818

19+
private static final long serialVersionUID = 9991L;
20+
1921
public iComfortWiFiApiClientException() {
2022
}
2123

0 commit comments

Comments
 (0)