Просмотр исходного кода

Add support for 1/2/3/4 gang Somgom wall switches.

- 1/2 gang added as specific devices, as they contain backlight control, timers and initial state configuration.
- 3/4 gang added as generic devices, as they simply contain the switches with no other features, and are likely to match other similar devices (even as partial matches if the other devices have more features).

Issue #253
Jason Rumney 3 лет назад
Родитель
Сommit
c5d4aaeb62

+ 1 - 1
ACKNOWLEDGEMENTS.md

@@ -28,7 +28,7 @@ Further device support has been made with the assistance of users.  Please consi
  - [b3nnyk22](https://github.com/b3nnyk22) for assistance in supporting Kogan Dehumidifiers.
  - [b3nnyk22](https://github.com/b3nnyk22) for assistance in supporting Kogan Dehumidifiers.
  - [rodrigoGA](https://github.com/rodrigoGA) for assistance in supporting Greenwind dehumidifiers.
  - [rodrigoGA](https://github.com/rodrigoGA) for assistance in supporting Greenwind dehumidifiers.
  - [jorgenDK](https://github.com/jorgenDK) for assistance in supporting TroniTechnik Air Conditioner, and thanks for the coffee!
  - [jorgenDK](https://github.com/jorgenDK) for assistance in supporting TroniTechnik Air Conditioner, and thanks for the coffee!
- - [Fannangir](https://github.com/Fannangir) for assistance in supporting Tadiran Wind Air Conditioner and Zemismart curtain rail.
+ - [Fannangir](https://github.com/Fannangir) for assistance in supporting Tadiran Wind Air Conditioner, Zemismart curtain rail and Somgam 1, 2, 3 and 4 gang switches.
  - [marrold](https://github.com/marrold) for contributing support for ElectriQ CD20PRO dehumidifiers.
  - [marrold](https://github.com/marrold) for contributing support for ElectriQ CD20PRO dehumidifiers.
  - [Uaeguy](https://github.com/Uaeguy) for assistance in supporting Beca BHP-6000, Saswell T29UTK and Owon PCT513 thermostats, and thanks for the coffee!
  - [Uaeguy](https://github.com/Uaeguy) for assistance in supporting Beca BHP-6000, Saswell T29UTK and Owon PCT513 thermostats, and thanks for the coffee!
  - [Johnnybyzhang](https://github.com/Johnnybyzhang) for assistance in supporting Lexy F501 fans.
  - [Johnnybyzhang](https://github.com/Johnnybyzhang) for assistance in supporting Lexy F501 fans.

+ 5 - 1
DEVICES.md

@@ -135,7 +135,7 @@
 
 
 - Parkside PLGS 2012 A1 smart charger for powertools
 - Parkside PLGS 2012 A1 smart charger for powertools
 
 
-### SmartPlugs/Wall sockets
+### SmartPlugs/Wall sockets/Wall switches
 
 
 - Generic smartplug with energy monitoring (older models)
 - Generic smartplug with energy monitoring (older models)
   _confirmed as working with Kogan and Blitzwolf single smartplugs_
   _confirmed as working with Kogan and Blitzwolf single smartplugs_
@@ -157,10 +157,14 @@ Other brands may work with the above configurations
 - Logicom Strippy 4 way power strip with USB
 - Logicom Strippy 4 way power strip with USB
 - 4 way power monitoring strip
 - 4 way power monitoring strip
 - Arlec PB88UHA 4 way powerstrip with child lock
 - Arlec PB88UHA 4 way powerstrip with child lock
+- Somgam single wall switch
+- Somgam double wall switch
 
 
 - Simple switch - a switch only, can be a fallback for many other unsupported devices, to allow just power to be switched on/off.
 - Simple switch - a switch only, can be a fallback for many other unsupported devices, to allow just power to be switched on/off.
 - Simple switch with timer - a single switch and timer, will probably work for a lot of smart switches that are not covered by the more advanced configs above.
 - Simple switch with timer - a single switch and timer, will probably work for a lot of smart switches that are not covered by the more advanced configs above.
 - Simple switch with timer v2 - the above with timer moved from dp 11 to 9, confirmed with a Nexxt 220V smart switch. 
 - Simple switch with timer v2 - the above with timer moved from dp 11 to 9, confirmed with a Nexxt 220V smart switch. 
+- Simple triple switch - three switches in a single device, tested with Somgam 3 gang wall switches.
+- Simple quad switch - four switches in a single device, tested with Somgam 4 gang wall switches.
 
 
 ### Lights
 ### Lights
 
 

+ 28 - 0
custom_components/tuya_local/devices/simple_quad_switch.yaml

@@ -0,0 +1,28 @@
+name: Simple switch
+primary_entity:
+  entity: switch
+  name: Switch 1
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+secondary_entities:
+  - entity: switch
+    name: Switch 2
+    dps:
+      - id: 2
+        name: switch
+        type: boolean
+  - entity: switch
+    name: Switch 3
+    dps:
+      - id: 3
+        name: switch
+        type: boolean
+  - entity: switch
+    name: Switch 4
+    dps:
+      - id: 4
+        name: switch
+        type: boolean
+        

+ 21 - 0
custom_components/tuya_local/devices/simple_triple_switch.yaml

@@ -0,0 +1,21 @@
+name: Somgoms double switch
+primary_entity:
+  entity: switch
+  name: Switch 1
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+secondary_entities:
+  - entity: switch
+    name: Switch 2
+    dps:
+      - id: 2
+        name: switch
+        type: boolean
+  - entity: switch
+    name: Switch 3
+    dps:
+      - id: 3
+        name: switch
+        type: boolean

+ 65 - 0
custom_components/tuya_local/devices/somgom_double_switch.yaml

@@ -0,0 +1,65 @@
+name: Somgoms double switch
+primary_entity:
+  entity: switch
+  name: Switch 1
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+secondary_entities:
+  - entity: switch
+    name: Switch 2
+    dps:
+      - id: 2
+        name: switch
+        type: boolean
+  - entity: number
+    name: Timer 1
+    icon: "mdi:timer"
+    category: config
+    dps:
+      - id: 7
+        name: value
+        type: integer
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+        unit: min
+  - entity: number
+    name: Timer 2
+    icon: "mdi:timer"
+    category: config
+    dps:
+      - id: 8
+        name: value
+        type: integer
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+        unit: min
+  - entity: select
+    name: Power on state
+    icon: "mdi:toggle-switch"
+    category: config
+    dps:
+      - id: 14
+        name: option
+        type: string
+        mapping:
+          - dps_val: power_on
+            value: "On"
+          - dps_val: power_off
+            value: "Off"
+          - dps_val: last
+            value: Last State
+  - entity: light
+    name: Backlight
+    category: config
+    dps:
+      - id: 16
+        name: switch
+        type: boolean

+ 44 - 0
custom_components/tuya_local/devices/somgom_single_switch.yaml

@@ -0,0 +1,44 @@
+name: Somgoms switch
+primary_entity:
+  entity: switch
+  dps:
+    - id: 1
+      name: switch
+      type: boolean
+secondary_entities:
+  - entity: number
+    name: Timer
+    icon: "mdi:timer"
+    category: config
+    dps:
+      - id: 7
+        name: value
+        type: integer
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+        unit: min
+  - entity: select
+    name: Power on state
+    icon: "mdi:toggle-switch"
+    category: config
+    dps:
+      - id: 14
+        name: option
+        type: string
+        mapping:
+          - dps_val: power_on
+            value: "On"
+          - dps_val: power_off
+            value: "Off"
+          - dps_val: last
+            value: Last State
+  - entity: light
+    name: Backlight
+    category: config
+    dps:
+      - id: 16
+        name: switch
+        type: boolean