[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:
Evan Anderson
2021-01-13 04:56:09 -06:00
committed by GitHub
parent e9b1e35eb7
commit 2a00ac53f0
4 changed files with 41 additions and 7 deletions

View File

@@ -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();

View File

@@ -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),

View File

@@ -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>