Skip to content

Commit

Permalink
Fix two events being logged when off. (openhab#11786)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Skinner <matt@pcmus.com>
  • Loading branch information
Skinah authored and Nemer_Daud committed Jan 28, 2022
1 parent c75c2cd commit 0173e10
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ protected void processState() throws ApiException {
}
HSBType tempHSB = WLedHelper
.parseToHSBType(state.stateResponse.seg[handler.config.segmentIndex].col[0].toString());
handler.update(CHANNEL_MASTER_CONTROLS, tempHSB);
handler.update(CHANNEL_PRIMARY_COLOR, tempHSB);
handler.update(CHANNEL_SECONDARY_COLOR,
WLedHelper.parseToHSBType(state.stateResponse.seg[handler.config.segmentIndex].col[1].toString()));
Expand All @@ -283,6 +282,7 @@ protected void processState() throws ApiException {
handler.update(CHANNEL_MASTER_CONTROLS, OnOffType.OFF);
handler.update(CHANNEL_SEGMENT_BRIGHTNESS, OnOffType.OFF);
} else {
handler.update(CHANNEL_MASTER_CONTROLS, tempHSB);
handler.update(CHANNEL_SEGMENT_BRIGHTNESS,
new PercentType(new BigDecimal(state.stateResponse.seg[handler.config.segmentIndex].bri)
.divide(BIG_DECIMAL_2_55, RoundingMode.HALF_UP)));
Expand Down

0 comments on commit 0173e10

Please sign in to comment.