mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Simplify DateTimeType handling for LaMetric
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
c6087e6b00
commit
32bf72a858
@ -15,6 +15,7 @@ package org.openhab.binding.lametrictime.internal.handler;
|
|||||||
import static org.openhab.binding.lametrictime.internal.LaMetricTimeBindingConstants.*;
|
import static org.openhab.binding.lametrictime.internal.LaMetricTimeBindingConstants.*;
|
||||||
|
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
@ -53,7 +54,7 @@ public class ClockAppHandler extends AbstractLaMetricTimeAppHandler {
|
|||||||
try {
|
try {
|
||||||
switch (channelUID.getId()) {
|
switch (channelUID.getId()) {
|
||||||
case CHANNEL_APP_SET_ALARM: {
|
case CHANNEL_APP_SET_ALARM: {
|
||||||
LocalTime time = ((DateTimeType) command).getZonedDateTime().toLocalTime();
|
LocalTime time = ((DateTimeType) command).getZonedDateTime(ZoneId.systemDefault()).toLocalTime();
|
||||||
getDevice().doAction(getWidget(), CoreApps.clock().setAlarm(true, time, null));
|
getDevice().doAction(getWidget(), CoreApps.clock().setAlarm(true, time, null));
|
||||||
updateActiveAppOnDevice();
|
updateActiveAppOnDevice();
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user