Skip to content

Commit 529d543

Browse files
committed
#449 TuYa TS0015 support
1 parent f72993d commit 529d543

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ New devices:
9595
- TuYa Curtain motor
9696
- Moes ZigBee3.0 dual USB wireless socket plug
9797
- TuYa Smart light switch - 3 gang without neutral wire
98+
- TuYa Multiprise with 4 AC outlets and 2 USB super charging ports (10A or 16A)
9899

99100
## 0.2.0
100101
- Support for "stop" command for blinds adapter

SUPPORTED_DEVICES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ If your device is not listed in the list below but [zigbee2mqtt supports](https:
462462
- TuYa Temperature & humidity sensor with display
463463
- TuYa 2 gang switch
464464
- TuYa 10A UK or 16A EU smart plug
465+
- TuYa Multiprise with 4 AC outlets and 2 USB super charging ports (10A or 16A)
465466
- TuYa Wireless switch with 1 button
466467
- TuYa Radiator valve with thermostat
467468
- TuYa Curtain motor

adapters/tuya/TS0015.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Domoticz
2+
import json
3+
from adapters.base_adapter import Adapter
4+
from devices.switch.on_off_switch import OnOffSwitch
5+
6+
7+
class TS0015(Adapter):
8+
def __init__(self, devices):
9+
super().__init__(devices)
10+
11+
self.devices.append(OnOffSwitch(devices, 'l1', 'state_l1'))
12+
self.devices.append(OnOffSwitch(devices, 'l2', 'state_l2'))
13+
self.devices.append(OnOffSwitch(devices, 'l3', 'state_l3'))
14+
self.devices.append(OnOffSwitch(devices, 'l4', 'state_l4'))
15+
self.devices.append(OnOffSwitch(devices, 'l5', 'state_l5'))
16+
17+
def handleCommand(self, alias, device, device_data, command, level, color):
18+
return {
19+
'topic': '/'.join([device_data['friendly_name'], alias, 'set']),
20+
'payload': json.dumps({
21+
"state": command.upper()
22+
})
23+
}

adapters/tuya/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from adapters.tuya.TS0002 import TS0002
66
from adapters.tuya.TS0012 import TS0012
77
from adapters.tuya.TS0013 import TS0013
8+
from adapters.tuya.TS0015 import TS0015
89
from adapters.tuya.TS0041 import TS0041
910
from adapters.tuya.TS0601 import TS0601
1011

@@ -18,6 +19,7 @@
1819
'TS0011': OnOffSwitchAdapter, # TuYa Smart light switch - 1 gang without neutral wire
1920
'TS0012': TS0012, # TuYa Smart light switch - 2 gang without neutral wire
2021
'TS0013': TS0013, # TuYa Smart light switch - 3 gang without neutral wire
22+
'TS0015': TS0015, # TuYa Multiprise with 4 AC outlets and 2 USB super charging ports (10A or 16A)
2123
'TS0041': TS0041, # TuYa Wireless switch with 1 button
2224
'TS0601_curtain': BlindAdapter, # TuYa Curtain motor
2325
'TS0601_thermostat': TS0601, # TuYa Radiator valve with thermostat

0 commit comments

Comments
 (0)