mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 07:02:02 +01:00
Simplify DateTimeType handling for Broadlink
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
c02a7345e1
commit
bb9a789d31
@ -16,6 +16,7 @@ import static org.openhab.binding.broadlinkthermostat.internal.BroadlinkBindingC
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -212,7 +213,7 @@ public class FloureonThermostatHandler extends BroadlinkBaseHandler {
|
||||
|
||||
private void handleSetTimeCommand(ChannelUID channelUID, Command command) {
|
||||
if (command instanceof DateTimeType dateTimeCommand) {
|
||||
ZonedDateTime zonedDateTime = dateTimeCommand.getZonedDateTime();
|
||||
ZonedDateTime zonedDateTime = dateTimeCommand.getZonedDateTime(ZoneId.systemDefault());
|
||||
try {
|
||||
new SetTimeCommand(tob(zonedDateTime.getHour()), tob(zonedDateTime.getMinute()),
|
||||
tob(zonedDateTime.getSecond()), tob(zonedDateTime.getDayOfWeek().getValue()))
|
||||
|
Loading…
Reference in New Issue
Block a user