From aa48f5990ea70a501c6d45beb7712b18e76a029f Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Thu, 6 May 2021 22:11:30 +0200 Subject: [PATCH] Added Channel of DateTimeType (#2347) Signed-off-by: Christoph Weitkamp --- .../core/magic/binding/handler/MagicOnOffLightHandler.java | 2 ++ .../src/main/resources/OH-INF/thing/channel-types.xml | 6 ++++++ .../src/main/resources/OH-INF/thing/thing-types.xml | 1 + 3 files changed, 9 insertions(+) diff --git a/bundles/org.openhab.core.test.magic/src/main/java/org/openhab/core/magic/binding/handler/MagicOnOffLightHandler.java b/bundles/org.openhab.core.test.magic/src/main/java/org/openhab/core/magic/binding/handler/MagicOnOffLightHandler.java index 9ea0a06e01..8c5cce2e29 100644 --- a/bundles/org.openhab.core.test.magic/src/main/java/org/openhab/core/magic/binding/handler/MagicOnOffLightHandler.java +++ b/bundles/org.openhab.core.test.magic/src/main/java/org/openhab/core/magic/binding/handler/MagicOnOffLightHandler.java @@ -13,6 +13,7 @@ package org.openhab.core.magic.binding.handler; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.library.types.DateTimeType; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; @@ -35,6 +36,7 @@ public class MagicOnOffLightHandler extends BaseThingHandler { @Override public void handleCommand(ChannelUID channelUID, Command command) { triggerChannel("trigger", command.toString()); + updateState("timestamp", new DateTimeType()); } @Override diff --git a/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/channel-types.xml b/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/channel-types.xml index 5331d04b5d..4c6a3d6670 100644 --- a/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/channel-types.xml @@ -152,4 +152,10 @@ + + DateTime + + time + + diff --git a/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/thing-types.xml index 259402321f..22d8657618 100644 --- a/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.core.test.magic/src/main/resources/OH-INF/thing/thing-types.xml @@ -17,6 +17,7 @@ +