Simplify DateTimeType handling for TA C.M.I.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2024-11-18 22:28:15 +01:00 committed by lsiepel
parent 86955bc39f
commit 2ba8a6d4b8

View File

@ -14,6 +14,7 @@ package org.openhab.binding.tacmi.internal.schema;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.time.ZoneId;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
@ -298,7 +299,7 @@ public class TACmiSchemaHandler extends BaseThingHandler {
val = String.format(Locale.US, "%.2f", qt.floatValue());
} else if (command instanceof DateTimeType dtt) {
// time is transferred as minutes since midnight...
var zdt = dtt.getZonedDateTime();
var zdt = dtt.getZonedDateTime(ZoneId.systemDefault());
val = Integer.toString(zdt.getHour() * 60 + zdt.getMinute());
} else {
val = command.format("%.2f");