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

Translations: remove failing device tests after string updates.

With generic device config tests now covering most common config
problems, individual device tests are no longer needed.

Any gaps this creates in coverage should be recovered with generic
tests.

Issue #682
Jason Rumney 2 лет назад
Родитель
Сommit
2c56c1a8cc
38 измененных файлов с 0 добавлено и 7844 удалено
  1. 0 240
      tests/devices/test_alecoair_d14_dehumidifier.py
  2. 0 132
      tests/devices/test_andersson_gsh_heater.py
  3. 0 248
      tests/devices/test_awow_th213_thermostat.py
  4. 0 243
      tests/devices/test_awow_th213v2_thermostat.py
  5. 0 186
      tests/devices/test_devola_patio_heater.py
  6. 0 213
      tests/devices/test_ecostrad_iqceramic_radiator.py
  7. 0 203
      tests/devices/test_eesee_adam_dehumidifier.py
  8. 0 274
      tests/devices/test_electriq_12wminv_heatpump.py
  9. 0 214
      tests/devices/test_electriq_airflex15w_heatpump.py
  10. 0 134
      tests/devices/test_electriq_cd12_dehumidifier.py
  11. 0 142
      tests/devices/test_electriq_cd12pwv2_dehumidifier.py
  12. 0 239
      tests/devices/test_electriq_cd20_dehumidifier.py
  13. 0 226
      tests/devices/test_electriq_cd25_dehumidifier.py
  14. 0 266
      tests/devices/test_electriq_desd9lw_dehumidifier.py
  15. 0 172
      tests/devices/test_eurom_saniwallheat2000_heater.py
  16. 0 172
      tests/devices/test_eurom_walldesignheat2000_heater.py
  17. 0 192
      tests/devices/test_fairland_iphcr15_heatpump.py
  18. 0 172
      tests/devices/test_gardenpac_heatpump.py
  19. 0 244
      tests/devices/test_goldair_dehumidifier.py
  20. 0 157
      tests/devices/test_goldair_gpcv_heater.py
  21. 0 60
      tests/devices/test_goldair_gpdh340_dehumidifier.py
  22. 0 338
      tests/devices/test_hysen_hy08we2_thermostat.py
  23. 0 180
      tests/devices/test_hyundai_sahara_dehumidifier.py
  24. 0 191
      tests/devices/test_ips_pro_heatpump.py
  25. 0 256
      tests/devices/test_jjpro_jpd01_dehumidifier.py
  26. 0 241
      tests/devices/test_kogan_dehumidifier.py
  27. 0 134
      tests/devices/test_kogan_kahtp_heater.py
  28. 0 197
      tests/devices/test_kogan_kashmfp20ba_heater.py
  29. 0 134
      tests/devices/test_kogan_kawfhtp_heater.py
  30. 0 258
      tests/devices/test_madimack_elitev3_heatpump.py
  31. 0 268
      tests/devices/test_madimack_heatpump.py
  32. 0 276
      tests/devices/test_owon_pct513_thermostat.py
  33. 0 171
      tests/devices/test_poolex_silverline_heatpump.py
  34. 0 160
      tests/devices/test_poolex_vertigo_heatpump.py
  35. 0 225
      tests/devices/test_purline_m100_heater.py
  36. 0 285
      tests/devices/test_saswell_c16_thermostat.py
  37. 0 268
      tests/devices/test_saswell_t29utk_thermostat.py
  38. 0 133
      tests/devices/test_weau_pool_heatpump.py

+ 0 - 240
tests/devices/test_alecoair_d14_dehumidifier.py

@@ -1,240 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import PERCENTAGE
-
-from ..const import ALECOAIR_D14_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.select import BasicSelectTests
-from ..mixins.sensor import BasicSensorTests
-from ..mixins.switch import BasicSwitchTests, SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-HUMIDITY_DPS = "2"
-MODE_DPS = "4"
-FAN_DPS = "5"
-IONIZER_DPS = "10"
-LOCK_DPS = "14"
-CURRENTHUMID_DPS = "16"
-TIMER_DPS = "17"
-ERROR_DPS = "19"
-
-
-class TestAlecoAirDehumidifier(
-    BasicBinarySensorTests,
-    BasicLockTests,
-    BasicSelectTests,
-    BasicSensorTests,
-    BasicSwitchTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("alecoair_d14_dehumidifier.yaml", ALECOAIR_D14_PAYLOAD)
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.fan = self.entities.get("fan")
-        self.setUpBasicLock(
-            LOCK_DPS,
-            self.entities.get("lock_child_lock"),
-        )
-        self.setUpBasicSelect(
-            TIMER_DPS,
-            self.entities.get("select_timer"),
-            {
-                "cancel": "Off",
-                "1h": "1 hour",
-                "2h": "2 hours",
-                "3h": "3 hours",
-                "4h": "4 hours",
-                "5h": "5 hours",
-                "6h": "6 hours",
-                "7h": "7 hours",
-                "8h": "8 hours",
-                "9h": "9 hours",
-                "10h": "10 hours",
-                "11h": "11 hours",
-                "12h": "12 hours",
-                "13h": "13 hours",
-                "14h": "14 hours",
-                "15h": "15 hours",
-                "16h": "16 hours",
-                "17h": "17 hours",
-                "18h": "18 hours",
-                "19h": "19 hours",
-                "20h": "20 hours",
-                "21h": "21 hours",
-                "22h": "22 hours",
-                "23h": "23 hours",
-                "24h": "24 hours",
-            },
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_tank"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(1, 0),
-        )
-        self.setUpBasicSensor(
-            CURRENTHUMID_DPS,
-            self.entities.get("sensor_current_humidity"),
-            device_class=SensorDeviceClass.HUMIDITY,
-            state_class="measurement",
-            unit=PERCENTAGE,
-        )
-        self.setUpBasicSwitch(
-            IONIZER_DPS,
-            self.entities.get("switch_ionizer"),
-        )
-        self.mark_secondary(["binary_sensor_tank", "lock_child_lock", "select_timer"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            HumidifierEntityFeature.MODES,
-        )
-        self.assertEqual(
-            self.fan.supported_features,
-            FanEntityFeature.SET_SPEED,
-        )
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "manual"
-        self.dps[ERROR_DPS] = 0
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "laundry"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:tshirt-crew-outline")
-
-        self.dps[MODE_DPS] = "sleep"
-        self.assertEqual(self.subject.icon, "mdi:power-sleep")
-
-        self.dps[MODE_DPS] = "purify"
-        self.assertEqual(self.subject.icon, "mdi:air-filter")
-
-        self.dps[ERROR_DPS] = 1
-        self.assertEqual(self.subject.icon, "mdi:cup-water")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 25)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_modes(self):
-        self.assertCountEqual(
-            self.subject.available_modes,
-            [
-                "Manual",
-                "Dry clothes",
-                "Purify",
-                "Sleep",
-            ],
-        )
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "manual"
-        self.assertEqual(self.subject.mode, "Manual")
-        self.dps[MODE_DPS] = "laundry"
-        self.assertEqual(self.subject.mode, "Dry clothes")
-        self.dps[MODE_DPS] = "purify"
-        self.assertEqual(self.subject.mode, "Purify")
-        self.dps[MODE_DPS] = "sleep"
-        self.assertEqual(self.subject.mode, "Sleep")
-
-    async def test_set_mode_to_manual(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "manual",
-            },
-        ):
-            await self.subject.async_set_mode("Manual")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_clothes(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "laundry",
-            },
-        ):
-            await self.subject.async_set_mode("Dry clothes")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_purify(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "purify",
-            },
-        ):
-            await self.subject.async_set_mode("Purify")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_sleep(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "sleep",
-            },
-        ):
-            await self.subject.async_set_mode("Sleep")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_speed_steps(self):
-        self.assertEqual(self.fan.speed_count, 2)
-
-    def test_fan_speed(self):
-        self.dps[FAN_DPS] = "low"
-        self.assertEqual(self.fan.percentage, 50)
-        self.dps[FAN_DPS] = "high"
-        self.assertEqual(self.fan.percentage, 100)
-
-    async def test_fan_set_speed_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "low",
-            },
-        ):
-            await self.fan.async_set_percentage(50)
-
-    async def test_fan_set_speed_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "high",
-            },
-        ):
-            await self.fan.async_set_percentage(100)

+ 0 - 132
tests/devices/test_andersson_gsh_heater.py

@@ -1,132 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import GSH_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-ERROR_DPS = "12"
-
-
-class TestAnderssonGSHHeater(TargetTemperatureTests, TuyaDeviceTestCase):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("andersson_gsh_heater.yaml", GSH_HEATER_PAYLOAD)
-        self.subject = self.entities["climate"]
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5,
-            max=35,
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "low"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Low")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "high"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="High")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "low"
-        self.assertEqual(self.subject.preset_mode, "Low")
-
-        self.dps[PRESET_DPS] = "high"
-        self.assertEqual(self.subject.preset_mode, "High")
-
-        self.dps[PRESET_DPS] = "af"
-        self.assertEqual(self.subject.preset_mode, "Anti-freeze")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Low", "High", "Anti-freeze"])
-
-    async def test_set_preset_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "low"},
-        ):
-            await self.subject.async_set_preset_mode("Low")
-
-    async def test_set_preset_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "high"},
-        ):
-            await self.subject.async_set_preset_mode("High")
-
-    async def test_set_preset_mode_to_af(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "af"},
-        ):
-            await self.subject.async_set_preset_mode("Anti-freeze")
-
-    def test_error_state(self):
-        # There are currently no known error states; update this as
-        # they are discovered
-        self.dps[ERROR_DPS] = "something"
-        self.assertEqual(self.subject.extra_state_attributes, {"error": "something"})
-        self.dps[ERROR_DPS] = "0"
-        self.assertEqual(self.subject.extra_state_attributes, {"error": "OK"})

+ 0 - 248
tests/devices/test_awow_th213_thermostat.py

@@ -1,248 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-
-from homeassistant.const import UnitOfTemperature
-
-from ..const import TH213_THERMOSTAT_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import MultiNumberTests
-from ..mixins.select import BasicSelectTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-LOCK_DPS = "6"
-ERROR_DPS = "12"
-EXTERNTEMP_DPS = "101"
-SENSOR_DPS = "102"
-CALIBRATE_DPS = "103"
-CALIBSWING_DPS = "104"
-HVACACTION_DPS = "105"
-UNKNOWN107_DPS = "107"
-UNKNOWN108_DPS = "108"
-UNKNOWN110_DPS = "110"
-
-
-class TestAwowTH213Thermostat(
-    BasicLockTests,
-    BasicSelectTests,
-    BasicSensorTests,
-    MultiNumberTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("awow_th213_thermostat.yaml", TH213_THERMOSTAT_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5,
-            max=30,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicSensor(
-            EXTERNTEMP_DPS,
-            self.entities.get("sensor_external_temperature"),
-            unit=UnitOfTemperature.CELSIUS,
-            device_class=SensorDeviceClass.TEMPERATURE,
-            state_class="measurement",
-        )
-        self.setUpBasicSelect(
-            SENSOR_DPS,
-            self.entities.get("select_temperature_sensor"),
-            {
-                0: "Internal",
-                1: "External",
-                2: "Both",
-            },
-        )
-        self.setUpMultiNumber(
-            [
-                {
-                    "name": "number_calibration_offset",
-                    "dps": CALIBRATE_DPS,
-                    "min": -9,
-                    "max": 9,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "number_calibration_swing",
-                    "dps": CALIBSWING_DPS,
-                    "min": 1,
-                    "max": 9,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "lock_child_lock",
-                "select_temperature_sensor",
-                "number_calibration_offset",
-                "number_calibration_swing",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACACTION_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:thermometer")
-
-        self.dps[HVACACTION_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:thermometer-off")
-
-        self.dps[LOCK_DPS] = True
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right-off")
-
-        self.dps[LOCK_DPS] = False
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(self.subject._device, {PRESET_DPS: 2}):
-            await self.subject.async_set_temperature(preset_mode="Away")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                TEMPERATURE_DPS: 25,
-                PRESET_DPS: 3,
-            },
-        ):
-            await self.subject.async_set_temperature(
-                temperature=25, preset_mode="Smart"
-            )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "1"
-        self.assertEqual(self.subject.preset_mode, "Home")
-
-        self.dps[PRESET_DPS] = "2"
-        self.assertEqual(self.subject.preset_mode, "Away")
-
-        self.dps[PRESET_DPS] = "3"
-        self.assertEqual(self.subject.preset_mode, "Smart")
-
-        self.dps[PRESET_DPS] = "4"
-        self.assertEqual(self.subject.preset_mode, "Sleep")
-
-        self.dps[PRESET_DPS] = None
-        self.assertEqual(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Home", "Away", "Smart", "Sleep"],
-        )
-
-    async def test_set_preset_mode_to_home(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 1},
-        ):
-            await self.subject.async_set_preset_mode("Home")
-
-    async def test_set_preset_mode_to_away(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 2},
-        ):
-            await self.subject.async_set_preset_mode("Away")
-
-    async def test_set_preset_mode_to_smart(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 3},
-        ):
-            await self.subject.async_set_preset_mode("Smart")
-
-    async def test_set_preset_mode_to_sleep(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 4},
-        ):
-            await self.subject.async_set_preset_mode("Sleep")
-
-    def test_hvac_action(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[HVACACTION_DPS] = True
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-
-        self.dps[HVACACTION_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 8
-        self.dps[EXTERNTEMP_DPS] = 27
-        self.dps[SENSOR_DPS] = 1
-        self.dps[CALIBRATE_DPS] = 2
-        self.dps[CALIBSWING_DPS] = 3
-        self.dps[UNKNOWN107_DPS] = True
-        self.dps[UNKNOWN108_DPS] = False
-        self.dps[UNKNOWN110_DPS] = 110
-
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "error": 8,
-                "external_temperature": 27,
-                "sensor": "External",
-                "temperature_calibration_offset": 2,
-                "temperature_calibration_swing": 3,
-                "unknown_107": True,
-                "unknown_108": False,
-                "unknown_110": 110,
-            },
-        )

+ 0 - 243
tests/devices/test_awow_th213v2_thermostat.py

@@ -1,243 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTemperature
-
-from ..const import TH213V2_THERMOSTAT_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import MultiNumberTests
-from ..mixins.select import BasicSelectTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-LOCK_DPS = "6"
-ERROR_DPS = "12"
-EXTERNTEMP_DPS = "101"
-SENSOR_DPS = "102"
-CALIBRATE_DPS = "103"
-CALIBSWING_DPS = "104"
-HVACACTION_DPS = "105"
-UNKNOWN116_DPS = "116"
-
-
-class TestAwowTH213v2Thermostat(
-    BasicBinarySensorTests,
-    BasicLockTests,
-    BasicSelectTests,
-    BasicSensorTests,
-    MultiNumberTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("awow_th213v2_thermostat.yaml", TH213V2_THERMOSTAT_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5,
-            max=30,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicSensor(
-            EXTERNTEMP_DPS,
-            self.entities.get("sensor_external_temperature"),
-            unit=UnitOfTemperature.CELSIUS,
-            device_class=SensorDeviceClass.TEMPERATURE,
-            state_class="measurement",
-        )
-        self.setUpBasicSelect(
-            SENSOR_DPS,
-            self.entities.get("select_temperature_sensor"),
-            {
-                0: "Internal",
-                1: "External",
-                2: "Both",
-            },
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_error"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(1, 0),
-        )
-        self.setUpMultiNumber(
-            [
-                {
-                    "name": "number_calibration_offset",
-                    "dps": CALIBRATE_DPS,
-                    "min": -9,
-                    "max": 9,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "number_calibration_swing",
-                    "dps": CALIBSWING_DPS,
-                    "min": 1,
-                    "max": 9,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "lock_child_lock",
-                "select_temperature_sensor",
-                "number_calibration_offset",
-                "number_calibration_swing",
-                "binary_sensor_error",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACACTION_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:thermometer")
-
-        self.dps[HVACACTION_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:thermometer-off")
-
-        self.dps[LOCK_DPS] = True
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right-off")
-
-        self.dps[LOCK_DPS] = False
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(self.subject._device, {PRESET_DPS: 2}):
-            await self.subject.async_set_temperature(preset_mode="Away")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                TEMPERATURE_DPS: 25,
-                PRESET_DPS: 3,
-            },
-        ):
-            await self.subject.async_set_temperature(
-                temperature=25, preset_mode="Smart"
-            )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "1"
-        self.assertEqual(self.subject.preset_mode, "Home")
-
-        self.dps[PRESET_DPS] = "2"
-        self.assertEqual(self.subject.preset_mode, "Away")
-
-        self.dps[PRESET_DPS] = "3"
-        self.assertEqual(self.subject.preset_mode, "Smart")
-
-        self.dps[PRESET_DPS] = "4"
-        self.assertEqual(self.subject.preset_mode, "Sleep")
-
-        self.dps[PRESET_DPS] = None
-        self.assertEqual(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Home", "Away", "Smart", "Sleep"],
-        )
-
-    async def test_set_preset_mode_to_home(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 1},
-        ):
-            await self.subject.async_set_preset_mode("Home")
-
-    async def test_set_preset_mode_to_away(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 2},
-        ):
-            await self.subject.async_set_preset_mode("Away")
-
-    async def test_set_preset_mode_to_smart(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 3},
-        ):
-            await self.subject.async_set_preset_mode("Smart")
-
-    async def test_set_preset_mode_to_sleep(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: 4},
-        ):
-            await self.subject.async_set_preset_mode("Sleep")
-
-    def test_hvac_action(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[HVACACTION_DPS] = True
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-
-        self.dps[HVACACTION_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 8
-        self.dps[UNKNOWN116_DPS] = "116"
-
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "error": 8,
-                "unknown_116": "116",
-            },
-        )

+ 0 - 186
tests/devices/test_devola_patio_heater.py

@@ -1,186 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTime,
-    UnitOfTemperature,
-)
-
-from ..const import DEVOLA_PATIO_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import BasicNumberTests
-from ..mixins.sensor import MultiSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-MODE_DPS = "4"
-POWERLEVEL_DPS = "5"
-PRESET_DPS = "6"
-LOCK_DPS = "7"
-TIMER_DPS = "12"
-HVACACTION_DPS = "14"
-UNIT_DPS = "19"
-TEMPF_DPS = "20"
-CURTEMPF_DPS = "21"
-
-
-class TestDevolaPatioHeater(
-    BasicLockTests,
-    BasicNumberTests,
-    MultiSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("devola_patio_heater.yaml", DEVOLA_PATIO_HEATER_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5,
-            max=45,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicNumber(
-            TIMER_DPS,
-            self.entities.get("number_timer"),
-            max=1440,
-            step=1.0,
-            unit=UnitOfTime.MINUTES,
-        )
-        self.setUpMultiSensors(
-            [
-                {
-                    "dps": POWERLEVEL_DPS,
-                    "name": "sensor_power_level",
-                    "unit": PERCENTAGE,
-                    "device_class": SensorDeviceClass.POWER_FACTOR,
-                    "testdata": ("2", 50),
-                },
-                {
-                    "dps": MODE_DPS,
-                    "name": "sensor_mode",
-                    "testdata": ("test", "test"),
-                },
-            ],
-        )
-        self.mark_secondary(
-            [
-                "lock_child_lock",
-                "number_timer",
-                "sensor_power_level",
-                "sensor_mode",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:fire")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:fire-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNIT_DPS] = "c"
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.CELSIUS,
-        )
-        self.dps[UNIT_DPS] = "f"
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.FAHRENHEIT,
-        )
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: True}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Eco")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                TEMPERATURE_DPS: 22,
-                PRESET_DPS: True,
-            },
-        ):
-            await self.subject.async_set_temperature(temperature=22, preset_mode="Eco")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_current_temperature_redirects_in_f(self):
-        self.dps[CURRENTTEMP_DPS] = 24
-        self.dps[CURTEMPF_DPS] = 75
-        self.dps[UNIT_DPS] = "f"
-        self.assertEqual(self.subject.current_temperature, 75)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = False
-        self.assertEqual(self.subject.preset_mode, "Normal")
-
-        self.dps[PRESET_DPS] = True
-        self.assertEqual(self.subject.preset_mode, "Eco")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Normal", "Eco"])
-
-    async def test_set_preset_mode_to_normal(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: False},
-        ):
-            await self.subject.async_set_preset_mode("Normal")
-
-    async def test_set_preset_mode_to_eco(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: True},
-        ):
-            await self.subject.async_set_preset_mode("Eco")

