[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:
LukasA83 2020-12-01 02:30:00 +01:00 committed by GitHub
parent 27f280cfa2
commit d3b9bd592b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}); });

View File

@ -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())