Skip to content

Commit

Permalink
[magic] Added a trigger channel for easier tests (openhab#1853)
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <[email protected]>
  • Loading branch information
kaikreuzer authored Nov 27, 2020
1 parent f6d3f1d commit 9e89a4d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public MagicOnOffLightHandler(Thing thing) {

@Override
public void handleCommand(ChannelUID channelUID, Command command) {
triggerChannel("trigger", command.toString());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,15 @@
<label>Image</label>
</channel-type>

<channel-type id="trigger">
<kind>trigger</kind>
<label>Trigger</label>
<event>
<options>
<option value="ON">Switched on</option>
<option value="OFF">Switched off</option>
</options>
</event>
</channel-type>

</thing:thing-descriptions>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<channels>
<channel id="switch" typeId="switch"/>
<channel id="trigger" typeId="trigger"/>
</channels>

<config-description>
Expand Down

0 comments on commit 9e89a4d

Please sign in to comment.