+ 0 - 213
tests/devices/test_ecostrad_iqceramic_radiator.py

@@ -1,213 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import ECOSTRAD_IQCERAMIC_RADIATOR_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import BasicNumberTests
-from ..mixins.select import MultiSelectTests
-from ..mixins.switch import BasicSwitchTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-PRESET_DPS = "2"
-TEMPERATURE_DPS = "16"
-CURRENTTEMP_DPS = "24"
-CALIB_DPS = "27"
-LOCK_DPS = "40"
-PIR_DPS = "104"
-SYNC_DPS = "107"
-WINDOW_DPS = "108"
-LIMIT_DPS = "109"
-
-
-class TestEcostradAccentIqHeater(
-    BasicLockTests,
-    BasicNumberTests,
-    MultiSelectTests,
-    BasicSwitchTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "ecostrad_iqceramic_radiator.yaml",
-            ECOSTRAD_IQCERAMIC_RADIATOR_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS, self.subject, min=7.0, max=30.0, scale=10, step=5
-        )
-        self.setUpBasicLock(
-            LOCK_DPS,
-            self.entities.get("lock_child_lock"),
-        )
-        self.setUpBasicNumber(
-            CALIB_DPS,
-            self.entities.get("number_calibration_offset"),
-            min=-5,
-            max=5,
-            unit=UnitOfTemperature.CELSIUS,
-        )
-        self.setUpBasicSwitch(
-            SYNC_DPS, self.entities.get("switch_time_sync"), testdata=("1", "0")
-        )
-        self.setUpMultiSelect(
-            [
-                {
-                    "dps": PIR_DPS,
-                    "name": "select_pir_timeout",
-                    "options": {
-                        "15": "15 mins",
-                        "30": "30 mins",
-                        "45": "45 mins",
-                        "60": "60 mins",
-                    },
-                },
-                {
-                    "dps": WINDOW_DPS,
-                    "name": "select_open_window_detection",
-                    "options": {
-                        "0": "Off",
-                        "60": "60 mins",
-                        "90": "90 mins",
-                    },
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "lock_child_lock",
-                "number_calibration_offset",
-                "select_open_window_detection",
-                "select_pir_timeout",
-                "switch_time_sync",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.TARGET_TEMPERATURE
-            ),
-        )
-
-    def test_temperature_unit(self):
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.CELSIUS,
-        )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 250
-        self.assertEqual(self.subject.current_temperature, 25.0)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.HEAT],
-        )
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [
-                "Program",
-                "ECO",
-                "Comfort",
-                "Anti-Freeze",
-                "Sensor",
-                "Pilot Wire",
-            ],
-        )
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.preset_mode, "Program")
-        self.dps[PRESET_DPS] = "eco"
-        self.assertEqual(self.subject.preset_mode, "ECO")
-        self.dps[PRESET_DPS] = "hot"
-        self.assertEqual(self.subject.preset_mode, "Comfort")
-        self.dps[PRESET_DPS] = "cold"
-        self.assertEqual(self.subject.preset_mode, "Anti-Freeze")
-        self.dps[PRESET_DPS] = "person_infrared_ray"
-        self.assertEqual(self.subject.preset_mode, "Sensor")
-        self.dps[PRESET_DPS] = "line_control"
-        self.assertEqual(self.subject.preset_mode, "Pilot Wire")
-
-    async def test_set_preset_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "auto"},
-        ):
-            await self.subject.async_set_preset_mode("Program")
-
-    async def test_set_preset_to_eco(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "eco"},
-        ):
-            await self.subject.async_set_preset_mode("ECO")
-
-    async def test_set_preset_to_hot(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "hot"},
-        ):
-            await self.subject.async_set_preset_mode("Comfort")
-
-    async def test_set_preset_to_cold(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "cold"},
-        ):
-            await self.subject.async_set_preset_mode("Anti-Freeze")
-
-    async def test_set_preset_to_pir(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "person_infrared_ray"},
-        ):
-            await self.subject.async_set_preset_mode("Sensor")
-
-    async def test_set_preset_to_line(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "line_control"},
-        ):
-            await self.subject.async_set_preset_mode("Pilot Wire")
-
-    def test_extra_state_attributes(self):
-        self.dps[LIMIT_DPS] = "3"
-
-        self.assertEqual(
-            self.subject.extra_state_attributes,
-            {"limit_function": "3"},
-        )

+ 0 - 203
tests/devices/test_eesee_adam_dehumidifier.py

@@ -1,203 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import PERCENTAGE
-
-from ..const import EESEE_ADAM_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.select import BasicSelectTests
-from ..mixins.sensor import BasicSensorTests
-from ..mixins.switch import SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-HUMIDITY_DPS = "2"
-MODE_DPS = "4"
-FAN_DPS = "5"
-LOCK_DPS = "14"
-CURRENTHUMID_DPS = "16"
-TIMER_DPS = "17"
-ERROR_DPS = "19"
-
-
-class TestEeseeAdamDehumidifier(
-    BasicBinarySensorTests,
-    BasicLockTests,
-    BasicSelectTests,
-    BasicSensorTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("eesee_adam_dehumidifier.yaml", EESEE_ADAM_PAYLOAD)
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.fan = self.entities.get("fan")
-        self.setUpBasicLock(
-            LOCK_DPS,
-            self.entities.get("lock_child_lock"),
-        )
-        self.setUpBasicSelect(
-            TIMER_DPS,
-            self.entities.get("select_timer"),
-            {
-                "cancel": "Off",
-                "1h": "1 hour",
-                "2h": "2 hours",
-                "3h": "3 hours",
-                "4h": "4 hours",
-                "5h": "5 hours",
-                "6h": "6 hours",
-                "7h": "7 hours",
-                "8h": "8 hours",
-                "9h": "9 hours",
-                "10h": "10 hours",
-                "11h": "11 hours",
-                "12h": "12 hours",
-                "13h": "13 hours",
-                "14h": "14 hours",
-                "15h": "15 hours",
-                "16h": "16 hours",
-                "17h": "17 hours",
-                "18h": "18 hours",
-                "19h": "19 hours",
-                "20h": "20 hours",
-                "21h": "21 hours",
-                "22h": "22 hours",
-                "23h": "23 hours",
-                "24h": "24 hours",
-            },
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_tank"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(1, 0),
-        )
-        self.setUpBasicSensor(
-            CURRENTHUMID_DPS,
-            self.entities.get("sensor_current_humidity"),
-            device_class=SensorDeviceClass.HUMIDITY,
-            state_class="measurement",
-            unit=PERCENTAGE,
-        )
-        self.mark_secondary(["binary_sensor_tank", "lock_child_lock", "select_timer"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            HumidifierEntityFeature.MODES,
-        )
-        self.assertEqual(
-            self.fan.supported_features,
-            FanEntityFeature.SET_SPEED,
-        )
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "manual"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "laundry"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:tshirt-crew-outline")
-
-        self.dps[ERROR_DPS] = 1
-        self.assertEqual(self.subject.icon, "mdi:cup-water")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 25)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_modes(self):
-        self.assertCountEqual(
-            self.subject.available_modes,
-            [
-                "Manual",
-                "Dry clothes",
-            ],
-        )
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "manual"
-        self.assertEqual(self.subject.mode, "Manual")
-        self.dps[MODE_DPS] = "laundry"
-        self.assertEqual(self.subject.mode, "Dry clothes")
-
-    async def test_set_mode_to_manual(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "manual",
-            },
-        ):
-            await self.subject.async_set_mode("Manual")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_clothes(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "laundry",
-            },
-        ):
-            await self.subject.async_set_mode("Dry clothes")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_speed_steps(self):
-        self.assertEqual(self.fan.speed_count, 2)
-
-    def test_fan_speed(self):
-        self.dps[FAN_DPS] = "low"
-        self.assertEqual(self.fan.percentage, 50)
-        self.dps[FAN_DPS] = "high"
-        self.assertEqual(self.fan.percentage, 100)
-        self.dps[MODE_DPS] = "laundry"
-        self.assertEqual(self.fan.percentage, 100)
-
-    async def test_fan_set_speed_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "low",
-            },
-        ):
-            await self.fan.async_set_percentage(50)
-
-    async def test_fan_set_speed_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "high",
-            },
-        ):
-            await self.fan.async_set_percentage(100)

+ 0 - 274
tests/devices/test_electriq_12wminv_heatpump.py

@@ -1,274 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import ELECTRIQ_12WMINV_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.light import BasicLightTests
-from ..mixins.switch import BasicSwitchTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-HVACMODE_DPS = "4"
-FAN_DPS = "5"
-UNKNOWN8_DPS = "8"
-UNKNOWN12_DPS = "12"
-SWITCH_DPS = "101"
-UNKNOWN102_DPS = "102"
-UNKNOWN103_DPS = "103"
-LIGHT_DPS = "104"
-VSWING_DPS = "106"
-HSWING_DPS = "107"
-UNKNOWN108_DPS = "108"
-UNKNOWN109_DPS = "109"
-UNKNOWN110_DPS = "110"
-
-
-class TestElectriq12WMINVHeatpump(
-    BasicLightTests,
-    BasicSwitchTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_12wminv_heatpump.yaml", ELECTRIQ_12WMINV_HEATPUMP_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=16,
-            max=32,
-        )
-        self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_display"))
-        self.setUpBasicSwitch(SWITCH_DPS, self.entities.get("switch_sleep"))
-        self.mark_secondary(["light_display", "lock_child_lock"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.FAN_MODE
-                | ClimateEntityFeature.SWING_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:hvac")
-        self.dps[HVACMODE_DPS] = "cold"
-        self.assertEqual(self.subject.icon, "mdi:snowflake")
-        self.dps[HVACMODE_DPS] = "hot"
-        self.assertEqual(self.subject.icon, "mdi:fire")
-        self.dps[HVACMODE_DPS] = "wet"
-        self.assertEqual(self.subject.icon, "mdi:water")
-        self.dps[HVACMODE_DPS] = "wind"
-        self.assertEqual(self.subject.icon, "mdi:fan")
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "hot"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = "cold"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-
-        self.dps[HVACMODE_DPS] = "wet"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.DRY)
-
-        self.dps[HVACMODE_DPS] = "wind"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.FAN_ONLY)
-
-        self.dps[HVACMODE_DPS] = "auto"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT_COOL)
-
-        self.dps[HVACMODE_DPS] = "auto"
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [
-                HVACMode.OFF,
-                HVACMode.HEAT,
-                HVACMode.HEAT_COOL,
-                HVACMode.COOL,
-                HVACMode.DRY,
-                HVACMode.FAN_ONLY,
-            ],
-        )
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: True, HVACMODE_DPS: "hot"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_fan_mode(self):
-        self.dps[FAN_DPS] = 1
-        self.assertEqual(self.subject.fan_mode, "auto")
-        self.dps[FAN_DPS] = 2
-        self.assertEqual(self.subject.fan_mode, "Turbo")
-        self.dps[FAN_DPS] = 3
-        self.assertEqual(self.subject.fan_mode, "low")
-        self.dps[FAN_DPS] = 4
-        self.assertEqual(self.subject.fan_mode, "medium")
-        self.dps[FAN_DPS] = 5
-        self.assertEqual(self.subject.fan_mode, "high")
-
-    def test_fan_mode_invalid_in_dry_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = "wet"
-        self.dps[FAN_DPS] = 1
-        self.assertIs(self.subject.fan_mode, None)
-
-    def test_fan_modes(self):
-        self.assertCountEqual(
-            self.subject.fan_modes,
-            [
-                "auto",
-                "Turbo",
-                "low",
-                "medium",
-                "high",
-            ],
-        )
-
-    async def test_set_fan_mode_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: 1},
-        ):
-            await self.subject.async_set_fan_mode("auto")
-
-    async def test_set_fan_mode_to_turbo(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: 2},
-        ):
-            await self.subject.async_set_fan_mode("Turbo")
-
-    async def test_set_fan_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: 3},
-        ):
-            await self.subject.async_set_fan_mode("low")
-
-    async def test_set_fan_mode_to_medium(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: 4},
-        ):
-            await self.subject.async_set_fan_mode("medium")
-
-    async def test_set_fan_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: 5},
-        ):
-            await self.subject.async_set_fan_mode("high")
-
-    def test_swing_modes(self):
-        self.assertCountEqual(
-            self.subject.swing_modes,
-            ["off", "horizontal", "vertical", "both"],
-        )
-
-    def test_swing_mode(self):
-        self.dps[VSWING_DPS] = False
-        self.dps[HSWING_DPS] = False
-        self.assertEqual(self.subject.swing_mode, "off")
-
-        self.dps[VSWING_DPS] = True
-        self.assertEqual(self.subject.swing_mode, "vertical")
-
-        self.dps[HSWING_DPS] = True
-        self.assertEqual(self.subject.swing_mode, "both")
-
-        self.dps[VSWING_DPS] = False
-        self.assertEqual(self.subject.swing_mode, "horizontal")
-
-    async def test_set_swing_mode_to_both(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HSWING_DPS: True, VSWING_DPS: True},
-        ):
-            await self.subject.async_set_swing_mode("both")
-
-    async def test_set_swing_mode_to_horizontal(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HSWING_DPS: True, VSWING_DPS: False},
-        ):
-            await self.subject.async_set_swing_mode("horizontal")
-
-    async def test_set_swing_mode_to_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HSWING_DPS: False, VSWING_DPS: False},
-        ):
-            await self.subject.async_set_swing_mode("off")
-
-    async def test_set_swing_mode_to_vertical(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HSWING_DPS: False, VSWING_DPS: True},
-        ):
-            await self.subject.async_set_swing_mode("vertical")
-
-    def test_extra_state_attribures(self):
-        self.dps[UNKNOWN8_DPS] = True
-        self.dps[UNKNOWN12_DPS] = False
-        self.dps[UNKNOWN102_DPS] = True
-        self.dps[UNKNOWN103_DPS] = False
-        self.dps[UNKNOWN108_DPS] = 108
-        self.dps[UNKNOWN109_DPS] = 109
-        self.dps[UNKNOWN110_DPS] = 110
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "unknown_8": True,
-                "unknown_12": False,
-                "unknown_102": True,
-                "unknown_103": False,
-                "unknown_108": 108,
-                "unknown_109": 109,
-                "unknown_110": 110,
-            },
-        )
-
-    def test_light_icon(self):
-        self.dps[LIGHT_DPS] = True
-        self.assertEqual(self.basicLight.icon, "mdi:led-on")
-
-        self.dps[LIGHT_DPS] = False
-        self.assertEqual(self.basicLight.icon, "mdi:led-off")
-
-    def test_switch_icon(self):
-        self.assertEqual(self.basicSwitch.icon, "mdi:power-sleep")

+ 0 - 214
tests/devices/test_electriq_airflex15w_heatpump.py

@@ -1,214 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import PERCENTAGE, UnitOfTemperature
-
-from ..const import ELECTRIQ_AIRFLEX15W_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.select import BasicSelectTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-HUMIDITY_DPS = "17"
-UNKNOWN20_DPS = "20"
-HVACMODE_DPS = "101"
-UNKNOWN103_DPS = "103"
-FAN_DPS = "104"
-UNKNOWN105_DPS = "105"
-UNKNOWN106_DPS = "106"
-UNIT_DPS = "109"
-TEMPF_DPS = "110"
-CURTEMPF_DPS = "111"
-CURHUMID_DPS = "112"
-
-
-class TestElectriqAirflex15WHeatpump(
-    BasicSelectTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_airflex15w_heatpump.yaml", ELECTRIQ_AIRFLEX15W_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=16,
-            max=31,
-        )
-        self.setUpBasicSelect(
-            UNIT_DPS,
-            self.entities.get("select_temperature_unit"),
-            {
-                False: "Celsius",
-                True: "Fahrenheit",
-            },
-        )
-        self.mark_secondary(["select_temperature_unit"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.TARGET_HUMIDITY
-                | ClimateEntityFeature.FAN_MODE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "0"
-        self.assertEqual(self.subject.icon, "mdi:hvac")
-        self.dps[HVACMODE_DPS] = "1"
-        self.assertEqual(self.subject.icon, "mdi:snowflake")
-        self.dps[HVACMODE_DPS] = "2"
-        self.assertEqual(self.subject.icon, "mdi:fire")
-        self.dps[HVACMODE_DPS] = "3"
-        self.assertEqual(self.subject.icon, "mdi:water")
-        self.dps[HVACMODE_DPS] = "5"
-        self.assertEqual(self.subject.icon, "mdi:fan")
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNIT_DPS] = False
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-        self.dps[UNIT_DPS] = True
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-
-    def test_current_temperature(self):
-        self.dps[UNIT_DPS] = False
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-        self.dps[UNIT_DPS] = True
-        self.dps[CURTEMPF_DPS] = 78
-        self.assertEqual(self.subject.current_temperature, 78)
-
-    def test_temperature_f(self):
-        self.dps[UNIT_DPS] = True
-        self.dps[TEMPF_DPS] = 90
-        self.assertEqual(self.subject.target_temperature, 90)
-
-    async def test_set_temperature_f(self):
-        self.dps[UNIT_DPS] = True
-        async with assert_device_properties_set(
-            self.subject._device,
-            {TEMPF_DPS: 85},
-        ):
-            await self.subject.async_set_temperature(temperature=85)
-
-    def test_hvac_mode(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "2"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-        self.dps[HVACMODE_DPS] = "1"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-        self.dps[HVACMODE_DPS] = "3"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.DRY)
-        self.dps[HVACMODE_DPS] = "0"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT_COOL)
-        self.dps[HVACMODE_DPS] = "5"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.FAN_ONLY)
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [
-                HVACMode.OFF,
-                HVACMode.HEAT,
-                HVACMode.HEAT_COOL,
-                HVACMode.COOL,
-                HVACMode.DRY,
-                HVACMode.FAN_ONLY,
-            ],
-        )
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: True, HVACMODE_DPS: "2"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_fan_mode(self):
-        self.dps[FAN_DPS] = "1"
-        self.assertEqual(self.subject.fan_mode, "high")
-        self.dps[FAN_DPS] = "2"
-        self.assertEqual(self.subject.fan_mode, "medium")
-        self.dps[FAN_DPS] = "3"
-        self.assertEqual(self.subject.fan_mode, "low")
-
-    def test_fan_modes(self):
-        self.assertCountEqual(
-            self.subject.fan_modes,
-            [
-                "high",
-                "medium",
-                "low",
-            ],
-        )
-
-    async def test_set_fan_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "1"},
-        ):
-            await self.subject.async_set_fan_mode("high")
-
-    async def test_set_fan_mode_to_medium(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "2"},
-        ):
-            await self.subject.async_set_fan_mode("medium")
-
-    async def test_set_fan_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "3"},
-        ):
-            await self.subject.async_set_fan_mode("low")
-
-    def test_humidity(self):
-        self.dps[HUMIDITY_DPS] = 74
-        self.assertEqual(self.subject.target_humidity, 74)
-
-    async def test_set_humidity(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 40},
-        ):
-            await self.subject.async_set_humidity(40)
-
-    def test_extra_state_attribures(self):
-        self.dps[UNKNOWN20_DPS] = 20
-        self.dps[UNKNOWN103_DPS] = True
-        self.dps[UNKNOWN105_DPS] = 105
-        self.dps[UNKNOWN106_DPS] = True
-        self.assertEqual(
-            self.subject.extra_state_attributes,
-            {
-                "unknown_20": 20,
-                "unknown_103": True,
-                "unknown_105": 105,
-                "unknown_106": True,
-            },
-        )

