Skip to content

Commit

Permalink
[opensprinkler] Fix type cast exception (#6649)
Browse files Browse the repository at this point in the history
Fixes #6646

Signed-off-by: Florian <[email protected]>
  • Loading branch information
FlorianSW authored and kaikreuzer committed Dec 29, 2019
1 parent c92046a commit 5194625
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ public void handleCommand(ChannelUID channelUID, Command command) {

private void handleNextDurationCommand(ChannelUID channelUID, Command command) {
if (!(command instanceof QuantityType<?>)) {
logger.info("Ignoring implausible non-DecimalType command for NEXT_DURATION");
logger.info("Ignoring implausible non-QuantityType command for NEXT_DURATION");
return;
}
this.nextDurationTime = ((QuantityType<?>) command).toBigDecimal();
updateState(channelUID, (DecimalType) command);
QuantityType<?> quantity = (QuantityType<?>) command;
this.nextDurationTime = quantity.toBigDecimal();
updateState(channelUID, quantity);
}

private void handleStationStateCommand(OpenSprinklerApi api, Command command) {
Expand Down

0 comments on commit 5194625

Please sign in to comment.