diff --git a/bundles/org.openhab.binding.ojelectronics/src/main/java/org/openhab/binding/ojelectronics/internal/ThermostatHandler.java b/bundles/org.openhab.binding.ojelectronics/src/main/java/org/openhab/binding/ojelectronics/internal/ThermostatHandler.java index 10098113e44..80a889584e4 100644 --- a/bundles/org.openhab.binding.ojelectronics/src/main/java/org/openhab/binding/ojelectronics/internal/ThermostatHandler.java +++ b/bundles/org.openhab.binding.ojelectronics/src/main/java/org/openhab/binding/ojelectronics/internal/ThermostatHandler.java @@ -212,7 +212,7 @@ public class ThermostatHandler extends BaseThingHandler { private void updateBoostEndTime(Command command) { if (command instanceof DateTimeType dateTimeCommand) { - getCurrentThermostat().boostEndTime = Date.from(dateTimeCommand.getZonedDateTime().toInstant()); + getCurrentThermostat().boostEndTime = Date.from(dateTimeCommand.getInstant()); } else { logger.warn("Unable to set value {}", command); } @@ -225,8 +225,7 @@ public class ThermostatHandler extends BaseThingHandler { private void updateComfortEndTime(Command command) { if (command instanceof DateTimeType dateTimeCommand) { - getCurrentThermostat().comfortEndTime = Objects - .requireNonNull(Date.from(dateTimeCommand.getZonedDateTime().toInstant())); + getCurrentThermostat().comfortEndTime = Objects.requireNonNull(Date.from(dateTimeCommand.getInstant())); } else { logger.warn("Unable to set value {}", command); } @@ -329,7 +328,7 @@ public class ThermostatHandler extends BaseThingHandler { private void updateVacationBeginDay(Command command) { if (command instanceof DateTimeType dateTimeCommand) { getCurrentThermostat().vacationBeginDay = Date - .from(dateTimeCommand.getZonedDateTime().toInstant().truncatedTo(ChronoUnit.DAYS)); + .from(dateTimeCommand.getInstant().truncatedTo(ChronoUnit.DAYS)); } else { logger.warn("Unable to set value {}", command); } @@ -345,7 +344,7 @@ public class ThermostatHandler extends BaseThingHandler { private void updateVacationEndDay(Command command) { if (command instanceof DateTimeType dateTimeCommand) { getCurrentThermostat().vacationEndDay = Date - .from(dateTimeCommand.getZonedDateTime().toInstant().truncatedTo(ChronoUnit.DAYS)); + .from(dateTimeCommand.getInstant().truncatedTo(ChronoUnit.DAYS)); } else { logger.warn("Unable to set value {}", command); }