[deconz] Fix Thermostat setting target temperature (#9189)
Improve logging on sending commands by checking http response status code Signed-off-by: Lukas Agethen <lukas83@gmx.de>
This commit is contained in:
parent
27f280cfa2
commit
d3b9bd592b
|
@ -194,9 +194,14 @@ public abstract class DeconzBaseThingHandler<T extends DeconzBaseMessage> extend
|
||||||
if (acceptProcessing != null) {
|
if (acceptProcessing != null) {
|
||||||
acceptProcessing.run();
|
acceptProcessing.run();
|
||||||
}
|
}
|
||||||
logger.trace("Result code={}, body={}", v.getResponseCode(), v.getBody());
|
if (v.getResponseCode() != java.net.HttpURLConnection.HTTP_OK) {
|
||||||
|
logger.warn("Sending command {} to channel {} failed: {} - {}", originalCommand, channelUID,
|
||||||
|
v.getResponseCode(), v.getBody());
|
||||||
|
} else {
|
||||||
|
logger.trace("Result code={}, body={}", v.getResponseCode(), v.getBody());
|
||||||
|
}
|
||||||
}).exceptionally(e -> {
|
}).exceptionally(e -> {
|
||||||
logger.debug("Sending command {} to channel {} failed: {} - {}", originalCommand, channelUID, e.getClass(),
|
logger.warn("Sending command {} to channel {} failed: {} - {}", originalCommand, channelUID, e.getClass(),
|
||||||
e.getMessage());
|
e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public enum ResourceType {
|
public enum ResourceType {
|
||||||
GROUPS("groups", "action"),
|
GROUPS("groups", "action"),
|
||||||
LIGHTS("lights", "state"),
|
LIGHTS("lights", "state"),
|
||||||
SENSORS("sensors", ""),
|
SENSORS("sensors", "config"),
|
||||||
UNKNOWN("", "");
|
UNKNOWN("", "");
|
||||||
|
|
||||||
private static final Map<String, ResourceType> MAPPING = Arrays.stream(ResourceType.values())
|
private static final Map<String, ResourceType> MAPPING = Arrays.stream(ResourceType.values())
|
||||||
|
|
Loading…
Reference in New Issue