+ 0 - 134
tests/devices/test_electriq_cd12_dehumidifier.py

@@ -1,134 +0,0 @@
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import ELECTRIQ_CD12PW_DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.light import BasicLightTests
-from ..mixins.sensor import MultiSensorTests
-from ..mixins.switch import SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-MODE_DPS = "2"
-CURRENTHUMID_DPS = "3"
-HUMIDITY_DPS = "4"
-LIGHT_DPS = "101"
-CURRENTTEMP_DPS = "103"
-
-
-class TestElectriqCD12PWDehumidifier(
-    BasicLightTests, MultiSensorTests, SwitchableTests, TuyaDeviceTestCase
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_cd12pw_dehumidifier.yaml", ELECTRIQ_CD12PW_DEHUMIDIFIER_PAYLOAD
-        )
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_display"))
-        self.setUpMultiSensors(
-            [
-                {
-                    "name": "sensor_current_temperature",
-                    "dps": CURRENTTEMP_DPS,
-                    "unit": UnitOfTemperature.CELSIUS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "state_class": "measurement",
-                },
-                {
-                    "name": "sensor_current_humidity",
-                    "dps": CURRENTHUMID_DPS,
-                    "unit": PERCENTAGE,
-                    "device_class": SensorDeviceClass.HUMIDITY,
-                    "state_class": "measurement",
-                },
-            ]
-        )
-        self.mark_secondary(["light_display"])
-
-    def test_supported_features(self):
-        self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES)
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "fan"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:air-purifier")
-
-        self.dps[LIGHT_DPS] = True
-        self.assertEqual(self.basicLight.icon, "mdi:led-on")
-        self.dps[LIGHT_DPS] = False
-        self.assertEqual(self.basicLight.icon, "mdi:led-off")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 35)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_set_target_humidity_rounds_up_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 55},
-        ):
-            await self.subject.async_set_humidity(53)
-
-    async def test_set_target_humidity_rounds_down_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 50},
-        ):
-            await self.subject.async_set_humidity(52)
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.mode, "Auto")
-        self.dps[MODE_DPS] = "fan"
-        self.assertEqual(self.subject.mode, "Air clean")
-
-    async def test_set_mode_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "auto",
-            },
-        ):
-            await self.subject.async_set_mode("Auto")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "fan",
-            },
-        ):
-            await self.subject.async_set_mode("Air clean")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_extra_state_attributes(self):
-        self.dps[CURRENTHUMID_DPS] = 50
-        self.dps[CURRENTTEMP_DPS] = 21
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"current_humidity": 50, "current_temperature": 21},
-        )

+ 0 - 142
tests/devices/test_electriq_cd12pwv2_dehumidifier.py

@@ -1,142 +0,0 @@
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-)
-
-from ..const import ELECTRIQ_CD12PWV2_DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.light import BasicLightTests
-from ..mixins.sensor import BasicSensorTests
-from ..mixins.switch import BasicSwitchTests, SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-HUMIDITY_DPS = "2"
-MODE_DPS = "5"
-CURRENTHUMID_DPS = "6"
-ERROR_DPS = "19"
-LIGHT_DPS = "101"
-SLEEP_DPS = "104"
-
-
-class TestElectriqCD12PWV2Dehumidifier(
-    BasicBinarySensorTests,
-    BasicLightTests,
-    BasicSensorTests,
-    BasicSwitchTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_cd12pwv2_dehumidifier.yaml",
-            ELECTRIQ_CD12PWV2_DEHUMIDIFIER_PAYLOAD,
-        )
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.setUpBasicBinarySensor(
-            ERROR_DPS, self.entities.get("binary_sensor_tank"), testdata=(1, 0)
-        )
-        self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_display"))
-        self.setUpBasicSensor(
-            CURRENTHUMID_DPS,
-            self.entities.get("sensor_current_humidity"),
-            unit=PERCENTAGE,
-            device_class=SensorDeviceClass.HUMIDITY,
-            state_class="measurement",
-        )
-        self.setUpBasicSwitch(
-            SLEEP_DPS,
-            self.entities.get("switch_sleep"),
-        )
-        self.mark_secondary(["light_display", "switch_sleep", "binary_sensor_tank"])
-
-    def test_supported_features(self):
-        self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES)
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "Smart"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "Air_purifier"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:air-purifier")
-
-        self.dps[LIGHT_DPS] = True
-        self.assertEqual(self.basicLight.icon, "mdi:led-on")
-        self.dps[LIGHT_DPS] = False
-        self.assertEqual(self.basicLight.icon, "mdi:led-off")
-
-        self.dps[SLEEP_DPS] = True
-        self.assertEqual(self.basicSwitch.icon, "mdi:sleep")
-        self.dps[SLEEP_DPS] = False
-        self.assertEqual(self.basicSwitch.icon, "mdi:sleep-off")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 35)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_set_target_humidity_rounds_up_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 55},
-        ):
-            await self.subject.async_set_humidity(53)
-
-    async def test_set_target_humidity_rounds_down_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 50},
-        ):
-            await self.subject.async_set_humidity(52)
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "Smart"
-        self.assertEqual(self.subject.mode, "Smart")
-        self.dps[MODE_DPS] = "Air_purifier"
-        self.assertEqual(self.subject.mode, "Air Purifier")
-
-    async def test_set_mode_to_smart(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "Smart",
-            },
-        ):
-            await self.subject.async_set_mode("Smart")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_air_purify(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "Air_purifier",
-            },
-        ):
-            await self.subject.async_set_mode("Air Purifier")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_extra_state_attributes(self):
-        self.dps[CURRENTHUMID_DPS] = 50
-        self.dps[ERROR_DPS] = 2
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"current_humidity": 50, "error_code": 2},
-        )

+ 0 - 239
tests/devices/test_electriq_cd20_dehumidifier.py

@@ -1,239 +0,0 @@
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import ELECTRIQ_CD20PRO_DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.light import BasicLightTests
-from ..mixins.sensor import MultiSensorTests
-from ..mixins.switch import MultiSwitchTests, SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-MODE_DPS = "2"
-CURRENTHUMID_DPS = "3"
-HUMIDITY_DPS = "4"
-ANION_DPS = "5"
-UV_DPS = "10"
-LIGHT_DPS = "101"
-PRESET_DPS = "102"
-CURRENTTEMP_DPS = "103"
-
-
-class TestElectriqCD20ProDehumidifier(
-    BasicLightTests,
-    MultiSensorTests,
-    MultiSwitchTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_cd20pro_dehumidifier.yaml", ELECTRIQ_CD20PRO_DEHUMIDIFIER_PAYLOAD
-        )
-        self.subject = self.entities.get("humidifier")
-        self.fan = self.entities.get("fan")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_display"))
-        self.setUpMultiSwitch(
-            [
-                {"dps": UV_DPS, "name": "switch_uv_sterilization"},
-                {"dps": ANION_DPS, "name": "switch_ionizer"},
-            ]
-        )
-        self.setUpMultiSensors(
-            [
-                {
-                    "name": "sensor_current_temperature",
-                    "dps": CURRENTTEMP_DPS,
-                    "unit": UnitOfTemperature.CELSIUS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "state_class": "measurement",
-                },
-                {
-                    "name": "sensor_current_humidity",
-                    "dps": CURRENTHUMID_DPS,
-                    "unit": PERCENTAGE,
-                    "device_class": SensorDeviceClass.HUMIDITY,
-                    "state_class": "measurement",
-                },
-            ]
-        )
-        self.mark_secondary(["light_display"])
-
-    def test_supported_features(self):
-        self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES)
-        self.assertEqual(self.fan.supported_features, FanEntityFeature.PRESET_MODE)
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "fan"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:air-purifier")
-
-        self.dps[MODE_DPS] = "high"
-        self.assertEqual(self.subject.icon, "mdi:tshirt-crew-outline")
-
-        self.assertEqual(
-            self.multiSwitch["switch_uv_sterilization"].icon,
-            "mdi:solar-power",
-        )
-        self.assertEqual(
-            self.multiSwitch["switch_ionizer"].icon,
-            "mdi:creation",
-        )
-        self.dps[LIGHT_DPS] = True
-        self.assertEqual(self.basicLight.icon, "mdi:led-on")
-        self.dps[LIGHT_DPS] = False
-        self.assertEqual(self.basicLight.icon, "mdi:led-off")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 35)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_set_target_humidity_rounds_up_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 55},
-        ):
-            await self.subject.async_set_humidity(53)
-
-    async def test_set_target_humidity_rounds_down_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 50},
-        ):
-            await self.subject.async_set_humidity(52)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "low"
-        self.assertEqual(self.subject.mode, "Low")
-        self.dps[MODE_DPS] = "high"
-        self.assertEqual(self.subject.mode, "High")
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.mode, "Auto")
-        self.dps[MODE_DPS] = "fan"
-        self.assertEqual(self.subject.mode, "Air clean")
-
-    async def test_set_mode_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "auto",
-            },
-        ):
-            await self.subject.async_set_mode("Auto")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "low",
-            },
-        ):
-            await self.subject.async_set_mode("Low")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "high",
-            },
-        ):
-            await self.subject.async_set_mode("High")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "fan",
-            },
-        ):
-            await self.subject.async_set_mode("Air clean")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_preset_mode(self):
-        self.dps[PRESET_DPS] = "45"
-        self.assertEqual(self.fan.preset_mode, "Half open")
-
-        self.dps[PRESET_DPS] = "90"
-        self.assertEqual(self.fan.preset_mode, "Fully open")
-
-        self.dps[PRESET_DPS] = "0_90"
-        self.assertEqual(self.fan.preset_mode, "Oscillate")
-
-    async def test_set_fan_to_half_open(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                PRESET_DPS: "45",
-            },
-        ):
-            await self.fan.async_set_preset_mode("Half open")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_fan_to_fully_open(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                PRESET_DPS: "90",
-            },
-        ):
-            await self.fan.async_set_preset_mode("Fully open")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_fan_to_oscillate(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                PRESET_DPS: "0_90",
-            },
-        ):
-            await self.fan.async_set_preset_mode("Oscillate")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_extra_state_attributes(self):
-        self.dps[CURRENTHUMID_DPS] = 50
-        self.dps[CURRENTTEMP_DPS] = 21
-        self.dps[ANION_DPS] = True
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"current_humidity": 50, "current_temperature": 21, "anion": True},
-        )
-        self.assertEqual(self.fan.extra_state_attributes, {})

+ 0 - 226
tests/devices/test_electriq_cd25_dehumidifier.py

@@ -1,226 +0,0 @@
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import ELECTRIQ_DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.light import BasicLightTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.sensor import MultiSensorTests
-from ..mixins.switch import BasicSwitchTests, SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-MODE_DPS = "2"
-CURRENTHUMID_DPS = "3"
-HUMIDITY_DPS = "4"
-LOCK_DPS = "7"
-LIGHT_DPS = "10"
-PRESET_DPS = "102"
-CURRENTTEMP_DPS = "103"
-IONIZER_DPS = "104"
-
-
-class TestElectriqCD25ProDehumidifier(
-    BasicLightTests,
-    BasicLockTests,
-    BasicSwitchTests,
-    MultiSensorTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_cd25pro_dehumidifier.yaml", ELECTRIQ_DEHUMIDIFIER_PAYLOAD
-        )
-        self.subject = self.entities.get("humidifier")
-        self.fan = self.entities.get("fan")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_uv_sterilization"))
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicSwitch(IONIZER_DPS, self.entities.get("switch_ionizer"))
-        self.setUpMultiSensors(
-            [
-                {
-                    "name": "sensor_current_temperature",
-                    "dps": CURRENTTEMP_DPS,
-                    "unit": UnitOfTemperature.CELSIUS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "state_class": "measurement",
-                },
-                {
-                    "name": "sensor_current_humidity",
-                    "dps": CURRENTHUMID_DPS,
-                    "unit": PERCENTAGE,
-                    "device_class": SensorDeviceClass.HUMIDITY,
-                    "state_class": "measurement",
-                },
-            ]
-        )
-        self.mark_secondary(["lock_child_lock"])
-
-    def test_supported_features(self):
-        self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES)
-        self.assertEqual(self.fan.supported_features, FanEntityFeature.PRESET_MODE)
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "fan"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:air-purifier")
-
-        self.dps[MODE_DPS] = "high"
-        self.assertEqual(self.subject.icon, "mdi:tshirt-crew-outline")
-
-        self.assertEqual(self.basicLight.icon, "mdi:solar-power")
-        self.assertEqual(self.basicSwitch.icon, "mdi:creation")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 35)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_set_target_humidity_rounds_up_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 55},
-        ):
-            await self.subject.async_set_humidity(53)
-
-    async def test_set_target_humidity_rounds_down_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 50},
-        ):
-            await self.subject.async_set_humidity(52)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "low"
-        self.assertEqual(self.subject.mode, "Low")
-        self.dps[MODE_DPS] = "high"
-        self.assertEqual(self.subject.mode, "High")
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.mode, "Auto")
-        self.dps[MODE_DPS] = "fan"
-        self.assertEqual(self.subject.mode, "Air clean")
-
-    async def test_set_mode_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "auto",
-            },
-        ):
-            await self.subject.async_set_mode("Auto")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "low",
-            },
-        ):
-            await self.subject.async_set_mode("Low")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "high",
-            },
-        ):
-            await self.subject.async_set_mode("High")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "fan",
-            },
-        ):
-            await self.subject.async_set_mode("Air clean")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_preset_mode(self):
-        self.dps[PRESET_DPS] = "45"
-        self.assertEqual(self.fan.preset_mode, "Half open")
-
-        self.dps[PRESET_DPS] = "90"
-        self.assertEqual(self.fan.preset_mode, "Fully open")
-
-        self.dps[PRESET_DPS] = "0_90"
-        self.assertEqual(self.fan.preset_mode, "Oscillate")
-
-    async def test_set_fan_to_half_open(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                PRESET_DPS: "45",
-            },
-        ):
-            await self.fan.async_set_preset_mode("Half open")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_fan_to_fully_open(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                PRESET_DPS: "90",
-            },
-        ):
-            await self.fan.async_set_preset_mode("Fully open")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_fan_to_oscillate(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                PRESET_DPS: "0_90",
-            },
-        ):
-            await self.fan.async_set_preset_mode("Oscillate")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_extra_state_attributes(self):
-        self.dps[CURRENTHUMID_DPS] = 50
-        self.dps[CURRENTTEMP_DPS] = 21
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"current_humidity": 50, "current_temperature": 21},
-        )
-        self.assertEqual(self.fan.extra_state_attributes, {})

+ 0 - 266
tests/devices/test_electriq_desd9lw_dehumidifier.py

@@ -1,266 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import PERCENTAGE, UnitOfTemperature
-
-from ..const import ELECTRIQ_DESD9LW_DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.light import BasicLightTests
-from ..mixins.sensor import BasicSensorTests
-from ..mixins.switch import BasicSwitchTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-HUMIDITY_DPS = "2"
-FAN_DPS = "4"
-HVACMODE_DPS = "5"
-CURRENTHUM_DPS = "6"
-CURRENTTEMP_DPS = "7"
-SWING_DPS = "10"
-SWITCH_DPS = "12"
-LIGHT_DPS = "15"
-TEMPERATURE_DPS = "101"
-
-
-class TestElectriqDESD9LWDehumidifier(
-    BasicLightTests,
-    BasicSensorTests,
-    BasicSwitchTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "electriq_desd9lw_dehumidifier.yaml",
-            ELECTRIQ_DESD9LW_DEHUMIDIFIER_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=16,
-            max=30,
-        )
-        self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_uv_sterilization"))
-        self.setUpBasicSwitch(SWITCH_DPS, self.entities.get("switch_ionizer"))
-        self.setUpBasicSensor(
-            CURRENTHUM_DPS,
-            self.entities.get("sensor_current_humidity"),
-            unit=PERCENTAGE,
-            device_class=SensorDeviceClass.HUMIDITY,
-            state_class="measurement",
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.FAN_MODE
-                | ClimateEntityFeature.SWING_MODE
-                | ClimateEntityFeature.TARGET_HUMIDITY
-                | ClimateEntityFeature.TARGET_TEMPERATURE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-        self.dps[HVACMODE_DPS] = "Dehumidity"
-        self.assertEqual(self.subject.icon, "mdi:water")
-        self.dps[HVACMODE_DPS] = "Heater"
-        self.assertEqual(self.subject.icon, "mdi:fire")
-        self.dps[HVACMODE_DPS] = "Fan"
-        self.assertEqual(self.subject.icon, "mdi:fan")
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 21
-        self.assertEqual(self.subject.current_temperature, 21)
-
-    def test_current_humidity(self):
-        self.dps[CURRENTHUM_DPS] = 60
-        self.assertEqual(self.subject.current_humidity, 60)
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 35)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 45
-        self.assertEqual(self.subject.target_humidity, 45)
-
-    async def test_set_target_humidity_rounds_to_5_percent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 55},
-        ):
-            await self.subject.async_set_humidity(53)
-
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 45},
-        ):
-            await self.subject.async_set_humidity(47)
-
-    def test_hvac_mode(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "Heater"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = "Dehumidity"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.DRY)
-
-        self.dps[HVACMODE_DPS] = "Fan"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.FAN_ONLY)
-
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.AUTO)
-
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [
-                HVACMode.AUTO,
-                HVACMode.DRY,
-                HVACMode.FAN_ONLY,
-                HVACMode.HEAT,
-                HVACMode.OFF,
-            ],
-        )
-
-    async def test_turn_on(self):
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.dps[POWER_DPS] = False
-
-        async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: True, HVACMODE_DPS: "Heater"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.dps[POWER_DPS] = True
-
-        async with assert_device_properties_set(
-            self.subject._device, {POWER_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    async def test_set_mode_to_heater(self):
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.dps[POWER_DPS] = True
-
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "Heater", POWER_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_mode_to_dehumidity(self):
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.dps[POWER_DPS] = True
-
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "Dehumidity", POWER_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.DRY)
-
-    async def test_set_mode_to_fan(self):
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.dps[POWER_DPS] = True
-
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "Fan", POWER_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.FAN_ONLY)
-
-    async def test_set_mode_to_auto(self):
-        self.dps[HVACMODE_DPS] = "Fan"
-        self.dps[POWER_DPS] = True
-
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "Auto", POWER_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.AUTO)
-
-    def test_fan_mode(self):
-        self.dps[FAN_DPS] = "Low"
-        self.assertEqual(self.subject.fan_mode, "Low")
-        self.dps[FAN_DPS] = "Medium"
-        self.assertEqual(self.subject.fan_mode, "Medium")
-        self.dps[FAN_DPS] = "High"
-        self.assertEqual(self.subject.fan_mode, "High")
-
-    def test_fan_mode_invalid_in_auto_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = "Auto"
-        self.dps[FAN_DPS] = "Low"
-        self.assertIs(self.subject.fan_mode, None)
-
-    def test_fan_modes(self):
-        self.assertCountEqual(
-            self.subject.fan_modes,
-            ["Low", "Medium", "High"],
-        )
-
-    async def test_set_fan_mode_to_low(self):
-        async with assert_device_properties_set(self.subject._device, {FAN_DPS: "Low"}):
-            await self.subject.async_set_fan_mode("Low")
-
-    async def test_set_fan_mode_to_medium(self):
-        async with assert_device_properties_set(
-            self.subject._device, {FAN_DPS: "Medium"}
-        ):
-            await self.subject.async_set_fan_mode("Medium")
-
-    async def test_set_fan_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device, {FAN_DPS: "High"}
-        ):
-            await self.subject.async_set_fan_mode("High")
-
-    def test_swing_modes(self):
-        self.assertCountEqual(
-            self.subject.swing_modes,
-            ["off", "vertical"],
-        )
-
-    def test_swing_mode(self):
-        self.dps[SWING_DPS] = False
-        self.assertEqual(self.subject.swing_mode, "off")
-
-        self.dps[SWING_DPS] = True
-        self.assertEqual(self.subject.swing_mode, "vertical")
-
-    async def test_set_swing_mode_to_vertical(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {SWING_DPS: True},
-        ):
-            await self.subject.async_set_swing_mode("vertical")
-
-    async def test_set_swing_mode_to_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {SWING_DPS: False},
-        ):
-            await self.subject.async_set_swing_mode("off")
-
-    def test_light_icon(self):
-        self.assertEqual(self.basicLight.icon, "mdi:solar-power")
-
-    def test_switch_icon(self):
-        self.assertEqual(self.basicSwitch.icon, "mdi:creation")

