Przeglądaj źródła

Saswell C16: update tests, remove obsolete attributes.

- Remove the extra attributes that are now covered by separate entities.
- update tests
- change type of enum dp to string (original report did not incluce
  quotes around strings so it was ambiguous when originally reported.
Jason Rumney 3 lat temu
rodzic
commit
6522bd61d1

+ 3 - 2
ACKNOWLEDGEMENTS.md

@@ -30,7 +30,7 @@ Further device support has been made with the assistance of users.  Please consi
  - [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.
  - [marrold](https://github.com/marrold) for contributing support for ElectriQ CD20PRO dehumidifiers.
- - [Uaeguy](https://github.com/Uaeguy) for assistance in supporting Beca BHP-6000, Siswell 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.
  - [domgrimm](https://github.com/domgrimm) for assistance in supporting newer models of Kogan heater.
  - [EKCJ](https://github.com/EKCJ) for contributing support for ElectriQ DESD9LW dehumidifiers.
@@ -40,7 +40,7 @@ Further device support has been made with the assistance of users.  Please consi
  - [xbmcnut](https://github.com/xbmcnut) for assistance in supporting Kogan Smart Kettles and the new type of Kogan heater.
  - [ThomasADavis](https://github.com/ThomasADavis) for contributing support for Renpho RP-AP001S air purifiers.
  - [darek-margas](https://github.com/darek-margas) for contributing support for Arlec fans, Carson portable air conditioners, Grid Connect double outlets with and without USB and power monitoring, Mirabella Genio smartplugs.
- - [SamJongenelen](https://github.com/SamJongenelen) for assistance in supporting Siswell C16 Thermostats
+ - [SamJongenelen](https://github.com/SamJongenelen) for assistance in supporting Saswell C16 Thermostats
  - [antoweb](https://github.com/antoweb) for assistance in supporting Beca BHT-6000 thermostats.
  - [klausahrenberg](https://github.com/klausahrenberg) for figuring out the BHT-6000 and other thermostats' internal MCU protocol for his alternate MQQT firmware, which helped with finding some of the details.
  - [Swiftnesses](https://github.com/Swiftnesses) for contributing support for Electriq CD12PW dehumidifiers
@@ -121,3 +121,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [Aptul9](https://github.com/Aptul9) for assisting with support for Sendo air conditioners.
 - [dilorenzo1987](https://github.com/dilorenzo1987) for contributing support for Stadler Form Roger purifiers.
 - [fsevilla3](https://github.com/fsevilla3) for contributing support for water_heater entities and Hydrotherm Dynamix/X8 water heaters.
+- [allistermaguire](https://github.com/allistermaguire) for contributing improvements to Saswell C16 thermostats.

+ 2 - 2
DEVICES.md

@@ -65,8 +65,8 @@
 - Moes BHT-002 thermostat (without external temp sensor)
 - Beca BAC-002 thermostat
 - Awow/Mi-heat TH213 thermostat (two variants)
-- Siswell T29UTW thermostat
-- Siswell C16 thermostat _(rebadged as Warmme, Klima and others)_
+- Saswell T29UTW thermostat
+- Saswell C16 thermostat _(rebadged as Warmme, Klima and others)_
 - Minco MH-1823D thermostat
 - Owon PCT513 thermostat
 - Beok TR9B thermostat _(rebadged as Vancoo and perhaps others)_

+ 1 - 1
README.md

@@ -256,7 +256,7 @@ the appropriate one for the temperature units you use.  If you change the
 units on the device control panel, you will need to delete the device from
 Home Assistant and set it up again.
 
-## Siswell C16 thermostat gotchas
+## Saswell C16 thermostat gotchas
 
 These support configuration as either heating or cooling controllers, but
 only have one output.  The HVAC mode is provided as an indicator of which

+ 6 - 30
custom_components/tuya_local/devices/saswell_c16_thermostat.yaml

@@ -67,30 +67,6 @@ primary_entity:
     - id: 12
       name: schedule
       type: string
-    - id: 14
-      name: sensor_selection
-      type: integer
-      mapping:
-        - dps_val: 0
-          value: "Floor sensor"
-        - dps_val: 1
-          value: "Room sensor"
-        - dps_val: 2
-          value: "Room sensor with floor sensor limit"
-        - dps_val: 3
-          value: "External room sensor"
-        - dps_val: 4
-          value: "External room sensor with floor sensor limit"
-    - id: 15
-      name: room_temp_calibration
-      type: integer
-      mapping:
-        - scale: 10
-    - id: 17
-      name: floor_temp_calibration
-      type: integer
-      mapping:
-        - scale: 10
     - id: 21
       name: unknown_21
       type: boolean
@@ -196,17 +172,17 @@ secondary_entities:
     dps:
       - id: 14
         name: option
-        type: integer
+        type: string
         mapping:
-          - dps_val: 0
+          - dps_val: "0"
             value: "Floor sensor"
-          - dps_val: 1
+          - dps_val: "1"
             value: "Room sensor"
-          - dps_val: 2
+          - dps_val: "2"
             value: "Room sensor with floor sensor limit"
-          - dps_val: 3
+          - dps_val: "3"
             value: "External room sensor"
-          - dps_val: 4
+          - dps_val: "4"
             value: "External room sensor with floor sensor limit"
   - entity: number
     name: Room temperature calibration

+ 1 - 1
tests/const.py

@@ -609,7 +609,7 @@ SASWELL_C16_THERMOSTAT_PAYLOAD = {
     "10": True,
     "11": False,
     "12": "7",
-    "14": 0,
+    "14": "0",
     "15": 0,
     "17": 0,
     "21": False,

+ 35 - 9
tests/devices/test_saswell_c16_thermostat.py

@@ -29,9 +29,9 @@ HVACMODE_DPS = "9"
 ADAPTIVE_DPS = "10"
 LOCK_DPS = "11"
 SCHED_DPS = "12"
-UNKNOWN14_DPS = "14"
-UNKNOWN15_DPS = "15"
-UNKNOWN17_DPS = "17"
+SENSOR_DPS = "14"
+ROOMCALIB_DPS = "15"
+FLOORCALIB_DPS = "17"
 UNKNOWN21_DPS = "21"
 POWERRATING_DPS = "22"
 UNKNOWN23_DPS = "23"
@@ -90,6 +90,24 @@ class TestSaswellC16Thermostat(
                     "max": 3500,
                     "unit": POWER_WATT,
                 },
+                {
+                    "name": "number_room_temperature_calibration",
+                    "dps": ROOMCALIB_DPS,
+                    "min": -5.0,
+                    "max": 5.0,
+                    "scale": 10,
+                    "step": 0.5,
+                    "unit": TEMP_CELSIUS,
+                },
+                {
+                    "name": "number_floor_temperature_calibration",
+                    "dps": FLOORCALIB_DPS,
+                    "min": -5.0,
+                    "max": 5.0,
+                    "scale": 10,
+                    "step": 0.5,
+                    "unit": TEMP_CELSIUS,
+                },
             ]
         )
         self.setUpMultiSelect(
@@ -110,6 +128,17 @@ class TestSaswellC16Thermostat(
                         "7": "Daily",
                     },
                 },
+                {
+                    "name": "select_sensor_select",
+                    "dps": SENSOR_DPS,
+                    "options": {
+                        "0": "Floor sensor",
+                        "1": "Room sensor",
+                        "2": "Room sensor with floor sensor limit",
+                        "3": "External room sensor",
+                        "4": "External room sensor with floor sensor limit",
+                    },
+                },
             ]
         )
         self.mark_secondary(
@@ -117,10 +146,13 @@ class TestSaswellC16Thermostat(
                 "lock_child_lock",
                 "sensor_floor_temperature",
                 "switch_adaptive",
+                "number_floor_temperature_calibration",
                 "number_floor_temperature_limit",
                 "number_power_rating",
+                "number_room_temperature_calibration",
                 "select_installation",
                 "select_schedule",
+                "select_sensor_select",
             ]
         )
 
@@ -228,9 +260,6 @@ class TestSaswellC16Thermostat(
         self.dps[FLOORTEMP_DPS] = 251
         self.dps[ADAPTIVE_DPS] = False
         self.dps[SCHED_DPS] = "5_1_1"
-        self.dps[UNKNOWN14_DPS] = 14
-        self.dps[UNKNOWN15_DPS] = 15
-        self.dps[UNKNOWN17_DPS] = 17
         self.dps[UNKNOWN21_DPS] = True
         self.dps[POWERRATING_DPS] = 2000
         self.dps[UNKNOWN23_DPS] = 23
@@ -245,9 +274,6 @@ class TestSaswellC16Thermostat(
                 "floor_temperature": 25.1,
                 "adaptive": False,
                 "schedule": "5_1_1",
-                "unknown_14": 14,
-                "unknown_15": 15,
-                "unknown_17": 17,
                 "unknown_21": True,
                 "power_rating": 2000,
                 "unknown_23": 23,