mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
Added Channel of DateTimeType (#2347)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
305683ac6a
commit
aa48f5990e
@ -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
|
||||
|
@ -152,4 +152,10 @@
|
||||
</event>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="timestamp">
|
||||
<item-type>DateTime</item-type>
|
||||
<label>Timestamp</label>
|
||||
<category>time</category>
|
||||
</channel-type>
|
||||
|
||||
</thing:thing-descriptions>
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
<channels>
|
||||
<channel id="switch" typeId="switch"/>
|
||||
<channel id="timestamp" typeId="timestamp"/>
|
||||
<channel id="trigger" typeId="trigger"/>
|
||||
</channels>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user