+ 0 - 172
tests/devices/test_eurom_saniwallheat2000_heater.py

@@ -1,172 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-    PRESET_BOOST,
-    PRESET_COMFORT,
-    PRESET_ECO,
-    SWING_OFF,
-    SWING_VERTICAL,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import EUROM_SANIWALLHEAT2000_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-SWING_DPS = "7"
-
-
-class TestEuromSaniWallHeat2000Heater(
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "eurom_saniwallheat2000_heater.yaml",
-            EUROM_SANIWALLHEAT2000_HEATER_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=10,
-            max=35,
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.SWING_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.icon, "mdi:fan")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "100_per"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.FAN_ONLY)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.HEAT, HVACMode.FAN_ONLY],
-        )
-
-    async def test_set_hvac_mode_to_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, PRESET_DPS: "auto"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, PRESET_DPS: "off"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.FAN_ONLY)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [PRESET_BOOST, PRESET_COMFORT, PRESET_ECO, "fan"],
-        )
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.preset_mode, "fan")
-        self.dps[PRESET_DPS] = "50_per"
-        self.assertEqual(self.subject.preset_mode, PRESET_ECO)
-        self.dps[PRESET_DPS] = "100_per"
-        self.assertEqual(self.subject.preset_mode, PRESET_BOOST)
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.preset_mode, PRESET_COMFORT)
-
-    async def test_set_preset_more_to_eco(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "50_per"}
-        ):
-            await self.subject.async_set_preset_mode(PRESET_ECO)
-
-    async def test_set_preset_more_to_boost(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "100_per"}
-        ):
-            await self.subject.async_set_preset_mode(PRESET_BOOST)
-
-    async def test_set_preset_mode_to_comfort(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "auto"}
-        ):
-            await self.subject.async_set_preset_mode(PRESET_COMFORT)
-
-    async def test_set_preset_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "off"}
-        ):
-            await self.subject.async_set_preset_mode("fan")
-
-    def test_swing_modes(self):
-        self.assertCountEqual(
-            self.subject.swing_modes,
-            [SWING_OFF, SWING_VERTICAL],
-        )
-
-    def test_swing_mode(self):
-        self.dps[SWING_DPS] = False
-        self.assertEqual(self.subject.swing_mode, SWING_OFF)
-
-        self.dps[SWING_DPS] = True
-        self.assertEqual(self.subject.swing_mode, SWING_VERTICAL)
-
-    async def test_set_swing_on(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {SWING_DPS: True},
-        ):
-            await self.subject.async_set_swing_mode(SWING_VERTICAL)
-
-    async def test_set_swing_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {SWING_DPS: False},
-        ):
-            await self.subject.async_set_swing_mode(SWING_OFF)
-
-    def test_extra_state_attributes(self):
-        self.assertEqual(self.subject.extra_state_attributes, {})

+ 0 - 172
tests/devices/test_eurom_walldesignheat2000_heater.py

@@ -1,172 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-    PRESET_BOOST,
-    PRESET_COMFORT,
-    PRESET_ECO,
-    SWING_OFF,
-    SWING_VERTICAL,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import EUROM_WALLDESIGNHEAT2000_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-SWING_DPS = "7"
-
-
-class TestEuromWallDesignheat2000Heater(
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "eurom_walldesignheat2000_heater.yaml",
-            EUROM_WALLDESIGNHEAT2000_HEATER_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=10,
-            max=35,
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.SWING_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.icon, "mdi:fan")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "100_perc"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.FAN_ONLY)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.HEAT, HVACMode.FAN_ONLY],
-        )
-
-    async def test_set_hvac_mode_to_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, PRESET_DPS: "auto"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, PRESET_DPS: "off"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.FAN_ONLY)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [PRESET_BOOST, PRESET_COMFORT, PRESET_ECO, "fan"],
-        )
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.preset_mode, "fan")
-        self.dps[PRESET_DPS] = "50_perc"
-        self.assertEqual(self.subject.preset_mode, PRESET_ECO)
-        self.dps[PRESET_DPS] = "100_perc"
-        self.assertEqual(self.subject.preset_mode, PRESET_BOOST)
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.preset_mode, PRESET_COMFORT)
-
-    async def test_set_preset_more_to_eco(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "50_perc"}
-        ):
-            await self.subject.async_set_preset_mode(PRESET_ECO)
-
-    async def test_set_preset_more_to_boost(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "100_perc"}
-        ):
-            await self.subject.async_set_preset_mode(PRESET_BOOST)
-
-    async def test_set_preset_mode_to_comfort(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "auto"}
-        ):
-            await self.subject.async_set_preset_mode(PRESET_COMFORT)
-
-    async def test_set_preset_mode_to_fan(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "off"}
-        ):
-            await self.subject.async_set_preset_mode("fan")
-
-    def test_swing_modes(self):
-        self.assertCountEqual(
-            self.subject.swing_modes,
-            [SWING_OFF, SWING_VERTICAL],
-        )
-
-    def test_swing_mode(self):
-        self.dps[SWING_DPS] = False
-        self.assertEqual(self.subject.swing_mode, SWING_OFF)
-
-        self.dps[SWING_DPS] = True
-        self.assertEqual(self.subject.swing_mode, SWING_VERTICAL)
-
-    async def test_set_swing_on(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {SWING_DPS: True},
-        ):
-            await self.subject.async_set_swing_mode(SWING_VERTICAL)
-
-    async def test_set_swing_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {SWING_DPS: False},
-        ):
-            await self.subject.async_set_swing_mode(SWING_OFF)
-
-    def test_extra_state_attributes(self):
-        self.assertEqual(self.subject.extra_state_attributes, {})

+ 0 - 192
tests/devices/test_fairland_iphcr15_heatpump.py

@@ -1,192 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import GARDENPAC_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-CURRENTTEMP_DPS = "102"
-UNITS_DPS = "103"
-POWERLEVEL_DPS = "104"
-OPMODE_DPS = "105"
-TEMPERATURE_DPS = "106"
-MINTEMP_DPS = "107"
-MAXTEMP_DPS = "108"
-ERROR_DPS = "115"
-ERROR2_DPS = "116"
-PRESET_DPS = "117"
-
-
-class TestFairlandIPHCR15PoolHeatpump(
-    BasicBinarySensorTests,
-    BasicSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "fairland_iphcr15_heatpump.yaml", GARDENPAC_HEATPUMP_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=18,
-            max=45,
-        )
-        self.setUpBasicSensor(
-            POWERLEVEL_DPS,
-            self.entities.get("sensor_power_level"),
-            unit=PERCENTAGE,
-            device_class=SensorDeviceClass.POWER_FACTOR,
-            state_class="measurement",
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_water_flow"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(4, 0),
-        )
-        self.mark_secondary(["sensor_power_level", "binary_sensor_water_flow"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[ERROR_DPS] = 0
-        self.dps[HVACMODE_DPS] = True
-        self.dps[OPMODE_DPS] = "warm"
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-        self.dps[OPMODE_DPS] = "cool"
-        self.assertEqual(self.subject.icon, "mdi:snowflake")
-        self.dps[OPMODE_DPS] = "smart"
-        self.assertEqual(self.subject.icon, "mdi:refresh-auto")
-
-        self.dps[ERROR_DPS] = 4
-        self.assertEqual(self.subject.icon, "mdi:water-pump-off")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNITS_DPS] = False
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-        self.dps[UNITS_DPS] = True
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_minimum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MINTEMP_DPS] = 60
-        self.assertEqual(self.subject.min_temp, 60)
-
-    def test_maximum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MAXTEMP_DPS] = 115
-        self.assertEqual(self.subject.max_temp, 115)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[OPMODE_DPS] = "warm"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-        self.dps[OPMODE_DPS] = "cool"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-        self.dps[OPMODE_DPS] = "smart"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT_COOL)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.HEAT, HVACMode.COOL, HVACMode.HEAT_COOL],
-        )
-
-    async def test_turn_on_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, OPMODE_DPS: "warm"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_on_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, OPMODE_DPS: "cool"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    async def test_turn_on_smart(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True, OPMODE_DPS: "smart"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT_COOL)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = False
-        self.assertEqual(self.subject.preset_mode, "Silent")
-
-        self.dps[PRESET_DPS] = True
-        self.assertEqual(self.subject.preset_mode, "Boost")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Silent", "Boost"])
-
-    async def test_set_preset_mode_to_silent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: False},
-        ):
-            await self.subject.async_set_preset_mode("Silent")
-
-    async def test_set_preset_mode_to_boost(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: True},
-        ):
-            await self.subject.async_set_preset_mode("Boost")
-
-    def test_extra_state_attributes(self):
-        self.dps[OPMODE_DPS] = "smart"
-        self.dps[ERROR_DPS] = 3
-        self.dps[ERROR2_DPS] = 4
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "mode": "smart",
-                "error": 3,
-                "error_2": 4,
-            },
-        )

+ 0 - 172
tests/devices/test_gardenpac_heatpump.py

@@ -1,172 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import GARDENPAC_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-CURRENTTEMP_DPS = "102"
-UNITS_DPS = "103"
-POWERLEVEL_DPS = "104"
-OPMODE_DPS = "105"
-TEMPERATURE_DPS = "106"
-MINTEMP_DPS = "107"
-MAXTEMP_DPS = "108"
-ERROR_DPS = "115"
-ERROR2_DPS = "116"
-PRESET_DPS = "117"
-
-
-class TestGardenPACPoolHeatpump(
-    BasicBinarySensorTests,
-    BasicSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("gardenpac_heatpump.yaml", GARDENPAC_HEATPUMP_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=18,
-            max=45,
-        )
-        self.setUpBasicSensor(
-            POWERLEVEL_DPS,
-            self.entities.get("sensor_power_level"),
-            unit=PERCENTAGE,
-            device_class=SensorDeviceClass.POWER_FACTOR,
-            state_class="measurement",
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_water_flow"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(4, 0),
-        )
-        self.mark_secondary(["sensor_power_level", "binary_sensor_water_flow"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[ERROR_DPS] = 0
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-
-        self.dps[ERROR_DPS] = 4
-        self.assertEqual(self.subject.icon, "mdi:water-pump-off")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNITS_DPS] = False
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-        self.dps[UNITS_DPS] = True
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_minimum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MINTEMP_DPS] = 60
-        self.assertEqual(self.subject.min_temp, 60)
-
-    def test_maximum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MAXTEMP_DPS] = 115
-        self.assertEqual(self.subject.max_temp, 115)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = False
-        self.assertEqual(self.subject.preset_mode, "Silent")
-
-        self.dps[PRESET_DPS] = True
-        self.assertEqual(self.subject.preset_mode, "Smart")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Silent", "Smart"])
-
-    async def test_set_preset_mode_to_silent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: False},
-        ):
-            await self.subject.async_set_preset_mode("Silent")
-
-    async def test_set_preset_mode_to_smart(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: True},
-        ):
-            await self.subject.async_set_preset_mode("Smart")
-
-    def test_hvac_action(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[OPMODE_DPS] = "heating"
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-        self.dps[OPMODE_DPS] = "warm"
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 3
-        self.dps[ERROR2_DPS] = 4
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "error": 3,
-                "error_2": 4,
-            },
-        )

+ 0 - 244
tests/devices/test_goldair_dehumidifier.py

@@ -1,244 +0,0 @@
-from unittest.mock import ANY
-
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.light import ColorMode
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
-
-from ..const import DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import MultiBinarySensorTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import BasicNumberTests
-from ..mixins.sensor import MultiSensorTests
-from ..mixins.switch import BasicSwitchTests, SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-PRESET_DPS = "2"
-HUMIDITY_DPS = "4"
-AIRCLEAN_DPS = "5"
-FANMODE_DPS = "6"
-LOCK_DPS = "7"
-ERROR_DPS = "11"
-TIMER_DPS = "12"
-UNKNOWN101_DPS = "101"
-LIGHTOFF_DPS = "102"
-CURRENTTEMP_DPS = "103"
-CURRENTHUMID_DPS = "104"
-DEFROST_DPS = "105"
-
-PRESET_NORMAL = "0"
-PRESET_LOW = "1"
-PRESET_HIGH = "2"
-PRESET_DRY_CLOTHES = "3"
-
-ERROR_TANK = "Tank full or missing"
-
-
-class TestGoldairDehumidifier(
-    BasicLockTests,
-    BasicNumberTests,
-    BasicSwitchTests,
-    MultiBinarySensorTests,
-    MultiSensorTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("goldair_dehumidifier.yaml", DEHUMIDIFIER_PAYLOAD)
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(HVACMODE_DPS, self.subject)
-        self.fan = self.entities.get("fan")
-        # BasicLightTests mixin is not used here because the switch is inverted
-        self.light = self.entities.get("light_display")
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicSwitch(AIRCLEAN_DPS, self.entities.get("switch_air_clean"))
-        self.setUpBasicNumber(
-            TIMER_DPS,
-            self.entities.get("number_timer"),
-            max=24,
-            unit=UnitOfTime.HOURS,
-        )
-
-        self.setUpMultiSensors(
-            [
-                {
-                    "name": "sensor_current_temperature",
-                    "dps": CURRENTTEMP_DPS,
-                    "unit": UnitOfTemperature.CELSIUS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "state_class": "measurement",
-                },
-                {
-                    "name": "sensor_current_humidity",
-                    "dps": CURRENTHUMID_DPS,
-                    "unit": "%",
-                    "device_class": SensorDeviceClass.HUMIDITY,
-                    "state_class": "measurement",
-                },
-            ]
-        )
-        self.setUpMultiBinarySensors(
-            [
-                {
-                    "name": "binary_sensor_tank",
-                    "dps": ERROR_DPS,
-                    "device_class": BinarySensorDeviceClass.PROBLEM,
-                    "testdata": (8, 0),
-                },
-                {
-                    "name": "binary_sensor_defrost",
-                    "dps": DEFROST_DPS,
-                    "device_class": BinarySensorDeviceClass.COLD,
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "light_display",
-                "lock_child_lock",
-                "number_timer",
-                "binary_sensor_tank",
-                "binary_sensor_defrost",
-            ],
-        )
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 30)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity_in_humidifier(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.dps[HUMIDITY_DPS] = 45
-
-        self.assertEqual(self.subject.target_humidity, 45)
-
-    async def test_set_humidity_in_humidifier_rounds_up_to_5_percent(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 45},
-        ):
-            await self.subject.async_set_humidity(43)
-
-    async def test_set_humidity_in_humidifier_rounds_down_to_5_percent(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HUMIDITY_DPS: 40},
-        ):
-            await self.subject.async_set_humidity(42)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.assertEqual(self.subject.mode, "Normal")
-
-        self.dps[PRESET_DPS] = PRESET_LOW
-        self.assertEqual(self.subject.mode, "Low")
-
-        self.dps[PRESET_DPS] = PRESET_HIGH
-        self.assertEqual(self.subject.mode, "High")
-
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertEqual(self.subject.mode, "Dry clothes")
-
-        self.dps[PRESET_DPS] = None
-        self.assertEqual(self.subject.mode, None)
-
-    def test_fan_mode_reflects_dps_mode_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.dps[FANMODE_DPS] = "1"
-        self.assertEqual(self.fan.percentage, 50)
-
-        self.dps[FANMODE_DPS] = "3"
-        self.assertEqual(self.fan.percentage, 100)
-
-        self.dps[FANMODE_DPS] = None
-        self.assertEqual(self.fan.percentage, None)
-
-    async def test_set_fan_50_succeeds_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.fan._device,
-            {FANMODE_DPS: "1"},
-        ):
-            await self.fan.async_set_percentage(50)
-
-    async def test_set_fan_100_succeeds_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.fan._device,
-            {FANMODE_DPS: "3"},
-        ):
-            await self.fan.async_set_percentage(100)
-
-    async def test_set_fan_30_snaps_to_50_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.fan._device,
-            {FANMODE_DPS: "1"},
-        ):
-            await self.fan.async_set_percentage(30)
-
-    def test_light_supported_color_modes(self):
-        self.assertCountEqual(
-            self.light.supported_color_modes,
-            [ColorMode.ONOFF],
-        )
-
-    def test_light_color_mode(self):
-        self.assertEqual(self.light.color_mode, ColorMode.ONOFF)
-
-    def test_light_icon(self):
-        self.dps[LIGHTOFF_DPS] = False
-        self.assertEqual(self.light.icon, "mdi:led-on")
-
-        self.dps[LIGHTOFF_DPS] = True
-        self.assertEqual(self.light.icon, "mdi:led-off")
-
-    def test_light_is_on(self):
-        self.dps[LIGHTOFF_DPS] = False
-        self.assertEqual(self.light.is_on, True)
-
-        self.dps[LIGHTOFF_DPS] = True
-        self.assertEqual(self.light.is_on, False)
-
-    def test_light_state_attributes(self):
-        self.assertEqual(self.light.extra_state_attributes, {})
-
-    async def test_light_turn_on(self):
-        self.dps[LIGHTOFF_DPS] = True
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: False}
-        ):
-            await self.light.async_turn_on()
-
-    async def test_light_turn_off(self):
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: True}
-        ):
-            await self.light.async_turn_off()
-
-    async def test_toggle_turns_the_light_on_when_it_was_off(self):
-        self.dps[LIGHTOFF_DPS] = True
-
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: False}
-        ):
-            await self.light.async_toggle()
-
-    async def test_toggle_turns_the_light_off_when_it_was_on(self):
-        self.dps[LIGHTOFF_DPS] = False
-
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: True}
-        ):
-            await self.light.async_toggle()
-
-    def test_switch_icon(self):
-        self.assertEqual(self.basicSwitch.icon, "mdi:air-purifier")

+ 0 - 157
tests/devices/test_goldair_gpcv_heater.py

