mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
Simplify DateTimeType handling for LaMetric
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
d52da9fd24
commit
665a4e752f
@ -15,6 +15,7 @@ package org.openhab.binding.lametrictime.internal.handler;
|
||||
import static org.openhab.binding.lametrictime.internal.LaMetricTimeBindingConstants.*;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
@ -53,7 +54,7 @@ public class ClockAppHandler extends AbstractLaMetricTimeAppHandler {
|
||||
try {
|
||||
switch (channelUID.getId()) {
|
||||
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));
|
||||
updateActiveAppOnDevice();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user