mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Simplify DateTimeType handling for TA C.M.I.
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
86955bc39f
commit
2ba8a6d4b8
@ -14,6 +14,7 @@ package org.openhab.binding.tacmi.internal.schema;
|
|||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -298,7 +299,7 @@ public class TACmiSchemaHandler extends BaseThingHandler {
|
|||||||
val = String.format(Locale.US, "%.2f", qt.floatValue());
|
val = String.format(Locale.US, "%.2f", qt.floatValue());
|
||||||
} else if (command instanceof DateTimeType dtt) {
|
} else if (command instanceof DateTimeType dtt) {
|
||||||
// time is transferred as minutes since midnight...
|
// 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());
|
val = Integer.toString(zdt.getHour() * 60 + zdt.getMinute());
|
||||||
} else {
|
} else {
|
||||||
val = command.format("%.2f");
|
val = command.format("%.2f");
|
||||||
|
Loading…
Reference in New Issue
Block a user