@@ -1,157 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTime, UnitOfTemperature
-
-from ..const import GPCV_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import BasicNumberTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-LOCK_DPS = "2"
-TEMPERATURE_DPS = "3"
-CURRENTTEMP_DPS = "4"
-TIMER_DPS = "5"
-ERROR_DPS = "6"
-PRESET_DPS = "7"
-
-
-class TestGoldairGPCVHeater(
-    BasicBinarySensorTests,
-    BasicLockTests,
-    BasicNumberTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("goldair_gpcv_heater.yaml", GPCV_HEATER_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=15,
-            max=35,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicNumber(
-            TIMER_DPS,
-            self.entities.get("number_timer"),
-            max=24,
-            unit=UnitOfTime.HOURS,
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_error"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(1, 0),
-        )
-        self.mark_secondary(
-            ["lock_child_lock", "number_timer", "binary_sensor_error"],
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "Low"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Low")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "High"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="High")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "Low"
-        self.assertEqual(self.subject.preset_mode, "Low")
-
-        self.dps[PRESET_DPS] = "High"
-        self.assertEqual(self.subject.preset_mode, "High")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Low", "High"])
-
-    async def test_set_preset_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Low"},
-        ):
-            await self.subject.async_set_preset_mode("Low")
-
-    async def test_set_preset_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "High"},
-        ):
-            await self.subject.async_set_preset_mode("High")
-
-    def test_extra_state_attributes(self):
-        # There are currently no known error states; update this as
-        # they are discovered
-        self.dps[ERROR_DPS] = "something"
-        self.dps[TIMER_DPS] = 10
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"error": "something", "timer": 10},
-        )
-        self.dps[ERROR_DPS] = "0"
-        self.dps[TIMER_DPS] = 0
-        self.assertDictEqual(
-            self.subject.extra_state_attributes, {"error": "OK", "timer": 0}
-        )

+ 0 - 60
tests/devices/test_goldair_gpdh340_dehumidifier.py

@@ -1,60 +0,0 @@
-from ..const import GOLDAIR_GPDH340_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.switch import SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DP = "1"
-MODE_DP = "2"
-HUMIDITY_DP = "4"
-FAN_DP = "6"
-ERROR_DP = "11"
-CURRENTTEMP_DP = "103"
-CURRENTHUMID_DP = "104"
-MODEL_DP = "105"
-CHILDLOCK_DP = "106"
-DISPLAY_DP = "107"
-FILTERCLEAN_DP = "108"
-PUMP_DP = "109"
-
-
-class TestGPDH340Dehumidifier(SwitchableTests, TuyaDeviceTestCase):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "goldair_gpdh340_dehumidifier.yaml", GOLDAIR_GPDH340_PAYLOAD
-        )
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DP, self.subject)
-
-        self.mark_secondary(
-            [
-                "light_front_display",
-                "lock_child_lock",
-                "binary_sensor_tank",
-                "binary_sensor_fault",
-                "binary_sensor_filter_clean_required",
-            ]
-        )
-
-    def test_available_modes(self):
-        self.assertCountEqual(
-            self.subject.available_modes,
-            ["Sleeping space", "Living space", "Basement", "Continuous"],
-        )
-
-    def test_mode(self):
-        self.dps[MODE_DP] = "2"
-        self.assertEqual(self.subject.mode, "Custom")
-        self.dps[MODE_DP] = "4"
-        self.assertEqual(self.subject.mode, "Sleeping space")
-        self.dps[MODE_DP] = "5"
-        self.assertEqual(self.subject.mode, "Living space")
-        self.dps[MODE_DP] = "6"
-        self.assertEqual(self.subject.mode, "Basement")
-        self.dps[MODE_DP] = "7"
-        self.assertEqual(self.subject.mode, "Continuous")
-
-    async def test_async_set_mode(self):
-        async with assert_device_properties_set(self.subject._device, {MODE_DP: "6"}):
-            await self.subject.async_set_mode("Basement")

+ 0 - 338
tests/devices/test_hysen_hy08we2_thermostat.py

@@ -1,338 +0,0 @@
-from homeassistant.components.binary_sensor import (
-    BinarySensorDeviceClass,
-)
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.number.const import NumberDeviceClass
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
-
-from ..const import HYSEN_HY08WE2_THERMOSTAT_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import MultiNumberTests
-from ..mixins.select import MultiSelectTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-LOCK_DPS = "6"
-ERROR_DPS = "12"
-UNIT_DPS = "101"
-HVACACTION_DPS = "102"
-EXTTEMP_DPS = "103"
-HOLIDAYS_DPS = "104"
-HOLIDAYTEMP_DPS = "105"
-UNKNOWN106_DPS = "106"
-UNKNOWN107_DPS = "107"
-DISPLAY_DPS = "108"
-CALIBOFFSET_DPS = "109"
-CALIBSWINGINT_DPS = "110"
-CALIBSWINGEXT_DPS = "111"
-HIGHTEMP_DPS = "112"
-LOWTEMP_DPS = "113"
-MAXTEMP_DPS = "114"
-MINTEMP_DPS = "115"
-SENSOR_DPS = "116"
-INITIAL_DPS = "117"
-SCHED_DPS = "118"
-
-
-class TestHysenHY08WE2Thermostat(
-    BasicBinarySensorTests,
-    BasicLockTests,
-    BasicSensorTests,
-    MultiNumberTests,
-    MultiSelectTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "hysen_hy08we2_thermostat.yaml",
-            HYSEN_HY08WE2_THERMOSTAT_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5.0,
-            max=30.0,
-            scale=10,
-            step=5,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_fault"),
-            testdata=(1, 0),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-        )
-
-        self.setUpMultiSelect(
-            [
-                {
-                    "dps": SCHED_DPS,
-                    "name": "select_schedule",
-                    "options": {
-                        "2days": "5 + 2 day",
-                        "1days": "6 + 1 day",
-                        "0days": "7 day",
-                    },
-                },
-                {
-                    "dps": INITIAL_DPS,
-                    "name": "select_initial_state",
-                    "options": {
-                        "keep": "Previous",
-                        "on": "On",
-                        "off": "Off",
-                    },
-                },
-                {
-                    "dps": SENSOR_DPS,
-                    "name": "select_temperature_sensor",
-                    "options": {
-                        "in": "Internal",
-                        "ext": "External",
-                        "all": "Both",
-                    },
-                },
-                {
-                    "dps": UNIT_DPS,
-                    "name": "select_temperature_unit",
-                    "options": {
-                        False: "Celsius",
-                        True: "Fahrenheit",
-                    },
-                },
-            ],
-        )
-        self.setUpBasicSensor(
-            EXTTEMP_DPS,
-            self.entities.get("sensor_external_temperature"),
-            device_class=SensorDeviceClass.TEMPERATURE,
-            testdata=(205, 20.5),
-            unit=UnitOfTemperature.CELSIUS,
-            state_class="measurement",
-        )
-        self.setUpMultiNumber(
-            [
-                {
-                    "dps": HOLIDAYS_DPS,
-                    "name": "number_holiday_days",
-                    "min": 1,
-                    "max": 30,
-                    "unit": UnitOfTime.DAYS,
-                },
-                {
-                    "dps": HOLIDAYTEMP_DPS,
-                    "name": "number_holiday_temperature",
-                    "device_class": NumberDeviceClass.TEMPERATURE,
-                    "min": 5,
-                    "max": 30,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": CALIBOFFSET_DPS,
-                    "name": "number_calibration_offset",
-                    "min": -9,
-                    "max": 9,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": CALIBSWINGINT_DPS,
-                    "name": "number_calibration_swing_internal",
-                    "min": 0.5,
-                    "max": 2.5,
-                    "scale": 10,
-                    "step": 0.1,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": CALIBSWINGEXT_DPS,
-                    "name": "number_calibration_swing_external",
-                    "min": 0.1,
-                    "max": 1.0,
-                    "scale": 10,
-                    "step": 0.1,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": HIGHTEMP_DPS,
-                    "name": "number_high_temperature_protection",
-                    "device_class": NumberDeviceClass.TEMPERATURE,
-                    "min": 35,
-                    "max": 70,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": LOWTEMP_DPS,
-                    "name": "number_low_temperature_protection",
-                    "device_class": NumberDeviceClass.TEMPERATURE,
-                    "min": 1,
-                    "max": 10,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": MINTEMP_DPS,
-                    "name": "number_low_temperature_limit",
-                    "device_class": NumberDeviceClass.TEMPERATURE,
-                    "min": 1,
-                    "max": 10,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": MAXTEMP_DPS,
-                    "name": "number_high_temperature_limit",
-                    "device_class": NumberDeviceClass.TEMPERATURE,
-                    "min": 2,
-                    "max": 70,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-            ],
-        )
-        self.mark_secondary(
-            [
-                "binary_sensor_fault",
-                "lock_child_lock",
-                "number_holiday_days",
-                "number_holiday_temperature",
-                "number_calibration_offset",
-                "number_calibration_swing_internal",
-                "number_calibration_swing_external",
-                "number_high_temperature_protection",
-                "number_low_temperature_protection",
-                "number_low_temperature_limit",
-                "number_high_temperature_limit",
-                "select_initial_state",
-                "select_schedule",
-                "select_temperature_sensor",
-                "select_temperature_unit",
-            ],
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.TARGET_TEMPERATURE
-            ),
-        )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 685
-        self.assertEqual(self.subject.current_temperature, 68.5)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [
-                HVACMode.HEAT,
-                HVACMode.OFF,
-            ],
-        )
-
-    async def test_set_hvac_mode_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HVACMODE_DPS: True},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HVACMODE_DPS: False},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_hvac_action(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[HVACACTION_DPS] = True
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-        self.dps[HVACACTION_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Manual", "Program", "Program Override", "Holiday"],
-        )
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "Manual"
-        self.assertEqual(self.subject.preset_mode, "Manual")
-        self.dps[PRESET_DPS] = "Program"
-        self.assertEqual(self.subject.preset_mode, "Program")
-        self.dps[PRESET_DPS] = "TempProg"
-        self.assertEqual(self.subject.preset_mode, "Program Override")
-        self.dps[PRESET_DPS] = "Holiday"
-        self.assertEqual(self.subject.preset_mode, "Holiday")
-
-    # Override - since min and max are set by attributes, the range
-    # allowed when setting is wider than normal.  The thermostat seems
-    # to be configurable as at least a water heater (to 212F), as tuya
-    # doc says max 1000.0 (after scaling)
-    async def test_set_target_temperature_fails_outside_valid_range(self):
-        with self.assertRaisesRegex(
-            ValueError,
-            f"temperature \\(0\\) must be between 0.5 and 122.0",
-        ):
-            await self.subject.async_set_target_temperature(0)
-        with self.assertRaisesRegex(
-            ValueError,
-            f"temperature \\(122.5\\) must be between 0.5 and 122.0",
-        ):
-            await self.subject.async_set_target_temperature(122.5)
-
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 12
-        self.dps[UNKNOWN106_DPS] = False
-        self.dps[UNKNOWN107_DPS] = True
-        self.dps[DISPLAY_DPS] = True
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "fault_code": 12,
-                "unknown_106": False,
-                "unknown_107": True,
-                "temperature_display": "external",
-            },
-        )
-        self.dps[DISPLAY_DPS] = False
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "fault_code": 12,
-                "unknown_106": False,
-                "unknown_107": True,
-                "temperature_display": "internal",
-            },
-        )
-
-    def test_icons(self):
-        self.dps[LOCK_DPS] = True
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right-off")
-        self.dps[LOCK_DPS] = False
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right")

+ 0 - 180
tests/devices/test_hyundai_sahara_dehumidifier.py

@@ -1,180 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import PERCENTAGE, UnitOfTemperature
-
-from ..const import HYUNDAI_SAHARA_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.sensor import MultiSensorTests
-from ..mixins.switch import SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-HUMIDITY_DPS = "2"
-FAN_DPS = "4"
-CURRENTHUMID_DPS = "6"
-CURRENTTEMP_DPS = "7"
-MODE_DPS = "14"
-LOCK_DPS = "16"
-ERROR_DPS = "19"
-
-
-class TestHyundaiSaharaDehumidifier(
-    BasicBinarySensorTests,
-    BasicLockTests,
-    MultiSensorTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("hyundai_sahara_dehumidifier.yaml", HYUNDAI_SAHARA_PAYLOAD)
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.fan = self.entities.get("fan")
-        self.setUpBasicLock(
-            LOCK_DPS,
-            self.entities.get("lock_child_lock"),
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_tank"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(1, 0),
-        )
-        self.setUpMultiSensors(
-            [
-                {
-                    "dps": CURRENTHUMID_DPS,
-                    "name": "sensor_current_humidity",
-                    "device_class": SensorDeviceClass.HUMIDITY,
-                    "state_class": "measurement",
-                    "unit": PERCENTAGE,
-                },
-                {
-                    "dps": CURRENTTEMP_DPS,
-                    "name": "sensor_current_temperature",
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "state_class": "measurement",
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-            ]
-        )
-        self.mark_secondary(["binary_sensor_tank", "lock_child_lock"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            HumidifierEntityFeature.MODES,
-        )
-        self.assertEqual(
-            self.fan.supported_features,
-            FanEntityFeature.SET_SPEED,
-        )
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = False
-        self.dps[ERROR_DPS] = 0
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:power-sleep")
-
-        self.dps[ERROR_DPS] = 1
-        self.assertEqual(self.subject.icon, "mdi:cup-water")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 30)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_modes(self):
-        self.assertCountEqual(
-            self.subject.available_modes,
-            [
-                "Normal",
-                "Sleep",
-            ],
-        )
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = False
-        self.assertEqual(self.subject.mode, "Normal")
-        self.dps[MODE_DPS] = True
-        self.assertEqual(self.subject.mode, "Sleep")
-
-    async def test_set_mode_to_normal(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: False,
-            },
-        ):
-            await self.subject.async_set_mode("Normal")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_sleep(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: True,
-            },
-        ):
-            await self.subject.async_set_mode("Sleep")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_speed_steps(self):
-        self.assertEqual(self.fan.speed_count, 2)
-
-    def test_fan_speed(self):
-        self.dps[FAN_DPS] = "low"
-        self.assertEqual(self.fan.percentage, 50)
-        self.dps[FAN_DPS] = "high"
-        self.assertEqual(self.fan.percentage, 100)
-
-    async def test_fan_set_speed_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "low",
-            },
-        ):
-            await self.fan.async_set_percentage(50)
-
-    async def test_fan_set_speed_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "high",
-            },
-        ):
-            await self.fan.async_set_percentage(100)

+ 0 - 191
tests/devices/test_ips_pro_heatpump.py

@@ -1,191 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import IPS_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-CURRENTTEMP_DPS = "102"
-UNITS_DPS = "103"
-POWERLEVEL_DPS = "104"
-OPMODE_DPS = "105"
-TEMPERATURE_DPS = "106"
-MINTEMP_DPS = "107"
-MAXTEMP_DPS = "108"
-ERROR_DPS = "115"
-ERROR2_DPS = "116"
-PRESET_DPS = "2"
-POWER_DPS = "142"
-UNKNOWN143_DPS = "143"
-
-
-class TestIpsProHeatpump(
-    BasicBinarySensorTests,
-    BasicSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("ips_pro_heatpump.yaml", IPS_HEATPUMP_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=18,
-            max=40,
-        )
-        self.setUpBasicSensor(
-            POWERLEVEL_DPS,
-            self.entities.get("sensor_power_level"),
-            unit=PERCENTAGE,
-            device_class=SensorDeviceClass.POWER_FACTOR,
-            state_class="measurement",
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_water_flow"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(4, 0),
-        )
-        self.mark_secondary(
-            ["sensor_power_level", "binary_sensor_water_flow", "sensor_power"]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNITS_DPS] = False
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.FAHRENHEIT,
-        )
-        self.dps[UNITS_DPS] = True
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.CELSIUS,
-        )
-
-    def test_minimum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MINTEMP_DPS] = 60
-        self.assertEqual(self.subject.min_temp, 60)
-
-    def test_maximum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MAXTEMP_DPS] = 115
-        self.assertEqual(self.subject.max_temp, 115)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.HEAT],
-        )
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "silence"
-        self.assertEqual(self.subject.preset_mode, "silence")
-
-        self.dps[PRESET_DPS] = "smart"
-        self.assertEqual(self.subject.preset_mode, "smart")
-
-        self.dps[PRESET_DPS] = "turbo"
-        self.assertEqual(self.subject.preset_mode, "turbo")
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["silence", "smart", "turbo"],
-        )
-
-    async def test_set_preset_mode_to_silent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "silence"},
-        ):
-            await self.subject.async_set_preset_mode("silence")
-
-    async def test_set_preset_mode_to_smart(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "smart"},
-        ):
-            await self.subject.async_set_preset_mode("smart")
-
-    async def test_set_preset_mode_to_turbo(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "turbo"},
-        ):
-            await self.subject.async_set_preset_mode("turbo")
-
-    def test_hvac_action(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[OPMODE_DPS] = "heating"
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-        self.dps[OPMODE_DPS] = "warm"
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 3
-        self.dps[ERROR2_DPS] = 4
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "error": 3,
-                "error_2": 4,
-            },
-        )

+ 0 - 256
tests/devices/test_jjpro_jpd01_dehumidifier.py

