mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +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 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