[tapocontrol] fix "device not found" with L510/L530 hw rev2 / add L920 and P110 things (#11967)

* [tapocontrol] P110 and L920 Things added
* [tapocontrol] Fixed L510/L530 Series Bug with HW-Rev2.0

Signed-off-by: Christian Wild <christian@wild-bw.de>
This commit is contained in:
Christian Wild
2022-01-06 12:29:44 +01:00
committed by GitHub
parent 5dc26419d1
commit 6b6372e95c
11 changed files with 91 additions and 35 deletions

View File

@@ -193,6 +193,7 @@ public class TapoDiscoveryService extends AbstractDiscoveryService implements Th
String deviceModel = device.get(CLOUD_PROPERTY_MODEL).getAsString();
deviceModel = deviceModel.replaceAll("\\(.*\\)", ""); // replace (DE)
deviceModel = deviceModel.replace("Tapo", "");
deviceModel = deviceModel.replace("Series", "");
deviceModel = deviceModel.trim();
deviceModel = deviceModel.replace(" ", "_");
return deviceModel;

View File

@@ -36,9 +36,11 @@ public class TapoThingConstants {
public static final String DEVICE_BRIDGE = "bridge";
public static final String DEVICE_P100 = "P100";
public static final String DEVICE_P105 = "P105";
public static final String DEVICE_L510E = "L510_Series";
public static final String DEVICE_L530E = "L530_Series";
public static final String DEVICE_P110 = "P110";
public static final String DEVICE_L510 = "L510";
public static final String DEVICE_L530 = "L530";
public static final String DEVICE_L900 = "L900";
public static final String DEVICE_L920 = "L920";
public static final String DEVICE_UNIVERSAL = "Test_Device";
/*** LIST OF SUPPORTED DEVICE DESCRIPTIONS ***/
@@ -52,17 +54,20 @@ public class TapoThingConstants {
public static final ThingTypeUID BRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_BRIDGE);
public static final ThingTypeUID P100_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_P100);
public static final ThingTypeUID P105_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_P105);
public static final ThingTypeUID L510E_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L510E);
public static final ThingTypeUID L530E_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L530E);
public static final ThingTypeUID P110_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_P110);
public static final ThingTypeUID L510_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L510);
public static final ThingTypeUID L530_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L530);
public static final ThingTypeUID L900_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L900);
public static final ThingTypeUID L920_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_L920);
public static final ThingTypeUID UNIVERSAL_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_UNIVERSAL);
/*** SET OF SUPPORTED UIDS ***/
public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_UIDS = Set.of(BRIDGE_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_SMART_PLUG_UIDS = Set.of(P100_THING_TYPE, P105_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_WHITE_BULB_UIDS = Set.of(L510E_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_COLOR_BULB_UIDS = Set.of(L530E_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_LIGHT_STRIP_UIDS = Set.of(L900_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_SMART_PLUG_UIDS = Set.of(P100_THING_TYPE, P105_THING_TYPE,
P110_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_WHITE_BULB_UIDS = Set.of(L510_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_COLOR_BULB_UIDS = Set.of(L530_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_LIGHT_STRIP_UIDS = Set.of(L900_THING_TYPE, L920_THING_TYPE);
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
.unmodifiableSet(Stream
.of(SUPPORTED_BRIDGE_UIDS, SUPPORTED_SMART_PLUG_UIDS, SUPPORTED_WHITE_BULB_UIDS,

View File

@@ -166,7 +166,7 @@ public class TapoDeviceInfo {
}
public String getModel() {
return model.replace(" ", "_");
return model.replace(" Series", "");
}
public String getNickname() {

View File

@@ -5,16 +5,20 @@ binding.tapocontrol.description = Control your TAPO-SmartHome Devices
# thing types
thing-type.tapocontrol.L510_Series.label = L510 Series White-Bulb
thing-type.tapocontrol.L510_Series.description = Tapo Smart dimmable White-Light-Bulb
thing-type.tapocontrol.L530_Series.label = L530 Series Color-Bulb
thing-type.tapocontrol.L530_Series.description = Tapo Smart Multicolor Light-Bulb
thing-type.tapocontrol.L510.label = L510 Series White-Bulb
thing-type.tapocontrol.L510.description = Tapo Smart dimmable White-Light-Bulb
thing-type.tapocontrol.L530.label = L530 Series Color-Bulb
thing-type.tapocontrol.L530.description = Tapo Smart Multicolor Light-Bulb
thing-type.tapocontrol.L900.label = L900 LightStrip
thing-type.tapocontrol.L900.description = Tapo Smart Multicolor Light-Lightstrip
thing-type.tapocontrol.L900.description = Tapo Smart LED-Lightstrip
thing-type.tapocontrol.L920.label = L920 LightStrip
thing-type.tapocontrol.L920.description = Tapo Smart Multicolor LED-Lightstrip
thing-type.tapocontrol.P100.label = P100 SmartPlug
thing-type.tapocontrol.P100.description = Tapo Smart Wifi Plug
thing-type.tapocontrol.P105.label = P105 SmartPlug
thing-type.tapocontrol.P105.description = Tapo Mini Smart Wifi Plug
thing-type.tapocontrol.P110.label = P110 SmartPlug
thing-type.tapocontrol.P110.description = Tapo Smart Monitoring Wifi Plug
thing-type.tapocontrol.bridge.label = Cloud-Login
thing-type.tapocontrol.bridge.description = Cloud Connector. Acts as device-bridge

View File

@@ -4,8 +4,8 @@
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- L510E THING-TYPE (WHITE-LIGHT-BULB) -->
<thing-type id="L510_Series">
<!-- L510 THING-TYPE (WHITE-LIGHT-BULB) -->
<thing-type id="L510">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge"/>
</supported-bridge-type-refs>

View File

@@ -4,8 +4,8 @@
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- L530 Series THING-TYPE (COLOR-LIGHT-BULB) -->
<thing-type id="L530_Series">
<!-- L530 THING-TYPE (COLOR-LIGHT-BULB) -->
<thing-type id="L530">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge"/>
</supported-bridge-type-refs>

View File

@@ -4,14 +4,14 @@
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- L530 Series THING-TYPE (COLOR-LIGHT-BULB) -->
<!-- L900 Series THING-TYPE (COLOR-LED-Lightstrip) -->
<thing-type id="L900">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge"/>
</supported-bridge-type-refs>
<label>L900 LightStrip</label>
<description>Tapo Smart Multicolor Light-Lightstrip</description>
<description>Tapo Smart LED-Lightstrip</description>
<channel-groups>
<channel-group id="actuator" typeId="lightStrip"/>
<channel-group id="device" typeId="deviceState"/>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="tapocontrol"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- L920 THING-TYPE (Multicolor LED-Lightstrip) -->
<thing-type id="L920">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge"/>
</supported-bridge-type-refs>
<label>L920 LightStrip</label>
<description>Tapo Smart Multicolor LED-Lightstrip</description>
<channel-groups>
<channel-group id="actuator" typeId="lightStrip"/>
<channel-group id="device" typeId="deviceState"/>
</channel-groups>
<representation-property>macAddress</representation-property>
<config-description-ref uri="thing-type:tapo:device"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -4,7 +4,7 @@
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- P100 THING-TYPE (SOCKET) -->
<!-- P105 THING-TYPE (SOCKET) -->
<thing-type id="P105">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge"/>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="tapocontrol"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- P110 THING-TYPE (SOCKET) -->
<thing-type id="P110">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge"/>
</supported-bridge-type-refs>
<label>P110 SmartPlug</label>
<description>Tapo Smart Monitoring Wifi Plug</description>
<channel-groups>
<channel-group id="actuator" typeId="smartPlug"/>
<channel-group id="device" typeId="deviceState"/>
</channel-groups>
<representation-property>macAddress</representation-property>
<config-description-ref uri="thing-type:tapo:device"/>
</thing-type>
</thing:thing-descriptions>