فهرست منبع

Implement unit tests for Fersk Vind 2.

+ Some tweaks to the config.
+ Some fixes for Siswell unit tests after last change.
+ update docs for Fersk support.
Jason Rumney 4 سال پیش
والد
کامیت
c9da65c99d

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -36,3 +36,4 @@ Further device support has been made with the assistance of users.  Please consi
  - [EKCJ](https://github.com/EKCJ) for contributing support for ElectriQ DESD9LW dehumidifiers.
  - [ed-holland](https://github.com/ed-holland) for contributing support for Awow TH213 thermostats
  - [Vikedlol](https://github.com/Vikedlol) for assistance in supporting Wetair WCH-750 heaters.
+ - [wwalczyszyn](https://github.com/wwalczyszyn) for contributing support for Fersk Vind 2 heatpumps.

+ 1 - 0
README.md

@@ -29,6 +29,7 @@ Note that devices sometimes get firmware upgrades, or incompatible versions are
 
 - ElectriQ 12WMINV
 - Tadiran Wind 65/3P
+- Fersk Vind 2
 
 ### Pool heaters / heatpumps
 

+ 17 - 8
custom_components/tuya_local/devices/fersk_vind_2_climate.yaml

@@ -14,9 +14,17 @@ primary_entity:
     - id: 2
       name: temperature
       type: integer
-      range:
-        min: 16
-        max: 32
+      mapping:
+        - constraint: temperature_unit
+          conditions:
+            - dps_val: "C"
+              range:
+                min: 16
+                max: 32
+            - dps_val: "F"
+              range:
+                min: 60
+                max: 90
     - id: 3
       name: current_temperature
       type: integer
@@ -30,7 +38,7 @@ primary_entity:
           constraint: power
           conditions:
             - dps_val: false
-              value: "off"
+              value_redirect: power
             - dps_val: true
               value: cool
         - dps_val: FAN
@@ -39,6 +47,7 @@ primary_entity:
           constraint: power
           conditions:
             - dps_val: false
+              value_redirect: power
               value: "off"
             - dps_val: true
               value: fan_only
@@ -48,7 +57,7 @@ primary_entity:
           constraint: power
           conditions:
             - dps_val: false
-              value: "off"
+              value_redirect: power
             - dps_val: true
               value: dry
         - dps_val: HEAT
@@ -57,7 +66,7 @@ primary_entity:
           constraint: power
           conditions:
             - dps_val: false
-              value: "off"
+              value_redirect: power
             - dps_val: true
               value: heat
     - id: 5
@@ -87,11 +96,11 @@ primary_entity:
       type: boolean
       mapping:
         - dps_val: true
-          value: "on"
+          value: "vertical"
         - dps_val: false
           value: "off"
     - id: 105
-      name: timer_time_left
+      name: countdown
       type: integer
     - id: 106
       name: unknown_106

+ 1 - 1
custom_components/tuya_local/manifest.json

@@ -2,7 +2,7 @@
     "domain": "tuya_local",
     "iot_class": "local_polling",
     "name": "Tuya Local",
-    "version": "0.11.0",
+    "version": "0.11.1",
     "documentation": "https://github.com/make-all/tuya-local",
     "issue_tracker": "https://github.com/make-all/tuya-local/issues",
     "dependencies": [],

+ 17 - 0
tests/const.py

@@ -377,3 +377,20 @@ SASWELL_T29UTK_THERMOSTAT_PAYLOAD = {
     "116": 75,
     "117": 81,
 }
+
+FERSK_VIND2_PAYLOAD = {
+    "1": True,
+    "2": 22,
+    "3": 23,
+    "4": "COOL",
+    "5": 1,
+    "19": "C",
+    "101": False,
+    "102": False,
+    "103": 0,
+    "104": False,
+    "105": 0,
+    "106": 0,
+    "109": False,
+    "110": 0,
+}

+ 4 - 4
tests/devices/test_saswell_t29utk_thermostat.py

@@ -58,7 +58,7 @@ class TestSaswellT29UTKThermostat(TuyaDeviceTestCase):
         self.dps[HVACACTION_DPS] = "cold"
         self.assertEqual(self.subject.icon, "mdi:thermometer-minus")
 
-        self.dps[HVACACTION_DPS] = "heat"
+        self.dps[HVACACTION_DPS] = "hot"
         self.assertEqual(self.subject.icon, "mdi:thermometer-plus")
 
         self.dps[HVACACTION_DPS] = "off"
@@ -125,7 +125,7 @@ class TestSaswellT29UTKThermostat(TuyaDeviceTestCase):
         self.dps[POWER_DPS] = True
         self.assertEqual(self.subject.hvac_mode, HVAC_MODE_COOL)
 
-        self.dps[HVACMODE_DPS] = "heat"
+        self.dps[HVACMODE_DPS] = "hot"
         self.assertEqual(self.subject.hvac_mode, HVAC_MODE_HEAT)
 
     def test_hvac_modes(self):
@@ -148,7 +148,7 @@ class TestSaswellT29UTKThermostat(TuyaDeviceTestCase):
 
     async def test_set_hvac_mode_heat(self):
         async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: True, HVACMODE_DPS: "heat"}
+            self.subject._device, {POWER_DPS: True, HVACMODE_DPS: "hot"}
         ):
             await self.subject.async_set_hvac_mode(HVAC_MODE_HEAT)
 
@@ -157,7 +157,7 @@ class TestSaswellT29UTKThermostat(TuyaDeviceTestCase):
         self.dps[HVACACTION_DPS] = "cold"
         self.assertEqual(self.subject.hvac_action, CURRENT_HVAC_COOL)
 
-        self.dps[HVACACTION_DPS] = "heat"
+        self.dps[HVACACTION_DPS] = "hot"
         self.assertEqual(self.subject.hvac_action, CURRENT_HVAC_HEAT)
         self.dps[HVACACTION_DPS] = "off"
         self.assertEqual(self.subject.hvac_action, CURRENT_HVAC_IDLE)