Simplify DateTimeType handling for Broadlink

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen
2024-12-19 11:56:36 +01:00
committed by lsiepel
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()))