Skip to content

Commit

Permalink
fix some review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Lange <vich-667@gmx.de>
  • Loading branch information
Tobias Lange committed Mar 12, 2023
1 parent 2ffd1d5 commit 355aced
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private void updateDimmableLight(@Nullable LevelControlModel levelControlModel)

private void updateColorLight(@Nullable ColorControlModel colorControlModel,
@Nullable LevelControlModel levelControlModel, @Nullable SimpleOnOffModel simpleOnOff) {
if (colorControlModel != null && levelControlModel != null) {
if (colorControlModel != null && levelControlModel != null && simpleOnOff != null) {
DecimalType hue = new DecimalType(colorControlModel.hue);
PercentType saturation = ColorControlModel.toPercent(colorControlModel.saturation);
PercentType brightness;
Expand Down Expand Up @@ -526,12 +526,12 @@ public void handleCommand(ChannelUID channelUID, Command command) {
}
break;
case CHANNEL_COLORTEMPERATURE:
BigDecimal color_temperature = null;
BigDecimal colorTemperature = null;
if (command instanceof PercentType) {
color_temperature = ((PercentType) command).toBigDecimal();
colorTemperature = ((PercentType) command).toBigDecimal();
}
if (color_temperature != null) {
int pct = color_temperature.intValue();
if (colorTemperature != null) {
int pct = colorTemperature.intValue();
int temperature = 2700;
if (pct <= 6) {
temperature = 2700;
Expand Down

0 comments on commit 355aced

Please sign in to comment.