mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-02-09 13:57:00 +01:00
[deconz] fix alert channel (#9441)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
parent
00c73deabd
commit
4f0caf1a1f
@ -174,7 +174,7 @@ Other devices support
|
|||||||
| valve | Number:Dimensionless | R | Valve position in % | `thermostat` |
|
| valve | Number:Dimensionless | R | Valve position in % | `thermostat` |
|
||||||
| mode | String | R/W | Mode: "auto", "heat" and "off" | `thermostat` |
|
| mode | String | R/W | Mode: "auto", "heat" and "off" | `thermostat` |
|
||||||
| offset | Number | R | Temperature offset for sensor | `thermostat` |
|
| offset | Number | R | Temperature offset for sensor | `thermostat` |
|
||||||
| alert | Switch | R/W | Turn alerts on/off | `warningdevice`, `lightgroup` |
|
| alert | String | W | Turn alerts on. Allowed commands are `none`, `select` (short blinking), `lselect` (long blinking) | `warningdevice`, `lightgroup`, `dimmablelight`, `colorlight`, `extendedcolorlight`, `colortemperaturelight` |
|
||||||
| all_on | Switch | R | All lights in group are on | `lightgroup` |
|
| all_on | Switch | R | All lights in group are on | `lightgroup` |
|
||||||
| any_on | Switch | R | Any light in group is on | `lightgroup` |
|
| any_on | Switch | R | Any light in group is on | `lightgroup` |
|
||||||
| scene | String | W | Recall a scene. Allowed commands are set dynamically | `lightgroup` |
|
| scene | String | W | Recall a scene. Allowed commands are set dynamically | `lightgroup` |
|
||||||
|
@ -76,8 +76,8 @@ public class GroupThingHandler extends DeconzBaseThingHandler {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CHANNEL_ALERT:
|
case CHANNEL_ALERT:
|
||||||
if (command instanceof OnOffType) {
|
if (command instanceof StringType) {
|
||||||
newGroupAction.alert = command == OnOffType.ON ? "alert" : "none";
|
newGroupAction.alert = command.toString();
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -132,8 +132,8 @@ public class LightThingHandler extends DeconzBaseThingHandler {
|
|||||||
|
|
||||||
switch (channelUID.getId()) {
|
switch (channelUID.getId()) {
|
||||||
case CHANNEL_ALERT:
|
case CHANNEL_ALERT:
|
||||||
if (command instanceof OnOffType) {
|
if (command instanceof StringType) {
|
||||||
newLightState.alert = command == OnOffType.ON ? "alert" : "none";
|
newLightState.alert = command.toString();
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -360,7 +360,10 @@ public class LightThingHandler extends DeconzBaseThingHandler {
|
|||||||
|
|
||||||
switch (channelId) {
|
switch (channelId) {
|
||||||
case CHANNEL_ALERT:
|
case CHANNEL_ALERT:
|
||||||
updateState(channelId, "alert".equals(newState.alert) ? OnOffType.ON : OnOffType.OFF);
|
String alert = newState.alert;
|
||||||
|
if (alert != null) {
|
||||||
|
updateState(channelId, new StringType(alert));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CHANNEL_SWITCH:
|
case CHANNEL_SWITCH:
|
||||||
case CHANNEL_LOCK:
|
case CHANNEL_LOCK:
|
||||||
|
@ -25,9 +25,16 @@
|
|||||||
</thing-type>
|
</thing-type>
|
||||||
|
|
||||||
<channel-type id="alert">
|
<channel-type id="alert">
|
||||||
<item-type>Switch</item-type>
|
<item-type>String</item-type>
|
||||||
<label>Alert</label>
|
<label>Alert</label>
|
||||||
<category>Alarm</category>
|
<category>Alarm</category>
|
||||||
|
<command>
|
||||||
|
<options>
|
||||||
|
<option value="none">No Alarm</option>
|
||||||
|
<option value="select">Blinking (short time)</option>
|
||||||
|
<option value="lselect">Blinking (long time)</option>
|
||||||
|
</options>
|
||||||
|
</command>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|
||||||
<channel-type id="all_on">
|
<channel-type id="all_on">
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
<category>Lightbulb</category>
|
<category>Lightbulb</category>
|
||||||
<channels>
|
<channels>
|
||||||
<channel typeId="brightness" id="brightness"/>
|
<channel typeId="brightness" id="brightness"/>
|
||||||
|
<channel id="alert" typeId="alert"></channel>
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
<representation-property>uid</representation-property>
|
<representation-property>uid</representation-property>
|
||||||
@ -77,6 +78,7 @@
|
|||||||
<channels>
|
<channels>
|
||||||
<channel typeId="brightness" id="brightness"/>
|
<channel typeId="brightness" id="brightness"/>
|
||||||
<channel typeId="ct" id="color_temperature"/>
|
<channel typeId="ct" id="color_temperature"/>
|
||||||
|
<channel id="alert" typeId="alert"></channel>
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
<representation-property>uid</representation-property>
|
<representation-property>uid</representation-property>
|
||||||
@ -93,6 +95,7 @@
|
|||||||
<category>Lightbulb</category>
|
<category>Lightbulb</category>
|
||||||
<channels>
|
<channels>
|
||||||
<channel typeId="color" id="color"/>
|
<channel typeId="color" id="color"/>
|
||||||
|
<channel id="alert" typeId="alert"></channel>
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
<representation-property>uid</representation-property>
|
<representation-property>uid</representation-property>
|
||||||
@ -110,6 +113,7 @@
|
|||||||
<channels>
|
<channels>
|
||||||
<channel typeId="color" id="color"/>
|
<channel typeId="color" id="color"/>
|
||||||
<channel typeId="ct" id="color_temperature"/>
|
<channel typeId="ct" id="color_temperature"/>
|
||||||
|
<channel id="alert" typeId="alert"></channel>
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
<representation-property>uid</representation-property>
|
<representation-property>uid</representation-property>
|
||||||
@ -195,9 +199,16 @@
|
|||||||
</channel-type>
|
</channel-type>
|
||||||
|
|
||||||
<channel-type id="alert">
|
<channel-type id="alert">
|
||||||
<item-type>Switch</item-type>
|
<item-type>String</item-type>
|
||||||
<label>Alert</label>
|
<label>Alert</label>
|
||||||
<category>Alarm</category>
|
<category>Alarm</category>
|
||||||
|
<command>
|
||||||
|
<options>
|
||||||
|
<option value="none">No Alarm</option>
|
||||||
|
<option value="select">Blinking (short time)</option>
|
||||||
|
<option value="lselect">Blinking (long time)</option>
|
||||||
|
</options>
|
||||||
|
</command>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|
||||||
<channel-type id="lock">
|
<channel-type id="lock">
|
||||||
|
Loading…
Reference in New Issue
Block a user