@@ -1,256 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTime,
-    UnitOfTemperature,
-)
-from ..const import JJPRO_JPD01_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import MultiBinarySensorTests
-from ..mixins.number import BasicNumberTests
-from ..mixins.sensor import MultiSensorTests
-from ..mixins.switch import MultiSwitchTests, SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-MODE_DPS = "2"
-HUMIDITY_DPS = "4"
-ANION_DPS = "5"
-FAN_DPS = "6"
-ERROR_DPS = "11"
-TIMER_DPS = "12"
-UNKNOWN101_DPS = "101"
-SLEEP_DPS = "102"
-CURRENTTEMP_DPS = "103"
-CURRENTHUMID_DPS = "104"
-DEFROST_DPS = "105"
-
-
-class TestJJProJPD01Dehumidifier(
-    BasicNumberTests,
-    MultiBinarySensorTests,
-    MultiSensorTests,
-    MultiSwitchTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("jjpro_jpd01_dehumidifier.yaml", JJPRO_JPD01_PAYLOAD)
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.fan = self.entities.get("fan")
-        self.setUpBasicNumber(
-            TIMER_DPS,
-            self.entities.get("number_timer"),
-            max=24,
-            unit=UnitOfTime.HOURS,
-        )
-        self.setUpMultiBinarySensors(
-            [
-                {
-                    "dps": ERROR_DPS,
-                    "name": "binary_sensor_tank",
-                    "device_class": BinarySensorDeviceClass.PROBLEM,
-                    "testdata": (1, 0),
-                },
-                {
-                    "dps": DEFROST_DPS,
-                    "name": "binary_sensor_defrost",
-                    "device_class": BinarySensorDeviceClass.COLD,
-                },
-            ]
-        )
-        self.setUpMultiSensors(
-            [
-                {
-                    "dps": CURRENTHUMID_DPS,
-                    "name": "sensor_current_humidity",
-                    "device_class": SensorDeviceClass.HUMIDITY,
-                    "state_class": "measurement",
-                    "unit": PERCENTAGE,
-                },
-                {
-                    "dps": CURRENTTEMP_DPS,
-                    "name": "sensor_current_temperature",
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "state_class": "measurement",
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-            ]
-        )
-        self.setUpMultiSwitch(
-            [
-                {
-                    "dps": SLEEP_DPS,
-                    "name": "switch_sleep",
-                },
-                {
-                    "dps": ANION_DPS,
-                    "name": "switch_ionizer",
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "binary_sensor_tank",
-                "binary_sensor_defrost",
-                "number_timer",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES)
-        self.assertEqual(self.fan.supported_features, FanEntityFeature.SET_SPEED)
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[ANION_DPS] = False
-        self.dps[SLEEP_DPS] = False
-        self.dps[DEFROST_DPS] = False
-        self.dps[MODE_DPS] = "0"
-        self.assertEqual(self.subject.icon, "mdi:water-outline")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-        self.dps[MODE_DPS] = "1"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:water-plus-outline")
-        self.dps[MODE_DPS] = "2"
-        self.assertEqual(self.subject.icon, "mdi:tshirt-crew-outline")
-        self.dps[MODE_DPS] = "3"
-        self.assertEqual(self.subject.icon, "mdi:tailwind")
-        self.dps[ERROR_DPS] = 8
-        self.assertEqual(self.subject.icon, "mdi:cup-water")
-        self.dps[DEFROST_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:cup-water")
-        self.dps[ERROR_DPS] = 0
-        self.assertEqual(self.subject.icon, "mdi:snowflake-melt")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 30)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_modes(self):
-        self.assertCountEqual(
-            self.subject.available_modes,
-            [
-                "Normal",
-                "Continuous",
-                "Strong",
-                "Ventilation",
-            ],
-        )
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "0"
-        self.assertEqual(self.subject.mode, "Normal")
-        self.dps[MODE_DPS] = "1"
-        self.assertEqual(self.subject.mode, "Continuous")
-        self.dps[MODE_DPS] = "2"
-        self.assertEqual(self.subject.mode, "Strong")
-        self.dps[MODE_DPS] = "3"
-        self.assertEqual(self.subject.mode, "Ventilation")
-
-    async def test_set_mode_to_normal(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "0",
-            },
-        ):
-            await self.subject.async_set_mode("Normal")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_continuous(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "1",
-            },
-        ):
-            await self.subject.async_set_mode("Continuous")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_strong(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "2",
-            },
-        ):
-            await self.subject.async_set_mode("Strong")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_ventilation(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "3",
-            },
-        ):
-            await self.subject.async_set_mode("Ventilation")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_speed_steps(self):
-        self.assertEqual(self.fan.speed_count, 2)
-
-    def test_fan_speed(self):
-        self.dps[FAN_DPS] = "1"
-        self.assertEqual(self.fan.percentage, 50)
-        self.dps[FAN_DPS] = "3"
-
-    async def test_fan_set_speed_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "1",
-            },
-        ):
-            await self.fan.async_set_percentage(50)
-
-    async def test_fan_set_speed_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                FAN_DPS: "3",
-            },
-        ):
-            await self.fan.async_set_percentage(100)
-
-    def test_extra_state_attributes(self):
-        self.dps[UNKNOWN101_DPS] = True
-        self.dps[ERROR_DPS] = 5
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "error": 5,
-                "unknown_101": True,
-            },
-        )
-        self.assertEqual(self.fan.extra_state_attributes, {})

+ 0 - 241
tests/devices/test_kogan_dehumidifier.py

@@ -1,241 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import PERCENTAGE
-
-from ..const import KOGAN_DEHUMIDIFIER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.sensor import BasicSensorTests
-from ..mixins.switch import SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-MODE_DPS = "2"
-CURRENTHUMID_DPS = "3"
-SWING_DPS = "8"
-ERROR_DPS = "11"
-TIMER_DPS = "12"
-COUNTDOWN_DPS = "13"
-HUMIDITY_DPS = "101"
-
-
-class TestKoganDehumidifier(
-    BasicBinarySensorTests, BasicSensorTests, SwitchableTests, TuyaDeviceTestCase
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("kogan_dehumidifier.yaml", KOGAN_DEHUMIDIFIER_PAYLOAD)
-        self.subject = self.entities.get("humidifier")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.fan = self.entities.get("fan")
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_tank"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(1, 0),
-        )
-        self.setUpBasicSensor(
-            CURRENTHUMID_DPS,
-            self.entities.get("sensor_current_humidity"),
-            device_class=SensorDeviceClass.HUMIDITY,
-            state_class="measurement",
-            unit=PERCENTAGE,
-        )
-        self.mark_secondary(["binary_sensor_tank"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            HumidifierEntityFeature.MODES,
-        )
-        self.assertEqual(
-            self.fan.supported_features,
-            FanEntityFeature.OSCILLATE | FanEntityFeature.SET_SPEED,
-        )
-
-    def test_icon(self):
-        """Test that the icon is as expected."""
-        self.dps[SWITCH_DPS] = True
-        self.dps[MODE_DPS] = "low"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier")
-
-        self.dps[SWITCH_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[MODE_DPS] = "quickdry"
-        self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
-
-        self.dps[SWITCH_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:tshirt-crew-outline")
-
-        self.dps[ERROR_DPS] = 1
-        self.assertEqual(self.subject.icon, "mdi:cup-water")
-
-    def test_min_target_humidity(self):
-        self.assertEqual(self.subject.min_humidity, 0)
-
-    def test_max_target_humidity(self):
-        self.assertEqual(self.subject.max_humidity, 80)
-
-    def test_target_humidity(self):
-        self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.subject.target_humidity, 55)
-
-    async def test_fan_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: True}
-        ):
-            await self.fan.async_turn_on()
-
-    async def test_fan_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWITCH_DPS: False}
-        ):
-            await self.fan.async_turn_off()
-
-    def test_modes(self):
-        self.assertCountEqual(
-            self.subject.available_modes,
-            [
-                "Low",
-                "Medium",
-                "High",
-                "Dry Clothes",
-            ],
-        )
-
-    def test_mode(self):
-        self.dps[MODE_DPS] = "low"
-        self.assertEqual(self.subject.mode, "Low")
-        self.dps[MODE_DPS] = "middle"
-        self.assertEqual(self.subject.mode, "Medium")
-        self.dps[MODE_DPS] = "high"
-        self.assertEqual(self.subject.mode, "High")
-        self.dps[MODE_DPS] = "quickdry"
-        self.assertEqual(self.subject.mode, "Dry Clothes")
-
-    async def test_set_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "low",
-            },
-        ):
-            await self.subject.async_set_mode("Low")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_medium(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "middle",
-            },
-        ):
-            await self.subject.async_set_mode("Medium")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "high",
-            },
-        ):
-            await self.subject.async_set_mode("High")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_mode_to_clothes(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "quickdry",
-            },
-        ):
-            await self.subject.async_set_mode("Dry Clothes")
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_fan_speed_steps(self):
-        self.assertEqual(self.fan.speed_count, 3)
-
-    def test_fan_speed(self):
-        self.dps[MODE_DPS] = "low"
-        self.assertAlmostEqual(self.fan.percentage, 33.3, 1)
-        self.dps[MODE_DPS] = "middle"
-        self.assertAlmostEqual(self.fan.percentage, 66.7, 1)
-        self.dps[MODE_DPS] = "high"
-        self.assertEqual(self.fan.percentage, 100)
-        self.dps[MODE_DPS] = "quickdry"
-        self.assertEqual(self.fan.percentage, 100)
-
-    async def test_fan_set_speed_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "low",
-            },
-        ):
-            await self.fan.async_set_percentage(33)
-
-    async def test_fan_set_speed_to_medium(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "middle",
-            },
-        ):
-            await self.fan.async_set_percentage(66)
-
-    async def test_fan_set_speed_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                MODE_DPS: "high",
-            },
-        ):
-            await self.fan.async_set_percentage(100)
-
-    def test_fan_oscillating(self):
-        self.dps[SWING_DPS] = True
-        self.assertTrue(self.fan.oscillating)
-
-        self.dps[SWING_DPS] = False
-        self.assertFalse(self.fan.oscillating)
-
-    async def test_set_fan_oscillate_on(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                SWING_DPS: True,
-            },
-        ):
-            await self.fan.async_oscillate(True)
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_fan_oscillate_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                SWING_DPS: False,
-            },
-        ):
-            await self.fan.async_oscillate(False)
-            self.subject._device.anticipate_property_value.assert_not_called()
-
-    def test_extra_state_attributes(self):
-        self.dps[CURRENTHUMID_DPS] = 55
-        self.dps[ERROR_DPS] = 1
-        self.dps[TIMER_DPS] = 3
-        self.dps[COUNTDOWN_DPS] = 160
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "current_humidity": 55,
-                "error": "Tank full",
-                "timer_hr": 3,
-                "timer": 160,
-            },
-        )
-        self.assertEqual(self.fan.extra_state_attributes, {})

+ 0 - 134
tests/devices/test_kogan_kahtp_heater.py

@@ -1,134 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTime, UnitOfTemperature
-
-from ..const import KOGAN_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import BasicNumberTests
-from .base_device_tests import TuyaDeviceTestCase
-
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-LOCK_DPS = "6"
-HVACMODE_DPS = "7"
-TIMER_DPS = "8"
-
-
-class TestGoldairKoganKAHTPHeater(
-    BasicLockTests, BasicNumberTests, TargetTemperatureTests, TuyaDeviceTestCase
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("kogan_kahtp_heater.yaml", KOGAN_HEATER_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=15,
-            max=35,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicNumber(
-            TIMER_DPS,
-            self.entities.get("number_timer"),
-            max=1440,
-            unit=UnitOfTime.MINUTES,
-        )
-        self.mark_secondary(["lock_child_lock", "number_timer"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "Low"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Low")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "High"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="High")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "Low"
-        self.assertEqual(self.subject.preset_mode, "Low")
-
-        self.dps[PRESET_DPS] = "High"
-        self.assertEqual(self.subject.preset_mode, "High")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Low", "High"])
-
-    async def test_set_preset_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Low"},
-        ):
-            await self.subject.async_set_preset_mode("Low")
-
-    async def test_set_preset_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "High"},
-        ):
-            await self.subject.async_set_preset_mode("High")
-
-    def test_extra_state_attributes(self):
-        self.dps[TIMER_DPS] = 10
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"timer": 10},
-        )

+ 0 - 197
tests/devices/test_kogan_kashmfp20ba_heater.py

@@ -1,197 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.components.light import (
-    ColorMode,
-    LightEntityFeature,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import KOGAN_KASHMFP20BA_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-PRESET_DPS = "2"
-TEMPERATURE_DPS = "3"
-CURRENTTEMP_DPS = "4"
-BACKLIGHT_DPS = "5"
-FLAME_DPS = "6"
-
-
-class TestKoganKASHMF20BAHeater(TargetTemperatureTests, TuyaDeviceTestCase):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "kogan_kashmfp20ba_heater.yaml", KOGAN_KASHMFP20BA_HEATER_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=10,
-            max=30,
-        )
-        self.backlight = self.entities.get("light_backlight")
-        self.flame = self.entities.get("light_flame")
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE,
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "Low"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Low")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "High"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="High")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "low"
-        self.assertEqual(self.subject.preset_mode, "low")
-
-        self.dps[PRESET_DPS] = "high"
-        self.assertEqual(self.subject.preset_mode, "high")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["low", "high"])
-
-    async def test_set_preset_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "low"},
-        ):
-            await self.subject.async_set_preset_mode("low")
-
-    async def test_set_preset_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "high"},
-        ):
-            await self.subject.async_set_preset_mode("high")
-
-    def test_extra_state_attributes(self):
-        self.assertEqual(self.subject.extra_state_attributes, {})
-        self.assertEqual(self.backlight.extra_state_attributes, {})
-        self.assertEqual(self.flame.extra_state_attributes, {})
-
-    def test_lighting_supported_color_modes(self):
-        self.assertCountEqual(self.backlight.supported_color_modes, [])
-        self.assertCountEqual(self.flame.supported_color_modes, [])
-
-    def test_lighting_supported_features(self):
-        self.assertEqual(self.backlight.supported_features, LightEntityFeature.EFFECT)
-        self.assertEqual(self.flame.supported_features, LightEntityFeature.EFFECT)
-
-    def test_lighting_color_mode(self):
-        self.assertEqual(self.backlight.color_mode, ColorMode.UNKNOWN)
-        self.assertEqual(self.flame.color_mode, ColorMode.UNKNOWN)
-
-    def test_lighting_is_on(self):
-        self.assertTrue(self.backlight.is_on)
-        self.assertTrue(self.flame.is_on)
-
-    def test_lighting_brightness(self):
-        self.assertIsNone(self.backlight.brightness)
-        self.assertIsNone(self.flame.brightness)
-
-    def test_backlight_effect_list(self):
-        self.assertCountEqual(
-            self.backlight.effect_list,
-            [
-                "white",
-                "blue",
-                "orange",
-                "whiteblue",
-                "whiteorange",
-                "blueorange",
-            ],
-        )
-
-    def test_flame_effect_list(self):
-        self.assertCountEqual(
-            self.flame.effect_list,
-            [
-                "orange",
-                "red",
-                "green",
-                "blue",
-                "redgreen",
-                "redblue",
-                "bluegreen",
-                "redorange",
-                "greenorange",
-                "blueorange",
-            ],
-        )
-
-    def test_backlight_effect(self):
-        self.dps[BACKLIGHT_DPS] = "orange"
-        self.assertEqual(self.backlight.effect, "orange")
-
-    def test_flame_effect(self):
-        self.dps[FLAME_DPS] = "bluegreen"
-        self.assertEqual(self.flame.effect, "bluegreen")
-
-    async def test_set_backlight_effect(self):
-        async with assert_device_properties_set(
-            self.backlight._device,
-            {BACKLIGHT_DPS: "whiteblue"},
-        ):
-            await self.backlight.async_turn_on(effect="whiteblue")
-
-    async def test_set_flame_effect(self):
-        async with assert_device_properties_set(
-            self.flame._device,
-            {FLAME_DPS: "red"},
-        ):
-            await self.flame.async_turn_on(effect="red")

+ 0 - 134
tests/devices/test_kogan_kawfhtp_heater.py

@@ -1,134 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTime, UnitOfTemperature
-
-from ..const import KOGAN_KAWFHTP_HEATER_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import BasicNumberTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "3"
-CURRENTTEMP_DPS = "4"
-TIMER_DPS = "5"
-PRESET_DPS = "7"
-LOCK_DPS = "2"
-
-
-class TestGoldairKoganKAHTPHeater(
-    BasicLockTests,
-    BasicNumberTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("kogan_kawfhtp_heater.yaml", KOGAN_KAWFHTP_HEATER_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5,
-            max=40,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicNumber(
-            TIMER_DPS,
-            self.entities.get("number_timer"),
-            max=1440,
-            unit=UnitOfTime.MINUTES,
-        )
-        self.mark_secondary(["lock_child_lock", "number_timer"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "Low"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Low")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "High"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="High")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "Low"
-        self.assertEqual(self.subject.preset_mode, "Low")
-
-        self.dps[PRESET_DPS] = "High"
-        self.assertEqual(self.subject.preset_mode, "High")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Low", "High"])
-
-    async def test_set_preset_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Low"},
-        ):
-            await self.subject.async_set_preset_mode("Low")
-
-    async def test_set_preset_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "High"},
-        ):
-            await self.subject.async_set_preset_mode("High")
-
-    def test_extra_state_attributes(self):
-        self.dps[TIMER_DPS] = 10
-        self.assertDictEqual(self.subject.extra_state_attributes, {"timer": 10})

+ 0 - 258
tests/devices/test_madimack_elitev3_heatpump.py

@@ -1,258 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import MADIMACK_ELITEV3_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.sensor import MultiSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-HVACMODE_DPS = "2"
-TEMPERATURE_DPS = "4"
-PRESET_DPS = "5"
-UNIT_DPS = "6"
-UNKNOWN15_DPS = "15"
-PWRLEVEL_DPS = "20"
-TEMPMAX_DPS = "21"
-TEMPMIN_DPS = "22"
-COILTEMP_DPS = "23"
-EXHAUSTTEMP_DPS = "24"
-OUTLETTEMP_DPS = "25"
-AMBIENTTEMP_DPS = "26"
-UNKNOWN101_DPS = "101"
-CURRENTTEMP_DPS = "102"
-RETURNGASTEMP_DPS = "103"
-COOLCOILTEMP_DPS = "104"
-COOLPLATETEMP_DPS = "105"
-EEVOPENING_DPS = "106"
-UNKNOWN107_DPS = "107"
-
-
-class TestMadimackEliteV3Heatpump(
-    MultiSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "madimack_elite_v3_heatpump.yaml",
-            MADIMACK_ELITEV3_HEATPUMP_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=18,
-            max=40,
-        )
-        self.setUpMultiSensors(
-            [
-                {
-                    "name": "sensor_power_level",
-                    "dps": PWRLEVEL_DPS,
-                    "device_class": SensorDeviceClass.POWER_FACTOR,
-                    "unit": PERCENTAGE,
-                },
-                {
-                    "name": "sensor_evaporator_coil_pipe_temperature",
-                    "dps": COILTEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_exhaust_gas_temperature",
-                    "dps": EXHAUSTTEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_outlet_water_temperature",
-                    "dps": OUTLETTEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_ambient_temperature",
-                    "dps": AMBIENTTEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_return_gas_temperature",
-                    "dps": RETURNGASTEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_cooling_coil_pipe_temperature",
-                    "dps": COOLCOILTEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_cooling_plate_temperature",
-                    "dps": COOLPLATETEMP_DPS,
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "sensor_eev_opening",
-                    "dps": EEVOPENING_DPS,
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "sensor_power_level",
-                "sensor_evaporator_coil_pipe_temperature",
-                "sensor_exhaust_gas_temperature",
-                "sensor_outlet_water_temperature",
-                "sensor_ambient_temperature",
-                "sensor_return_gas_temperature",
-                "sensor_cooling_coil_pipe_temperature",
-                "sensor_cooling_plate_temperature",
-                "sensor_eev_opening",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.TARGET_TEMPERATURE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:refresh-auto")
-        self.dps[HVACMODE_DPS] = "cold"
-        self.assertEqual(self.subject.icon, "mdi:snowflake")
-        self.dps[HVACMODE_DPS] = "heating"
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNIT_DPS] = "c"
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-        self.dps[UNIT_DPS] = "f"
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-
-    def test_minimum_target_temperature(self):
-        self.dps[TEMPMIN_DPS] = 60
-        self.assertEqual(self.subject.min_temp, 60)
-
-    def test_maximum_target_temperature(self):
-        self.dps[TEMPMAX_DPS] = 104
-        self.assertEqual(self.subject.max_temp, 104)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACMODE_DPS] = "auto"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT_COOL)
-        self.dps[HVACMODE_DPS] = "cold"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-        self.dps[HVACMODE_DPS] = "heating"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.COOL, HVACMode.HEAT, HVACMode.HEAT_COOL],
-        )
-
-    async def test_set_hvac_mode_to_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: True, HVACMODE_DPS: "cold"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    async def test_set_hvac_mode_to_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: True, HVACMODE_DPS: "heating"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: True, HVACMODE_DPS: "auto"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT_COOL)
-
-    async def test_set_hvac_mode_to_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: False},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "silence"
-        self.assertEqual(self.subject.preset_mode, "Silence")
-        self.dps[PRESET_DPS] = "power"
-        self.assertEqual(self.subject.preset_mode, "Perfect")
-        self.dps[PRESET_DPS] = "boost"
-        self.assertEqual(self.subject.preset_mode, "Power")
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Silence", "Perfect", "Power"],
-        )
-
-    async def test_set_preset_to_silence(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "silence"},
-        ):
-            await self.subject.async_set_preset_mode("Silence")
-
-    async def test_set_preset_to_perfect(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "power"},
-        ):
-            await self.subject.async_set_preset_mode("Perfect")
-
-    async def test_set_preset_to_boost(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "boost"},
-        ):
-            await self.subject.async_set_preset_mode("Power")
-
-    def test_extra_state_attributes(self):
-        self.dps[UNKNOWN15_DPS] = 15
-        self.dps[UNKNOWN101_DPS] = 101
-        self.dps[UNKNOWN107_DPS] = True
-
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "unknown_15": 15,
-                "unknown_101": 101,
-                "unknown_107": True,
-            },
-        )

