[deconz] add doorlock support (#8965)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
@@ -62,6 +62,7 @@ public class BindingConstants {
|
||||
"extendedcolorlight");
|
||||
public static final ThingTypeUID THING_TYPE_WINDOW_COVERING = new ThingTypeUID(BINDING_ID, "windowcovering");
|
||||
public static final ThingTypeUID THING_TYPE_WARNING_DEVICE = new ThingTypeUID(BINDING_ID, "warningdevice");
|
||||
public static final ThingTypeUID THING_TYPE_DOORLOCK = new ThingTypeUID(BINDING_ID, "doorlock");
|
||||
|
||||
// groups
|
||||
public static final ThingTypeUID THING_TYPE_LIGHTGROUP = new ThingTypeUID(BINDING_ID, "lightgroup");
|
||||
@@ -110,6 +111,7 @@ public class BindingConstants {
|
||||
public static final String CHANNEL_ALERT = "alert";
|
||||
public static final String CHANNEL_ALL_ON = "all_on";
|
||||
public static final String CHANNEL_ANY_ON = "any_on";
|
||||
public static final String CHANNEL_LOCK = "lock";
|
||||
|
||||
// Thing configuration
|
||||
public static final String CONFIG_HOST = "host";
|
||||
|
||||
@@ -196,6 +196,9 @@ public class ThingDiscoveryService extends AbstractDiscoveryService implements D
|
||||
case WARNING_DEVICE:
|
||||
thingTypeUID = THING_TYPE_WARNING_DEVICE;
|
||||
break;
|
||||
case DOORLOCK:
|
||||
thingTypeUID = THING_TYPE_DOORLOCK;
|
||||
break;
|
||||
case CONFIGURATION_TOOL:
|
||||
// ignore configuration tool device
|
||||
return;
|
||||
|
||||
@@ -63,7 +63,7 @@ import com.google.gson.Gson;
|
||||
public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
||||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPE_UIDS = Set.of(THING_TYPE_COLOR_TEMPERATURE_LIGHT,
|
||||
THING_TYPE_DIMMABLE_LIGHT, THING_TYPE_COLOR_LIGHT, THING_TYPE_EXTENDED_COLOR_LIGHT, THING_TYPE_ONOFF_LIGHT,
|
||||
THING_TYPE_WINDOW_COVERING, THING_TYPE_WARNING_DEVICE);
|
||||
THING_TYPE_WINDOW_COVERING, THING_TYPE_WARNING_DEVICE, THING_TYPE_DOORLOCK);
|
||||
|
||||
private static final long DEFAULT_COMMAND_EXPIRY_TIME = 250; // in ms
|
||||
private static final int BRIGHTNESS_DIM_STEP = 26; // ~ 10%
|
||||
@@ -137,6 +137,7 @@ public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
||||
return;
|
||||
}
|
||||
case CHANNEL_SWITCH:
|
||||
case CHANNEL_LOCK:
|
||||
if (command instanceof OnOffType) {
|
||||
newLightState.on = (command == OnOffType.ON);
|
||||
} else {
|
||||
@@ -290,6 +291,7 @@ public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
||||
updateState(channelId, "alert".equals(newState.alert) ? OnOffType.ON : OnOffType.OFF);
|
||||
break;
|
||||
case CHANNEL_SWITCH:
|
||||
case CHANNEL_LOCK:
|
||||
if (on != null) {
|
||||
updateState(channelId, OnOffType.from(on));
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public enum LightType {
|
||||
WINDOW_COVERING_DEVICE("Window covering device"),
|
||||
CONFIGURATION_TOOL("Configuration tool"),
|
||||
WARNING_DEVICE("Warning device"),
|
||||
DOORLOCK("Door Lock"),
|
||||
UNKNOWN("");
|
||||
|
||||
private static final Map<String, LightType> MAPPING = Arrays.stream(LightType.values())
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<channels>
|
||||
<channel id="alert" typeId="alert"></channel>
|
||||
</channels>
|
||||
|
||||
<representation-property>uid</representation-property>
|
||||
|
||||
<config-description-ref uri="thing-type:deconz:sensor"/>
|
||||
</thing-type>
|
||||
|
||||
<thing-type id="windowcovering">
|
||||
@@ -107,6 +111,21 @@
|
||||
<config-description-ref uri="thing-type:deconz:light"/>
|
||||
</thing-type>
|
||||
|
||||
<thing-type id="doorlock">
|
||||
<supported-bridge-type-refs>
|
||||
<bridge-type-ref id="deconz"/>
|
||||
</supported-bridge-type-refs>
|
||||
<label>Doorlock</label>
|
||||
<description>A doorlock that can be locked (ON) or unlocked (OFF).</description>
|
||||
<channels>
|
||||
<channel typeId="lock" id="switch"/>
|
||||
</channels>
|
||||
|
||||
<representation-property>uid</representation-property>
|
||||
|
||||
<config-description-ref uri="thing-type:deconz:sensor"/>
|
||||
</thing-type>
|
||||
|
||||
<channel-type id="position">
|
||||
<item-type>Rollershutter</item-type>
|
||||
<label>Position</label>
|
||||
@@ -140,4 +159,8 @@
|
||||
<label>Alert</label>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="lock">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Lock</label>
|
||||
</channel-type>
|
||||
</thing:thing-descriptions>
|
||||
|
||||
Reference in New Issue
Block a user