Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: lsiepel <[email protected]>
Signed-off-by: Cody Cutrer <[email protected]>
  • Loading branch information
ccutrer and lsiepel committed Oct 7, 2024
1 parent 603a0d3 commit 1322461
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ public void updateChannelState(ChannelUID channel, State state) {
// channel. all the rest we can just check against the basic ID
if (channel.equals(onOffChannel.getChannel().getUID())) {
if (localColorChannel != null) {
HSBType newOnState = colorValue.getChannelState() instanceof HSBType
? (HSBType) colorValue.getChannelState()
HSBType newOnState = colorValue.getChannelState() instanceof HSBType newOnStateTmp
? newOnStateTmp
: HSBType.WHITE;
if (state.equals(OnOffType.ON)) {
colorValue.update(newOnState);
Expand All @@ -314,8 +314,7 @@ public void updateChannelState(ChannelUID channel, State state) {
} else if (localBrightnessChannel != null && localBrightnessChannel.getChannel().getUID().equals(channel)) {
onOffValue.update(Objects.requireNonNull(state.as(OnOffType.class)));
if (localColorChannel != null) {
if (colorValue.getChannelState() instanceof HSBType) {
HSBType hsb = (HSBType) (colorValue.getChannelState());
if (colorValue.getChannelState() instanceof HSBType hsb) {
colorValue.update(new HSBType(hsb.getHue(), hsb.getSaturation(),
(PercentType) brightnessValue.getChannelState()));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void initialize() {

addComponent(component);
} catch (ConfigurationException e) {
logger.error("Cannot restore component {}: {}", thing, e.getMessage());
logger.warn("Cannot restore component {}: {}", thing, e.getMessage());
}
}
if (updateThingType(typeID)) {
Expand Down

0 comments on commit 1322461

Please sign in to comment.