+ 0 - 268
tests/devices/test_madimack_heatpump.py

@@ -1,268 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
-
-from ..const import MADIMACK_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import MultiBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.sensor import MultiSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-CURRENTTEMP_DPS = "102"
-UNITS_DPS = "103"
-POWERLEVEL_DPS = "104"
-OPMODE_DPS = "105"
-TEMPERATURE_DPS = "106"
-MINTEMP_DPS = "107"
-MAXTEMP_DPS = "108"
-ERROR_DPS = "115"
-FAULT2_DPS = "116"
-PRESET_DPS = "117"
-UNKNOWN118_DPS = "118"
-COIL_DPS = "120"
-EXHAUST_DPS = "122"
-AMBIENT_DPS = "124"
-COMPRESSOR_DPS = "125"
-UNKNOWN126_DPS = "126"
-COOLINGPLATE_DPS = "127"
-EEV_DPS = "128"
-FANSPEED_DPS = "129"
-DEFROST_DPS = "130"
-UNKNOWN134_DPS = "134"
-UNKNOWN135_DPS = "135"
-UNKNOWN136_DPS = "136"
-UNKNOWN139_DPS = "139"
-UNKNOWN140_DPS = "140"
-
-
-class TestMadimackPoolHeatpump(
-    MultiBinarySensorTests,
-    MultiSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("madimack_heatpump.yaml", MADIMACK_HEATPUMP_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=18,
-            max=45,
-        )
-        self.setUpMultiBinarySensors(
-            [
-                {
-                    "dps": ERROR_DPS,
-                    "name": "binary_sensor_water_flow",
-                    "device_class": BinarySensorDeviceClass.PROBLEM,
-                    "testdata": (4, 0),
-                },
-                {
-                    "dps": DEFROST_DPS,
-                    "name": "binary_sensor_defrosting",
-                    "device_class": BinarySensorDeviceClass.COLD,
-                },
-            ]
-        )
-        self.setUpMultiSensors(
-            [
-                {
-                    "dps": POWERLEVEL_DPS,
-                    "name": "sensor_power_level",
-                    "device_class": SensorDeviceClass.POWER_FACTOR,
-                    "unit": PERCENTAGE,
-                },
-                {
-                    "dps": COIL_DPS,
-                    "name": "sensor_evaporator_coil_pipe_temperature",
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": EXHAUST_DPS,
-                    "name": "sensor_exhaust_gas_temperature",
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": AMBIENT_DPS,
-                    "name": "sensor_ambient_temperature",
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": COMPRESSOR_DPS,
-                    "name": "sensor_compressor_speed",
-                    "device_class": SensorDeviceClass.POWER_FACTOR,
-                    "unit": PERCENTAGE,
-                },
-                {
-                    "dps": COOLINGPLATE_DPS,
-                    "name": "sensor_cooling_plate_temperature",
-                    "device_class": SensorDeviceClass.TEMPERATURE,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "dps": EEV_DPS,
-                    "name": "sensor_eev_opening",
-                },
-                {
-                    "dps": FANSPEED_DPS,
-                    "name": "sensor_fan_speed",
-                },
-            ]
-        )
-        self.mark_secondary(
-            [
-                "sensor_power_level",
-                "sensor_ambient_temperature",
-                "sensor_compressor_speed",
-                "sensor_cooling_plate_temperature",
-                "sensor_evaporator_coil_pipe_temperature",
-                "sensor_eev_opening",
-                "sensor_exhaust_gas_temperature",
-                "sensor_fan_speed",
-                "binary_sensor_water_flow",
-                "binary_sensor_defrosting",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[ERROR_DPS] = 0
-        self.dps[DEFROST_DPS] = False
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-
-        self.dps[DEFROST_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:snowflake-melt")
-
-        self.dps[ERROR_DPS] = 4
-        self.assertEqual(self.subject.icon, "mdi:water-pump-off")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNITS_DPS] = False
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-        self.dps[UNITS_DPS] = True
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_minimum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MINTEMP_DPS] = 60
-        self.assertEqual(self.subject.min_temp, 60)
-
-    def test_maximum_fahrenheit_temperature(self):
-        self.dps[UNITS_DPS] = False
-        self.dps[MAXTEMP_DPS] = 115
-        self.assertEqual(self.subject.max_temp, 115)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = False
-        self.assertEqual(self.subject.preset_mode, "Silent")
-
-        self.dps[PRESET_DPS] = True
-        self.assertEqual(self.subject.preset_mode, "Boost")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(self.subject.preset_modes, ["Silent", "Boost"])
-
-    async def test_set_preset_mode_to_silent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: False},
-        ):
-            await self.subject.async_set_preset_mode("Silent")
-
-    async def test_set_preset_mode_to_boost(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: True},
-        ):
-            await self.subject.async_set_preset_mode("Boost")
-
-    def test_hvac_action(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[OPMODE_DPS] = "heating"
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-        self.dps[OPMODE_DPS] = "warm"
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 4
-        self.dps[FAULT2_DPS] = 4
-        self.dps[UNKNOWN118_DPS] = 5
-        self.dps[UNKNOWN126_DPS] = 10
-        self.dps[UNKNOWN134_DPS] = False
-        self.dps[UNKNOWN135_DPS] = True
-        self.dps[UNKNOWN136_DPS] = False
-        self.dps[UNKNOWN139_DPS] = True
-        self.dps[UNKNOWN140_DPS] = "test"
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "error": "Water Flow Protection",
-                "error_2": 4,
-                "unknown_118": 5,
-                "unknown_126": 10,
-                "unknown_134": False,
-                "unknown_135": True,
-                "unknown_136": False,
-                "unknown_139": True,
-                "unknown_140": "test",
-            },
-        )

+ 0 - 276
tests/devices/test_owon_pct513_thermostat.py

@@ -1,276 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-)
-
-from homeassistant.const import PRECISION_TENTHS, UnitOfTemperature
-
-from ..const import OWON_PCT513_THERMOSTAT_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.number import BasicNumberTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "2"
-TEMPERATURE_DPS = "16"
-TEMPF_DPS = "17"
-UNIT_DPS = "23"
-CURRENTTEMP_DPS = "24"
-CURRTEMPF_DPS = "29"
-CURRENTHUMID_DPS = "34"
-UNKNOWN45_DPS = "45"
-INSTALL_DPS = "107"
-TEMPC_DPS = "108"
-UNKNOWN109_DPS = "109"
-TEMPF2_DPS = "110"
-UNKNOWN111_DPS = "111"
-FAN_DPS = "115"
-UNKNOWN116_DPS = "116"
-SCHED_DPS = "119"
-PRESET_DPS = "120"
-DUTYCYCLE_DPS = "123"
-HVACACTION_DPS = "129"
-
-
-class TestOwonPCT513Thermostat(
-    BasicNumberTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "owon_pct513_thermostat.yaml", OWON_PCT513_THERMOSTAT_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=15.0,
-            max=45.0,
-            scale=100,
-            step=50,
-        )
-        self.setUpBasicNumber(
-            DUTYCYCLE_DPS,
-            self.entities.get("number_fan_runtime"),
-            max=55,
-            step=5,
-            unit="min",
-        )
-
-        self.mark_secondary(["number_fan_runtime"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.FAN_MODE
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.TARGET_TEMPERATURE
-            ),
-        )
-
-    def test_temperature_unit(self):
-        self.dps[UNIT_DPS] = "c"
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-        self.dps[UNIT_DPS] = "f"
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-
-    def test_precision(self):
-        self.assertEqual(self.subject.precision, PRECISION_TENTHS)
-
-    def test_current_temperature(self):
-        self.dps[UNIT_DPS] = "c"
-        self.dps[CURRENTTEMP_DPS] = 2100
-        self.assertEqual(self.subject.current_temperature, 21.00)
-        self.dps[UNIT_DPS] = "f"
-        self.dps[CURRTEMPF_DPS] = 82
-        self.assertEqual(self.subject.current_temperature, 82)
-
-    def test_current_humidity(self):
-        self.dps[CURRENTHUMID_DPS] = 50
-        self.assertEqual(self.subject.current_humidity, 50)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [
-                HVACMode.COOL,
-                HVACMode.HEAT,
-                HVACMode.HEAT_COOL,
-                HVACMode.OFF,
-            ],
-        )
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = "off"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-        self.dps[HVACMODE_DPS] = "cool"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-        self.dps[HVACMODE_DPS] = "heat"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-        self.dps[HVACMODE_DPS] = "auto"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT_COOL)
-        self.dps[HVACMODE_DPS] = "emergencyheat"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-    async def test_set_hvac_mode_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "off"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    async def test_set_hvac_mode_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "cool"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    async def test_set_hvac_mode_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "heat"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_heatcool(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "auto"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT_COOL)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "off"}
-        ):
-            await self.subject.async_turn_off()
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "auto"}
-        ):
-            await self.subject.async_turn_on()
-
-    def test_hvac_action(self):
-        self.dps[HVACACTION_DPS] = "coolfanon"
-        self.assertEqual(self.subject.hvac_action, HVACAction.COOLING)
-        self.dps[HVACACTION_DPS] = "alloff"
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-        self.dps[HVACACTION_DPS] = "fanon"
-        self.assertEqual(self.subject.hvac_action, HVACAction.FAN)
-        self.dps[HVACACTION_DPS] = "heatfanon"
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Manual", "Follow Schedule", "Temporary Hold", "Permanent Hold"],
-        )
-
-    def test_preset_mode(self):
-        self.dps[SCHED_DPS] = True
-        self.dps[PRESET_DPS] = "followschedule"
-        self.assertEqual(self.subject.preset_mode, "Follow Schedule")
-        self.dps[PRESET_DPS] = "temphold"
-        self.assertEqual(self.subject.preset_mode, "Temporary Hold")
-        self.dps[PRESET_DPS] = "permhold"
-        self.assertEqual(self.subject.preset_mode, "Permanent Hold")
-        self.dps[SCHED_DPS] = False
-        self.assertEqual(self.subject.preset_mode, "Manual")
-
-    async def test_set_preset_to_schedule(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                SCHED_DPS: True,
-                PRESET_DPS: "followschedule",
-            },
-        ):
-            await self.subject.async_set_preset_mode("Follow Schedule")
-
-    async def test_set_preset_to_temp_hold(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                SCHED_DPS: True,
-                PRESET_DPS: "temphold",
-            },
-        ):
-            await self.subject.async_set_preset_mode("Temporary Hold")
-
-    async def test_set_preset_to_perm_hold(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                SCHED_DPS: True,
-                PRESET_DPS: "permhold",
-            },
-        ):
-            await self.subject.async_set_preset_mode("Permanent Hold")
-
-    async def test_set_preset_to_manual(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                SCHED_DPS: False,
-            },
-        ):
-            await self.subject.async_set_preset_mode("Manual")
-
-    def test_fan_modes(self):
-        self.assertCountEqual(
-            self.subject.fan_modes,
-            ["on", "auto", "cycle"],
-        )
-
-    def test_fan_mode(self):
-        self.dps[FAN_DPS] = "on"
-        self.assertEqual(self.subject.fan_mode, "on")
-        self.dps[FAN_DPS] = "auto"
-        self.assertEqual(self.subject.fan_mode, "auto")
-        self.dps[FAN_DPS] = "cycle"
-        self.assertEqual(self.subject.fan_mode, "cycle")
-
-    async def test_set_fan_on(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "on"},
-        ):
-            await self.subject.async_set_fan_mode("on")
-
-    async def test_set_fan_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "auto"},
-        ):
-            await self.subject.async_set_fan_mode("auto")
-
-    async def test_set_fan_cycle(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "cycle"},
-        ):
-            await self.subject.async_set_fan_mode("cycle")
-
-    def test_extra_state_attributes(self):
-        self.dps[UNKNOWN45_DPS] = 45
-        self.dps[INSTALL_DPS] = "107"
-        self.dps[TEMPC_DPS] = 1080
-        self.dps[UNKNOWN109_DPS] = 109
-        self.dps[TEMPF2_DPS] = 110
-        self.dps[UNKNOWN111_DPS] = 111
-        self.dps[UNKNOWN116_DPS] = "116"
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "unknown_45": 45,
-                "installation": "107",
-                "temp_c": 10.8,
-                "unknown_109": 109,
-                "temp_f2": 110,
-                "unknown_111": 111,
-                "unknown_116": "116",
-            },
-        )

+ 0 - 171
tests/devices/test_poolex_silverline_heatpump.py

@@ -1,171 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import POOLEX_SILVERLINE_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-ERROR_DPS = "13"
-
-
-class TestPoolexSilverlineHeatpump(
-    BasicBinarySensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "poolex_silverline_heatpump.yaml", POOLEX_SILVERLINE_HEATPUMP_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=8,
-            max=40,
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_water_flow"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(256, 0),
-        )
-        self.mark_secondary(["binary_sensor_water_flow"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE,
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "Cool"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Cool")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "Heat"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="Heat")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "Heat"
-        self.assertEqual(self.subject.preset_mode, "Heat")
-
-        self.dps[PRESET_DPS] = "Cool"
-        self.assertEqual(self.subject.preset_mode, "Cool")
-
-        self.dps[PRESET_DPS] = "BoostHeat"
-        self.assertEqual(self.subject.preset_mode, "Boost Heat")
-
-        self.dps[PRESET_DPS] = "SilentHeat"
-        self.assertEqual(self.subject.preset_mode, "Silent Heat")
-        self.dps[PRESET_DPS] = "Auto"
-        self.assertEqual(self.subject.preset_mode, "Auto")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [
-                "Auto",
-                "Heat",
-                "Cool",
-                "Boost Heat",
-                "Silent Heat",
-            ],
-        )
-
-    async def test_set_preset_mode_to_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Heat"},
-        ):
-            await self.subject.async_set_preset_mode("Heat")
-
-    async def test_set_preset_mode_to_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Cool"},
-        ):
-            await self.subject.async_set_preset_mode("Cool")
-
-    async def test_set_preset_mode_to_boostheat(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "BoostHeat"},
-        ):
-            await self.subject.async_set_preset_mode("Boost Heat")
-
-    async def test_set_preset_mode_to_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Auto"},
-        ):
-            await self.subject.async_set_preset_mode("Auto")
-
-    def test_error_state(self):
-        self.dps[ERROR_DPS] = 0
-        self.assertEqual(self.subject.extra_state_attributes, {"error": "OK"})
-
-        self.dps[ERROR_DPS] = 256
-        self.assertEqual(
-            self.subject.extra_state_attributes,
-            {"error": "Water Flow Protection"},
-        )
-        self.dps[ERROR_DPS] = 2
-        self.assertEqual(
-            self.subject.extra_state_attributes,
-            {"error": 2},
-        )

+ 0 - 160
tests/devices/test_poolex_vertigo_heatpump.py

@@ -1,160 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import POOLEX_VERTIGO_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "4"
-ERROR_DPS = "9"
-
-
-class TestPoolexVertigoHeatpump(
-    BasicBinarySensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "poolex_vertigo_heatpump.yaml", POOLEX_VERTIGO_HEATPUMP_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=8,
-            max=40,
-        )
-        self.setUpBasicBinarySensor(
-            ERROR_DPS,
-            self.entities.get("binary_sensor_water_flow"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(4, 0),
-        )
-        self.mark_secondary(["binary_sensor_water_flow"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.icon, "mdi:hot-tub")
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:hvac-off")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: "cool"}
-        ):
-            await self.subject.async_set_temperature(preset_mode="Cool")
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device, {TEMPERATURE_DPS: 26, PRESET_DPS: "heat"}
-        ):
-            await self.subject.async_set_temperature(temperature=26, preset_mode="Heat")
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(self.subject.hvac_modes, [HVACMode.OFF, HVACMode.HEAT])
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: True}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: False}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "heat"
-        self.assertEqual(self.subject.preset_mode, "Heat")
-
-        self.dps[PRESET_DPS] = "cool"
-        self.assertEqual(self.subject.preset_mode, "Cool")
-
-        self.dps[PRESET_DPS] = "silent"
-        self.assertEqual(self.subject.preset_mode, "Silent")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [
-                "Heat",
-                "Cool",
-                "Silent",
-            ],
-        )
-
-    async def test_set_preset_mode_to_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "heat"},
-        ):
-            await self.subject.async_set_preset_mode("Heat")
-
-    async def test_set_preset_mode_to_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "cool"},
-        ):
-            await self.subject.async_set_preset_mode("Cool")
-
-    async def test_set_preset_mode_to_silent(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "silent"},
-        ):
-            await self.subject.async_set_preset_mode("Silent")
-
-    def test_error_state(self):
-        self.dps[ERROR_DPS] = 0
-        self.assertEqual(self.subject.extra_state_attributes, {"error": "OK"})
-
-        self.dps[ERROR_DPS] = 4
-        self.assertEqual(
-            self.subject.extra_state_attributes,
-            {"error": "Water Flow Protection"},
-        )
-        self.dps[ERROR_DPS] = 2
-        self.assertEqual(
-            self.subject.extra_state_attributes,
-            {"error": 2},
-        )

+ 0 - 225
tests/devices/test_purline_m100_heater.py

