mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[amazonechocontrol] bugfixes (#9118)
* fix color channel for smarthome devices * fix smarthome devices not updating Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
parent
c83af2c66d
commit
a5940bc141
@ -932,7 +932,7 @@ public class AccountHandler extends BaseBridgeHandler implements IWebSocketComma
|
||||
|
||||
private synchronized void updateSmartHomeState(@Nullable String deviceFilterId) {
|
||||
try {
|
||||
logger.debug("updateSmartHomeState started");
|
||||
logger.debug("updateSmartHomeState started with deviceFilterId={}", deviceFilterId);
|
||||
Connection connection = this.connection;
|
||||
if (connection == null || !connection.getIsLoggedIn()) {
|
||||
return;
|
||||
@ -976,8 +976,10 @@ public class AccountHandler extends BaseBridgeHandler implements IWebSocketComma
|
||||
logger.debug("Device update {} suspended", id);
|
||||
continue;
|
||||
}
|
||||
if (id.equals(deviceFilterId)) {
|
||||
if (deviceFilterId == null || id.equals(deviceFilterId)) {
|
||||
smartHomeDeviceHandler.updateChannelStates(allDevices, applianceIdToCapabilityStates);
|
||||
} else {
|
||||
logger.trace("Id {} not matching filter {}", id, deviceFilterId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,11 +113,10 @@ public class HandlerColorController extends HandlerBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lastColorName == null) {
|
||||
lastColorName = colorNameValue;
|
||||
} else if (colorNameValue == null && lastColorName != null) {
|
||||
if (colorNameValue == null && lastColorName != null) {
|
||||
colorNameValue = lastColorName;
|
||||
}
|
||||
lastColorName = colorNameValue;
|
||||
updateState(COLOR_PROPERTIES.channelId,
|
||||
lastColorName == null ? UnDefType.UNDEF : new StringType(lastColorName));
|
||||
}
|
||||
@ -134,7 +133,7 @@ public class HandlerColorController extends HandlerBase {
|
||||
colorObject.addProperty("hue", color.getHue());
|
||||
colorObject.addProperty("saturation", color.getSaturation().floatValue() / 100);
|
||||
colorObject.addProperty("brightness", color.getBrightness().floatValue() / 100);
|
||||
connection.smartHomeCommand(entityId, "setColor", "color", colorObject);
|
||||
connection.smartHomeCommand(entityId, "setColor", "value", colorObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user