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

Add support for Steigen Solar Pro drying rack

- cover: fall through to using position if action does not give a result

Issue #2855
Jason Rumney 11 месяцев назад
Родитель
Сommit
084181d30d

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -855,3 +855,4 @@ Further device support has been made with the assistance of users. Please consid
 - [diviera](https://github.com/diviera) for contributing support for Moes WS-USR-2C double curtain switch
 - [Enrica-r](https://github.com/Enrica-r) for assisting with support for Haozee water valve.
 - [istenik](https://github.com/istenik) for assisting with support for Klarstein Bornholm Smart 1500 convection heater.
+- [madrani79](https://github.com/madrani79) for assisting with support for Steigen Solar Pro drying rack.

+ 1 - 0
DEVICES.md

@@ -968,6 +968,7 @@ port and password.
 - SNT957W-TDE temperature sensor
 - SNT957W-DE CBU temperature and humidity sensor
 - Speaka SP-TVCM-510 TV mount
+- Steigen Solar Pro clothes drying rack
 - Sunbeam dual heated mattress pad
 - Sunbeam single heated mattress pad
 - SWS-001 smart weather station

+ 2 - 1
custom_components/tuya_local/cover.py

@@ -112,7 +112,8 @@ class TuyaLocalCover(TuyaLocalEntity, CoverEntity):
 
         if self._action_dp:
             state = self._action_dp.get_value(self._device)
-            return self._state_to_percent(state)
+            if state is not None:
+                return self._state_to_percent(state)
 
         if self._position_dp:
             pos = self._position_dp.get_value(self._device)

+ 145 - 0
custom_components/tuya_local/devices/steigen_solarpro_dryer.yaml

@@ -0,0 +1,145 @@
+name: Drying rack
+products:
+  - id: 5gtjlyeeljy7ufe4
+    manufacturer: Steigen
+    model: Solar Pro
+entities:
+  - entity: cover
+    icon: "mdi:hanger"
+    dps:
+      - id: 2
+        type: string
+        name: control
+        mapping:
+          - dps_val: up
+            value: close
+          - dps_val: down
+            value: open
+          - dps_val: stop
+            value: stop
+      - id: 3
+        type: integer
+        optional: true
+        name: position
+        range:
+          min: 0
+          max: 100
+      - id: 9
+        type: string
+        name: action
+        mapping:
+          - dps_val: up
+            value: closing
+          - dps_val: down
+            value: opening
+          - value: null
+  - entity: light
+    dps:
+      - id: 4
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Fan
+    icon: "mdi:weather-windy"
+    dps:
+      - id: 6
+        type: boolean
+        name: switch
+  - entity: switch
+    name: Heat
+    icon: "mdi:heat-wave"
+    dps:
+      - id: 7
+        type: boolean
+        name: switch
+  - entity: select
+    name: Heat timer
+    translation_key: timer
+    category: config
+    dps:
+      - id: 11
+        type: string
+        optional: true
+        name: option
+        mapping:
+          - dps_val: cancel
+            value: cancel
+          - dps_val: "1h"
+            value: "1h"
+          - dps_val: "2h"
+            value: "2h"
+          - dps_val: "3h"
+            value: "3h"
+          - dps_val: "4h"
+            value: "4h"
+          - dps_val: "5h"
+            value: "5h"
+          - dps_val: "6h"
+            value: "6h"
+  - entity: select
+    name: Wind timer
+    translation_key: timer
+    category: config
+    dps:
+      - id: 13
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: cancel
+            value: cancel
+          - dps_val: "1h"
+            value: "1h"
+          - dps_val: "2h"
+            value: "2h"
+          - dps_val: "3h"
+            value: "3h"
+  - entity: sensor
+    name: Heat remaining
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 15
+        type: integer
+        optional: true
+        name: sensor
+        unit: min
+  - entity: sensor
+    name: Wind remaining
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 16
+        type: integer
+        optional: true
+        name: sensor
+        unit: min
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 18
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 18
+        type: bitfield
+        name: fault_code
+  - entity: select
+    name: Clothes position
+    icon: "mdi:tshirt-crew"
+    category: config
+    dps:
+      - id: 103
+        type: string
+        name: option
+        mapping:
+          - dps_val: center
+            value: Center
+          - dps_val: top
+            value: Top
+          - dps_val: bottom
+            value: Bottom