@@ -1,225 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-    SWING_OFF,
-    SWING_VERTICAL,
-)
-from homeassistant.components.light import ColorMode
-from homeassistant.const import UnitOfTemperature
-
-from ..const import PURLINE_M100_HEATER_PAYLOAD
-from ..helpers import (
-    assert_device_properties_set,
-    assert_device_properties_set_optional,
-)
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.switch import BasicSwitchTests
-from .base_device_tests import TuyaDeviceTestCase
-
-HVACMODE_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-PRESET_DPS = "5"
-LIGHTOFF_DPS = "10"
-TIMERHR_DPS = "11"
-TIMER_DPS = "12"
-SWITCH_DPS = "101"
-SWING_DPS = "102"
-
-
-class TestPulineM100Heater(
-    BasicSwitchTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("purline_m100_heater.yaml", PURLINE_M100_HEATER_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=15,
-            max=35,
-        )
-        # BasicLightTests mixin not used due to inverted switch
-        self.light = self.entities.get("light_display")
-        self.setUpBasicSwitch(
-            SWITCH_DPS, self.entities.get("switch_open_window_detector")
-        )
-        self.mark_secondary(["light_display", "switch_open_window_detector"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.SWING_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.icon, "mdi:radiator")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.icon, "mdi:radiator-disabled")
-
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.icon, "mdi:fan")
-
-    def test_temperature_unit_returns_celsius(self):
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.subject.current_temperature, 25)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.FAN_ONLY)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.HEAT, HVACMode.FAN_ONLY],
-        )
-
-    async def test_turn_on(self):
-        async with assert_device_properties_set_optional(
-            self.subject._device,
-            {HVACMODE_DPS: True},
-            {PRESET_DPS: "auto"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {HVACMODE_DPS: False},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    async def test_turn_on_fan(self):
-        async with assert_device_properties_set_optional(
-            self.subject._device,
-            {HVACMODE_DPS: True},
-            {PRESET_DPS: "off"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.FAN_ONLY)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "auto"
-        self.assertEqual(self.subject.preset_mode, "Auto")
-
-        self.dps[PRESET_DPS] = "off"
-        self.assertEqual(self.subject.preset_mode, "Fan")
-
-        self.dps[PRESET_DPS] = "4"
-        self.assertEqual(self.subject.preset_mode, "4")
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.subject.preset_mode, None)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Fan", "1", "2", "3", "4", "5", "Auto"],
-        )
-
-    async def test_set_preset_mode_numeric(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "3"},
-        ):
-            await self.subject.async_set_preset_mode("3")
-
-    def test_swing_mode(self):
-        self.dps[SWING_DPS] = True
-        self.assertEqual(self.subject.swing_mode, SWING_VERTICAL)
-
-        self.dps[SWING_DPS] = False
-        self.assertEqual(self.subject.swing_mode, SWING_OFF)
-
-    def test_swing_modes(self):
-        self.assertCountEqual(
-            self.subject.swing_modes,
-            [SWING_OFF, SWING_VERTICAL],
-        )
-
-    async def test_set_swing_mode_on(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWING_DPS: True}
-        ):
-            await self.subject.async_set_swing_mode(SWING_VERTICAL)
-
-    async def test_set_swing_mode_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {SWING_DPS: False}
-        ):
-            await self.subject.async_set_swing_mode(SWING_OFF)
-
-    def test_light_supported_color_modes(self):
-        self.assertCountEqual(
-            self.light.supported_color_modes,
-            [ColorMode.ONOFF],
-        )
-
-    def test_light_color_mode(self):
-        self.assertEqual(self.light.color_mode, ColorMode.ONOFF)
-
-    def test_light_icon(self):
-        self.dps[LIGHTOFF_DPS] = False
-        self.assertEqual(self.light.icon, "mdi:led-on")
-
-        self.dps[LIGHTOFF_DPS] = True
-        self.assertEqual(self.light.icon, "mdi:led-off")
-
-    def test_light_is_on(self):
-        self.dps[LIGHTOFF_DPS] = False
-        self.assertTrue(self.light.is_on)
-
-        self.dps[LIGHTOFF_DPS] = True
-        self.assertFalse(self.light.is_on)
-
-    def test_light_state_attributes(self):
-        self.assertEqual(self.light.extra_state_attributes, {})
-
-    async def test_light_turn_on(self):
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: False}
-        ):
-            await self.light.async_turn_on()
-
-    async def test_light_turn_off(self):
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: True}
-        ):
-            await self.light.async_turn_off()
-
-    async def test_toggle_turns_the_light_on_when_it_was_off(self):
-        self.dps[LIGHTOFF_DPS] = True
-
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: False}
-        ):
-            await self.light.async_toggle()
-
-    async def test_toggle_turns_the_light_off_when_it_was_on(self):
-        self.dps[LIGHTOFF_DPS] = False
-
-        async with assert_device_properties_set(
-            self.light._device, {LIGHTOFF_DPS: True}
-        ):
-            await self.light.async_toggle()

+ 0 - 285
tests/devices/test_saswell_c16_thermostat.py

@@ -1,285 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-    PRESET_AWAY,
-    PRESET_HOME,
-)
-from homeassistant.components.number.const import NumberDeviceClass
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfPower, UnitOfTemperature
-
-from ..const import SASWELL_C16_THERMOSTAT_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.number import MultiNumberTests
-from ..mixins.select import MultiSelectTests
-from ..mixins.sensor import BasicSensorTests
-from ..mixins.switch import BasicSwitchTests
-from .base_device_tests import TuyaDeviceTestCase
-
-TEMPERATURE_DPS = "2"
-PRESET_DPS = "3"
-UNKNOWN4_DPS = "4"
-CURRENTTEMP_DPS = "5"
-FLOORTEMPLIMIT_DPS = "6"
-INSTALL_DPS = "7"
-FLOORTEMP_DPS = "8"
-HVACMODE_DPS = "9"
-ADAPTIVE_DPS = "10"
-LOCK_DPS = "11"
-SCHED_DPS = "12"
-SENSOR_DPS = "14"
-ROOMCALIB_DPS = "15"
-FLOORCALIB_DPS = "17"
-UNKNOWN21_DPS = "21"
-POWERRATING_DPS = "22"
-UNKNOWN23_DPS = "23"
-HVACACTION_DPS = "24"
-UNKNOWN26_DPS = "26"
-
-
-class TestSaswellC16Thermostat(
-    BasicLockTests,
-    BasicSensorTests,
-    BasicSwitchTests,
-    MultiNumberTests,
-    MultiSelectTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "saswell_c16_thermostat.yaml", SASWELL_C16_THERMOSTAT_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5.0,
-            max=40.0,
-            scale=10,
-            step=5,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicSensor(
-            FLOORTEMP_DPS,
-            self.entities.get("sensor_floor_temperature"),
-            device_class=SensorDeviceClass.TEMPERATURE,
-            state_class="measurement",
-            unit=UnitOfTemperature.CELSIUS,
-            testdata=(218, 21.8),
-        )
-        self.setUpBasicSwitch(ADAPTIVE_DPS, self.entities.get("switch_adaptive"))
-        self.setUpMultiNumber(
-            [
-                {
-                    "name": "number_floor_temperature_limit",
-                    "dps": FLOORTEMPLIMIT_DPS,
-                    "device_class": NumberDeviceClass.TEMPERATURE,
-                    "min": 20.0,
-                    "max": 50.0,
-                    "scale": 10,
-                    "step": 0.5,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "number_power_rating",
-                    "dps": POWERRATING_DPS,
-                    "device_class": NumberDeviceClass.POWER,
-                    "max": 3500,
-                    "unit": UnitOfPower.WATT,
-                },
-                {
-                    "name": "number_room_temperature_calibration",
-                    "dps": ROOMCALIB_DPS,
-                    "min": -5.0,
-                    "max": 5.0,
-                    "scale": 10,
-                    "step": 0.5,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-                {
-                    "name": "number_floor_temperature_calibration",
-                    "dps": FLOORCALIB_DPS,
-                    "min": -5.0,
-                    "max": 5.0,
-                    "scale": 10,
-                    "step": 0.5,
-                    "unit": UnitOfTemperature.CELSIUS,
-                },
-            ]
-        )
-        self.setUpMultiSelect(
-            [
-                {
-                    "name": "select_installation",
-                    "dps": INSTALL_DPS,
-                    "options": {
-                        True: "Office",
-                        False: "Home",
-                    },
-                },
-                {
-                    "name": "select_schedule",
-                    "dps": SCHED_DPS,
-                    "options": {
-                        "5_1_1": "Weekdays+Sat+Sun",
-                        "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(
-            [
-                "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",
-            ]
-        )
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[PRESET_DPS] = "Smart"
-        self.assertEqual(self.subject.icon, "mdi:home-thermometer")
-        self.dps[PRESET_DPS] = "Manual"
-        self.assertEqual(self.subject.icon, "mdi:cursor-pointer")
-        self.dps[PRESET_DPS] = "Anti_frozen"
-        self.assertEqual(self.subject.icon, "mdi:snowflake-melt")
-        self.dps[LOCK_DPS] = True
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right-off")
-        self.dps[LOCK_DPS] = False
-        self.assertEqual(self.basicLock.icon, "mdi:hand-back-right")
-
-    def test_temperature_unit(self):
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.CELSIUS,
-        )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 250
-        self.assertEqual(self.subject.current_temperature, 25.0)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.COOL, HVACMode.HEAT],
-        )
-
-    async def test_set_hvac_mode_cool(self):
-        with self.assertRaises(TypeError):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    async def test_set_hvac_mode_heat(self):
-        with self.assertRaises(TypeError):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    def test_hvac_action(self):
-        self.dps[HVACACTION_DPS] = "Cooling"
-        self.assertEqual(self.subject.hvac_action, HVACAction.COOLING)
-
-        self.dps[HVACACTION_DPS] = "Heating"
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-
-        self.dps[HVACACTION_DPS] = "Standby"
-        self.assertEqual(self.subject.hvac_action, HVACAction.IDLE)
-
-    def test_preset_mode(self):
-        self.dps[PRESET_DPS] = "Smart"
-        self.assertEqual(self.subject.preset_mode, PRESET_HOME)
-        self.dps[PRESET_DPS] = "Manual"
-        self.assertEqual(self.subject.preset_mode, "manual")
-        self.dps[PRESET_DPS] = "Anti_frozen"
-        self.assertEqual(self.subject.preset_mode, PRESET_AWAY)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [PRESET_HOME, PRESET_AWAY, "manual"],
-        )
-
-    async def test_set_preset_to_away(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Anti_frozen"},
-        ):
-            await self.subject.async_set_preset_mode(PRESET_AWAY)
-
-    async def test_set_preset_to_home(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Smart"},
-        ):
-            await self.subject.async_set_preset_mode(PRESET_HOME)
-
-    async def test_set_preset_to_manual(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {PRESET_DPS: "Manual"},
-        ):
-            await self.subject.async_set_preset_mode("manual")
-
-    def test_extra_state_attributes(self):
-        self.dps[UNKNOWN4_DPS] = 4
-        self.dps[FLOORTEMPLIMIT_DPS] = 355
-        self.dps[INSTALL_DPS] = True
-        self.dps[FLOORTEMP_DPS] = 251
-        self.dps[ADAPTIVE_DPS] = False
-        self.dps[SCHED_DPS] = "5_1_1"
-        self.dps[UNKNOWN21_DPS] = True
-        self.dps[POWERRATING_DPS] = 2000
-        self.dps[UNKNOWN23_DPS] = 23
-        self.dps[UNKNOWN26_DPS] = 26
-
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "unknown_4": 4,
-                "floor_temp_limit": 35.5,
-                "installation": "Office",
-                "floor_temperature": 25.1,
-                "adaptive": False,
-                "schedule": "5_1_1",
-                "unknown_21": True,
-                "power_rating": 2000,
-                "unknown_23": 23,
-                "unknown_26": 26,
-            },
-        )

+ 0 - 268
tests/devices/test_saswell_t29utk_thermostat.py

@@ -1,268 +0,0 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-    FAN_AUTO,
-    FAN_ON,
-    PRESET_AWAY,
-    PRESET_HOME,
-)
-from homeassistant.const import UnitOfTemperature
-
-from ..const import SASWELL_T29UTK_THERMOSTAT_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.select import MultiSelectTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-HVACMODE_DPS = "4"
-FAN_DPS = "5"
-UNITS_DPS = "19"
-AWAY_DPS = "101"
-PROGRAM_DPS = "102"
-HVACACTION_DPS = "103"
-CONFIG_DPS = "112"
-UNKNOWN113_DPS = "113"
-TEMPC_DPS = "114"
-CURTEMPC_DPS = "115"
-TEMPF_DPS = "116"
-CURTEMPF_DPS = "117"
-
-
-class TestSaswellT29UTKThermostat(
-    MultiSelectTests, TargetTemperatureTests, TuyaDeviceTestCase
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "saswell_t29utk_thermostat.yaml", SASWELL_T29UTK_THERMOSTAT_PAYLOAD
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5.0,
-            max=35.0,
-            scale=10,
-            step=5,
-        )
-        self.setUpMultiSelect(
-            [
-                {
-                    "name": "select_temperature_unit",
-                    "dps": UNITS_DPS,
-                    "options": {
-                        "C": "Celsius",
-                        "F": "Fahrenheit",
-                    },
-                },
-                {
-                    "name": "select_configuration",
-                    "dps": CONFIG_DPS,
-                    "options": {
-                        "1": "cooling",
-                        "2": "heating",
-                        "3": "heat/cool",
-                        "5": "heatpump",
-                    },
-                },
-            ]
-        )
-        self.mark_secondary(["select_configuration", "select_temperature_unit"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.FAN_MODE
-                | ClimateEntityFeature.PRESET_MODE
-            ),
-        )
-
-    def test_icon(self):
-        self.dps[HVACMODE_DPS] = "cold"
-        self.assertEqual(self.subject.icon, "mdi:thermometer-minus")
-
-        self.dps[HVACMODE_DPS] = "hot"
-        self.assertEqual(self.subject.icon, "mdi:thermometer-plus")
-
-        self.dps[HVACMODE_DPS] = "off"
-        self.assertEqual(self.subject.icon, "mdi:thermometer-off")
-
-    def test_temperature_unit(self):
-        self.dps[UNITS_DPS] = "C"
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.CELSIUS)
-
-        self.dps[UNITS_DPS] = "F"
-        self.assertEqual(self.subject.temperature_unit, UnitOfTemperature.FAHRENHEIT)
-
-    def test_target_temperature_step_f(self):
-        self.dps[UNITS_DPS] = "F"
-        self.assertEqual(self.subject.target_temperature_step, 1)
-
-    def test_minimum_target_temperature_f(self):
-        self.dps[UNITS_DPS] = "F"
-        self.assertEqual(self.subject.min_temp, 41)
-
-    def test_maximum_target_temperature_f(self):
-        self.dps[UNITS_DPS] = "F"
-        self.assertEqual(self.subject.max_temp, 95)
-
-    async def test_set_target_temperature_f(self):
-        self.dps[UNITS_DPS] = "F"
-        async with assert_device_properties_set(
-            self.subject._device,
-            {TEMPERATURE_DPS: 740},
-        ):
-            await self.subject.async_set_target_temperature(74)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 250
-        self.assertEqual(self.subject.current_temperature, 25.0)
-
-    def test_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = "off"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-        self.dps[HVACMODE_DPS] = "cold"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-
-        self.dps[HVACMODE_DPS] = "hot"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.COOL, HVACMode.HEAT, HVACMode.OFF],
-        )
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "off"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    async def test_set_hvac_mode_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "cold"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    async def test_set_hvac_mode_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device, {HVACMODE_DPS: "hot"}
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_heat_fails_in_cooling_config(self):
-        self.dps[CONFIG_DPS] = "1"
-        with self.assertRaisesRegex(
-            AttributeError, "hvac_mode cannot be set at this time"
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_hvac_mode_cool_fails_in_heating_config(self):
-        self.dps[CONFIG_DPS] = "2"
-        with self.assertRaisesRegex(
-            AttributeError, "hvac_mode cannot be set at this time"
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    def test_hvac_action(self):
-        self.dps[POWER_DPS] = True
-        self.dps[HVACACTION_DPS] = "cold"
-        self.assertEqual(self.subject.hvac_action, HVACAction.COOLING)
-
-        self.dps[HVACACTION_DPS] = "hot"
-        self.assertEqual(self.subject.hvac_action, HVACAction.HEATING)
-
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.hvac_action, HVACAction.OFF)
-
-    def test_fan_mode(self):
-        self.dps[FAN_DPS] = "auto"
-        self.assertEqual(self.subject.fan_mode, FAN_AUTO)
-        self.dps[FAN_DPS] = "on"
-        self.assertEqual(self.subject.fan_mode, FAN_ON)
-
-    def test_fan_modes(self):
-        self.assertCountEqual(self.subject.fan_modes, [FAN_AUTO, FAN_ON])
-
-    async def test_set_fan_on(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "on"},
-        ):
-            await self.subject.async_set_fan_mode(FAN_ON)
-
-    async def test_set_fan_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {FAN_DPS: "auto"},
-        ):
-            await self.subject.async_set_fan_mode(FAN_AUTO)
-
-    def test_preset_mode(self):
-        self.dps[AWAY_DPS] = False
-        self.dps[PROGRAM_DPS] = False
-        self.assertEqual(self.subject.preset_mode, PRESET_HOME)
-        self.dps[PROGRAM_DPS] = True
-        self.assertEqual(self.subject.preset_mode, "Program")
-        self.dps[AWAY_DPS] = True
-        self.assertEqual(self.subject.preset_mode, PRESET_AWAY)
-        self.dps[PROGRAM_DPS] = False
-        self.assertEqual(self.subject.preset_mode, PRESET_AWAY)
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            [PRESET_HOME, PRESET_AWAY, "Program"],
-        )
-
-    async def test_set_preset_to_away(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {AWAY_DPS: True},
-        ):
-            await self.subject.async_set_preset_mode(PRESET_AWAY)
-
-    async def test_set_preset_to_home(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {AWAY_DPS: False, PROGRAM_DPS: False},
-        ):
-            await self.subject.async_set_preset_mode(PRESET_HOME)
-
-    async def test_set_preset_to_program(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {AWAY_DPS: False, PROGRAM_DPS: True},
-        ):
-            await self.subject.async_set_preset_mode("Program")
-
-    def test_extra_state_attributes(self):
-        self.dps[POWER_DPS] = True
-        self.dps[CONFIG_DPS] = "2"
-        self.dps[UNKNOWN113_DPS] = 113
-        self.dps[TEMPC_DPS] = 114
-        self.dps[CURTEMPC_DPS] = 115
-        self.dps[TEMPF_DPS] = 116
-        self.dps[CURTEMPF_DPS] = 117
-
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {
-                "power": True,
-                "configuration": "heating",
-                "unknown_113": 113,
-                "temperature_c": 114,
-                "current_temperature_c": 115,
-                "temperature_f": 116,
-                "current_temperature_f": 117,
-            },
-        )

+ 0 - 133
tests/devices/test_weau_pool_heatpump.py

@@ -1,133 +0,0 @@
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-
-from ..const import WEAU_POOL_HEATPUMP_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.climate import TargetTemperatureTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-MODE_DPS = "4"
-FAULT_DPS = "6"
-
-
-class TestWeauPoolHeatpump(
-    BasicBinarySensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("weau_pool_heatpump.yaml", WEAU_POOL_HEATPUMP_PAYLOAD)
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=7,
-            max=60,
-        )
-        self.setUpBasicBinarySensor(
-            FAULT_DPS,
-            self.entities.get("binary_sensor_fault"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-            testdata=(4, 0),
-        )
-        self.mark_secondary(["binary_sensor_fault"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE,
-        )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 194
-        self.assertEqual(self.subject.current_temperature, 19.4)
-
-    def test_hvac_mode(self):
-        self.dps[POWER_DPS] = True
-        self.dps[MODE_DPS] = "hot"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-        self.dps[MODE_DPS] = "cold"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.COOL)
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT_COOL)
-        self.dps[MODE_DPS] = "eco"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [HVACMode.OFF, HVACMode.COOL, HVACMode.HEAT, HVACMode.HEAT_COOL],
-        )
-
-    async def test_turn_off(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: False},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.OFF)
-
-    async def test_set_cool(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: True, MODE_DPS: "cold"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.COOL)
-
-    async def test_set_heat(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: True, MODE_DPS: "eco"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT)
-
-    async def test_set_auto(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {POWER_DPS: True, MODE_DPS: "auto"},
-        ):
-            await self.subject.async_set_hvac_mode(HVACMode.HEAT_COOL)
-
-    def test_preset_mode(self):
-        self.dps[MODE_DPS] = "eco"
-        self.assertEqual(self.subject.preset_mode, "Eco Heat")
-        self.dps[MODE_DPS] = "hot"
-        self.assertEqual(self.subject.preset_mode, "Boost Heat")
-        self.dps[MODE_DPS] = "cold"
-        self.assertEqual(self.subject.preset_mode, "Cool")
-        self.dps[MODE_DPS] = "auto"
-        self.assertEqual(self.subject.preset_mode, "Auto")
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.subject.preset_modes,
-            ["Eco Heat", "Boost Heat", "Cool", "Auto"],
-        )
-
-    async def test_set_preset_to_boost(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {MODE_DPS: "hot"},
-        ):
-            await self.subject.async_set_preset_mode("Boost Heat")
-
-    async def test_set_preset_to_eco(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {MODE_DPS: "eco"},
-        ):
-            await self.subject.async_set_preset_mode("Eco Heat")
-
-    def test_extra_state_attributes(self):
-        self.dps[FAULT_DPS] = 6
-        self.assertDictEqual(self.subject.extra_state_attributes, {"fault": 6})