[tplinksmarthome] Add support for KP115 plug (#9800)
The KP115 plug is a WiFi smart plug with energy monitoring support. It uses the same API as existing TP-Link smart home devices. This change adds support in the binding for the KP115. Signed-off-by: Evan Anderson <evan@eaanderson.com>
This commit is contained in:
@@ -75,7 +75,7 @@ public class TPLinkSmartHomeHandlerFactory extends BaseThingHandlerFactory {
|
||||
device = new DimmerDevice();
|
||||
break;
|
||||
case PLUG:
|
||||
if (HS110.is(thingTypeUID)) {
|
||||
if (HS110.is(thingTypeUID) || KP115.is(thingTypeUID)) {
|
||||
device = new EnergySwitchDevice();
|
||||
} else {
|
||||
device = new SwitchDevice();
|
||||
|
||||
@@ -54,6 +54,7 @@ public enum TPLinkSmartHomeThingType {
|
||||
HS110("hs110", DeviceType.PLUG),
|
||||
KP100("kp100", DeviceType.PLUG),
|
||||
KP105("kp105", DeviceType.PLUG),
|
||||
KP115("kp115", DeviceType.PLUG),
|
||||
|
||||
// Switch Thing Type UIDs
|
||||
HS200("hs200", DeviceType.SWITCH),
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<thing:thing-descriptions bindingId="tplinksmarthome"
|
||||
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">
|
||||
|
||||
<thing-type id="kp115">
|
||||
<label>KP115</label>
|
||||
<description>TP-Link KP115 Kasa Wi-Fi Smart Plug with Energy Monitoring - Slim Edition</description>
|
||||
<category>PowerOutlet</category>
|
||||
|
||||
<channels>
|
||||
<channel id="switch" typeId="system.power"/>
|
||||
<channel id="led" typeId="led"/>
|
||||
<channel id="rssi" typeId="rssi"/>
|
||||
<channel id="power" typeId="power"/>
|
||||
<channel id="energyUsage" typeId="energy-usage"/>
|
||||
<channel id="current" typeId="current"/>
|
||||
<channel id="voltage" typeId="voltage"/>
|
||||
</channels>
|
||||
|
||||
<representation-property>deviceId</representation-property>
|
||||
|
||||
<config-description-ref uri="thing-type:device:plug"/>
|
||||
</thing-type>
|
||||
</thing:thing-descriptions>
|
||||
Reference in New Issue
Block a user