Added Channel of DateTimeType (#2347)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>pull/2378/head
parent
305683ac6a
commit
aa48f5990e
|
@ -13,6 +13,7 @@
|
||||||
package org.openhab.core.magic.binding.handler;
|
package org.openhab.core.magic.binding.handler;
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
|
import org.openhab.core.library.types.DateTimeType;
|
||||||
import org.openhab.core.thing.ChannelUID;
|
import org.openhab.core.thing.ChannelUID;
|
||||||
import org.openhab.core.thing.Thing;
|
import org.openhab.core.thing.Thing;
|
||||||
import org.openhab.core.thing.ThingStatus;
|
import org.openhab.core.thing.ThingStatus;
|
||||||
|
@ -35,6 +36,7 @@ public class MagicOnOffLightHandler extends BaseThingHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handleCommand(ChannelUID channelUID, Command command) {
|
public void handleCommand(ChannelUID channelUID, Command command) {
|
||||||
triggerChannel("trigger", command.toString());
|
triggerChannel("trigger", command.toString());
|
||||||
|
updateState("timestamp", new DateTimeType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -152,4 +152,10 @@
|
||||||
</event>
|
</event>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|
||||||
|
<channel-type id="timestamp">
|
||||||
|
<item-type>DateTime</item-type>
|
||||||
|
<label>Timestamp</label>
|
||||||
|
<category>time</category>
|
||||||
|
</channel-type>
|
||||||
|
|
||||||
</thing:thing-descriptions>
|
</thing:thing-descriptions>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
<channels>
|
<channels>
|
||||||
<channel id="switch" typeId="switch"/>
|
<channel id="switch" typeId="switch"/>
|
||||||
|
<channel id="timestamp" typeId="timestamp"/>
|
||||||
<channel id="trigger" typeId="trigger"/>
|
<channel id="trigger" typeId="trigger"/>
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue