mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 23:22:02 +01:00
[mqtt.homeassistant] fix JSON Schema lights (#14717)
https://github.com/openhab/openhab-addons/pull/12238 was merged after JSON Schema Light was implemented, and changed some assumptions. this commit adjusts to the changed interface Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
parent
0a3d9ece3c
commit
2c2ba4bed1
@ -181,17 +181,18 @@ public class JSONSchemaLight extends AbstractRawSchemaLight {
|
||||
}
|
||||
|
||||
if (jsonState.state != null) {
|
||||
onOffValue.update(new StringType(jsonState.state));
|
||||
onOffValue.update(onOffValue.parseCommand(new StringType(jsonState.state)));
|
||||
if (brightnessValue.getChannelState() instanceof UnDefType) {
|
||||
brightnessValue.update((OnOffType) onOffValue.getChannelState());
|
||||
brightnessValue.update(brightnessValue.parseCommand((OnOffType) onOffValue.getChannelState()));
|
||||
}
|
||||
if (colorValue.getChannelState() instanceof UnDefType) {
|
||||
colorValue.update((OnOffType) onOffValue.getChannelState());
|
||||
colorValue.update(colorValue.parseCommand((OnOffType) onOffValue.getChannelState()));
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonState.brightness != null) {
|
||||
brightnessValue.update(new DecimalType(Objects.requireNonNull(jsonState.brightness)));
|
||||
brightnessValue.update(
|
||||
brightnessValue.parseCommand(new DecimalType(Objects.requireNonNull(jsonState.brightness))));
|
||||
if (colorValue.getChannelState() instanceof HSBType) {
|
||||
HSBType color = (HSBType) colorValue.getChannelState();
|
||||
colorValue.update(new HSBType(color.getHue(), color.getSaturation(),
|
||||
|
Loading…
Reference in New Issue
Block a user