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

BREAKING CHANGE: Remove deprecated entities.

As notified in 0.17.0 release notes, deprecated entities are to be removed in the next major release.  As there has been new features added and dependencies updated, the next release will be that major release.
Jason Rumney 3 лет назад
Родитель
Сommit
e64bbf14f5

+ 1 - 23
custom_components/tuya_local/devices/README.md

@@ -18,15 +18,6 @@ the brand and model of the device is a good choice.  If a whole family of
 devices is supported, a generalization of the model type can be used.
 The name should also indicate to the user what type of device it is.
 
-### `legacy_type`
-
-*Optional, deprecated.*
-
-The `legacy_type` is a transitional link back to an old name the device
-was known by.  It is used in the migration process to migrate old
-configs to the latest config which uses the config filename as the identifier
-for the device.  New devices should not define this.
-
 ### `products`
 
 *Optional, for future use.*
@@ -75,19 +66,6 @@ devices until now and may need to be extended for new devices.  In
 particular, the light and lock entities have only been used for simple
 secondary entities, so only basic functionality is implemented.
 
-### `deprecated`
-
-*Deprecated, DO NOT USE for new devices.*
-
-This is used to mark an entity as deprecated.  This is mainly
-for older devices that were implemented when only climate devices were
-supported, but are better represented in HA as fan or humidifier devices.
-This option will be removed in a future release, so do not use it in new
-devices.
-An entity should be moved to `secondary_entities` before being marked as
-deprecated, and the preferred device type moved to the `primary_entity`.
-The value of this should indicate what to use instead.
-
 ### `class`
 
 *Optional.*
@@ -446,7 +424,7 @@ Either **position** or **open** should be specified.
 ### fan
 - **switch** (optional, boolean): a dp to control the power state of the fan
 - **preset_mode** (optional, mapping of strings): a dp to control different modes of the fan.
-   Values `"off", low, medium, high` are handled specially by HA as deprecated speed aliases which will be removed in mid 2022.  Consider mapping these as **speed** values instead, as voice assistants will respond to phrases like "turn the fan up/down" for speed.
+   Values `"off", low, medium, high` used to be handled specially by HA as deprecated speed aliases.  If these are the only "presets", consider mapping them as **speed** values instead, as voice assistants will respond to phrases like "turn the fan up/down" for speed.
 - **speed** (optional, number 0-100): a dp to control the speed of the fan (%).
     scale and step can be used to convert smaller ranges to percentages, or a mapping for discrete values.
 - **oscillate** (optional, boolean): a dp to control whether the fan will oscillate or not.

+ 0 - 13
custom_components/tuya_local/devices/beca_bht002_thermostat_c.yaml

@@ -58,19 +58,6 @@ primary_entity:
       type: boolean
       name: unknown_104
 secondary_entities:
-  - entity: light
-    name: Display
-    category: config
-    deprecated: climate hvac_mode
-    dps:
-      - id: 1
-        type: boolean
-        name: switch
-        mapping:
-          - dps_val: true
-            icon: "mdi:led-on"
-          - dps_val: false
-            icon: "mdi:led-off"
   - entity: lock
     name: Child Lock
     category: config

+ 0 - 13
custom_components/tuya_local/devices/beca_bht6000_thermostat_c.yaml

@@ -61,19 +61,6 @@ primary_entity:
       type: boolean
       name: unknown_104
 secondary_entities:
-  - entity: light
-    deprecated: climate hvac_mode
-    name: Display
-    category: config
-    dps:
-      - id: 1
-        type: boolean
-        name: switch
-        mapping:
-          - dps_val: true
-            icon: "mdi:led-on"
-          - dps_val: false
-            icon: "mdi:led-off"
   - entity: lock
     name: Child Lock
     category: config

+ 0 - 56
custom_components/tuya_local/devices/eanons_humidifier.yaml

@@ -61,62 +61,6 @@ secondary_entities:
       - id: 10
         type: boolean
         name: switch
-  - entity: climate
-    deprecated: humidifier and fan
-    dps:
-      - id: 2
-        name: fan_mode
-        type: string
-        mapping:
-          - dps_val: small
-            value: low
-          - dps_val: middle
-            value: medium
-          - dps_val: large
-            value: high
-      - id: 3
-        name: timer_hr
-        type: string
-      - id: 4
-        name: timer_min
-        type: integer
-      - id: 9
-        name: error
-        type: integer
-        mapping:
-          - dps_val: 0
-            value: OK
-          - dps_val: 1
-            value: Water Level Low
-      - id: 10
-        name: hvac_mode
-        type: boolean
-        mapping:
-          - dps_val: false
-            value: "off"
-            icon: mdi:air-humidifier-off
-          - dps_val: true
-            value: "dry"
-            icon: mdi:air-humidifier
-      - id: 12
-        name: preset_mode
-        type: string
-        mapping:
-          - dps_val: sleep
-            value: sleep
-          - dps_val: humidity
-            value: auto
-          - dps_val: work
-            value: normal
-      - id: 15
-        name: humidity
-        type: integer
-        range:
-          min: 40
-          max: 90
-      - id: 16
-        name: current_humidity
-        type: integer
   - entity: switch
     name: "UV Sterilization"
     icon: "mdi:solar-power"

+ 0 - 112
custom_components/tuya_local/devices/goldair_dehumidifier.yaml

@@ -103,118 +103,6 @@ secondary_entities:
             conditions:
               - dps_val: "1"
                 invalid: true
-  - entity: climate
-    name: Dehumidifier as Climate
-    deprecated: humidifier and fan
-    dps:
-      - id: 1
-        type: boolean
-        name: hvac_mode
-        mapping:
-          - dps_val: False
-            value: "off"
-            icon: mdi:air-humidifier-off
-            icon_priority: 3
-          - dps_val: True
-            value: "dry"
-            icon: mdi:air-humidifier
-            icon_priority: 6
-      - id: 2
-        type: string
-        name: preset_mode
-        mapping:
-          - dps_val: "0"
-            constraint: air_clean_on
-            conditions:
-              - dps_val: true
-                value: "Air clean"
-              - dps_val: false
-                value: "Normal"
-          - dps_val: "1"
-            constraint: air_clean_on
-            conditions:
-              - dps_val: true
-                value: "Air clean"
-              - dps_val: false
-                value: "Low"
-          - dps_val: "2"
-            constraint: air_clean_on
-            conditions:
-              - dps_val: true
-                value: "Air clean"
-              - dps_val: false
-                value: "High"
-          - dps_val: "3"
-            constraint: air_clean_on
-            conditions:
-              - dps_val: true
-                value: "Air clean"
-              - dps_val: false
-                value: "Dry clothes"
-                icon: "mdi:tshirt-crew-outline"
-                icon_priority: 5
-      - id: 4
-        type: integer
-        name: humidity
-        range:
-          min: 30
-          max: 80
-        mapping:
-          - step: 5
-            constraint: preset_mode
-            conditions:
-              - dps_val: "1"
-                invalid: true
-              - dps_val: "2"
-                invalid: true
-              - dps_val: "3"
-                invalid: true
-      - id: 5
-        type: boolean
-        name: air_clean_on
-        mapping:
-          - dps_val: true
-            icon: "mdi:air-purifier"
-            icon_priority: 4
-      - id: 6
-        type: string
-        name: fan_mode
-        mapping:
-          - dps_val: "1"
-            value: "low"
-          - dps_val: "3"
-            value: "high"
-      - id: 11
-        type: bitfield
-        name: error
-        mapping:
-          - dps_val: 8
-            value: "Tank full or missing"
-            icon: "mdi:cup-water"
-            icon_priority: 1
-          - dps_val: 0
-            value: "OK"
-        readonly: true
-      - id: 101
-        type: boolean
-        name: unknown_101
-        readonly: true
-      - id: 103
-        type: integer
-        name: current_temperature
-        readonly: true
-      - id: 104
-        type: integer
-        name: current_humidity
-        readonly: true
-      - id: 105
-        type: boolean
-        name: defrosting
-        mapping:
-          - dps_val: true
-            icon: "mdi:snowflake-melt"
-            icon_priority: 2
-            readonly: true
   - entity: light
     name: Display
     category: config

+ 0 - 84
custom_components/tuya_local/devices/goldair_fan.yaml

@@ -37,90 +37,6 @@ primary_entity:
       type: string
       name: timer
 secondary_entities:
-  - entity: climate
-    deprecated: fan
-    dps:
-      - id: 1
-        type: boolean
-        mapping:
-          - dps_val: false
-            value: "off"
-            icon: "mdi:fan-off"
-          - dps_val: true
-            value: "fan_only"
-            icon: "mdi:fan"
-        name: hvac_mode
-      - id: 2
-        name: fan_mode
-        type: integer
-        mapping:
-          - constraint: preset_mode
-            conditions:
-              - dps_val: normal
-                mapping:
-                  - dps_val: 1
-                    value: 1
-                  - dps_val: 2
-                    value: 2
-                  - dps_val: 3
-                    value: 3
-                  - dps_val: 4
-                    value: 4
-                  - dps_val: 5
-                    value: 5
-                  - dps_val: 6
-                    value: 6
-                  - dps_val: 7
-                    value: 7
-                  - dps_val: 8
-                    value: 8
-                  - dps_val: 9
-                    value: 9
-                  - dps_val: 10
-                    value: 10
-                  - dps_val: 11
-                    value: 11
-                  - dps_val: 12
-                    value: 12                    
-              - dps_val: nature
-                step: 4
-                mapping:
-                  - dps_val: 4
-                    value: low
-                  - dps_val: 8
-                    value: medium
-                  - dps_val: 12
-                    value: high
-              - dps_val: sleep
-                step: 4
-                mapping:
-                  - dps_val: 4
-                    value: low
-                  - dps_val: 8
-                    value: medium
-                  - dps_val: 12
-                    value: high
-      - id: 3
-        type: string
-        mapping:
-          - dps_val: normal
-            value: normal
-          - dps_val: nature
-            value: eco
-          - dps_val: sleep
-            value: sleep
-        name: preset_mode
-      - id: 8
-        type: boolean
-        mapping:
-          - dps_val: false
-            value: "off"
-          - dps_val: true
-            value: "horizontal"
-        name: swing_mode
-      - id: 11
-        type: string
-        name: timer
   - entity: light
     name: Display
     category: config

+ 2 - 8
custom_components/tuya_local/translations/en.json

@@ -22,10 +22,7 @@
                 "title": "Device details",
                 "description": "Choose a name for this device, and which entities will be enabled",
                 "data": {
-                    "name": "Name",
-                    "climate": "Include a climate entity (deprecated, will be removed soon, use humidifier and fan instead)",
-                    "climate_dehumidifier_as_climate": "Include a climate entity for the dehumidifier (deprecated, will be removed soon, usehumidifier and fan instead)",
-                    "light_display": "Include display as a light entity (deprecated, will be removed soon, use the hvac_mode on the climate entity instead to turn the panel off)"
+                    "name": "Name"
                 }
             }
         },
@@ -44,10 +41,7 @@
                 "description": "[Follow these instructions to find your local key.](https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md)",
                 "data": {
                     "host": "IP address or hostname",
-                    "local_key": "Local key",
-                    "climate": "Include a climate entity (deprecated, will be removed soon, use humidifier and fan instead)",
-                    "climate_dehumidifier_as_climate": "Include a climate entity for the dehumidifier (deprecated, will be removed soon, usehumidifier and fan instead)",
-                    "light_display": "Include display as a light entity (deprecated, will be removed soon, use the hvac_mode on the climate entity instead to turn the panel off)"
+                    "local_key": "Local key"
                 }
             }
         },

+ 1 - 9
tests/devices/test_beca_bht002_thermostat.py

@@ -10,7 +10,6 @@ from homeassistant.const import TEMP_CELSIUS
 from ..const import BECA_BHT002_PAYLOAD
 from ..helpers import assert_device_properties_set
 from ..mixins.climate import TargetTemperatureTests
-from ..mixins.light import BasicLightTests
 from ..mixins.lock import BasicLockTests
 from ..mixins.sensor import BasicSensorTests
 from .base_device_tests import TuyaDeviceTestCase
@@ -26,7 +25,6 @@ UNKNOWN104_DPS = "104"
 
 
 class TestBecaBHT002Thermostat(
-    BasicLightTests,
     BasicLockTests,
     BasicSensorTests,
     TargetTemperatureTests,
@@ -47,7 +45,6 @@ class TestBecaBHT002Thermostat(
             max=35.0,
             scale=2,
         )
-        self.setUpBasicLight(POWER_DPS, self.entities.get("light_display"))
         self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
         self.setUpBasicSensor(
             FLOOR_DPS,
@@ -57,7 +54,7 @@ class TestBecaBHT002Thermostat(
             state_class="measurement",
             testdata=(30, 15),
         )
-        self.mark_secondary(["light_display", "lock_child_lock"])
+        self.mark_secondary(["lock_child_lock"])
 
     def test_supported_features(self):
         self.assertEqual(
@@ -127,11 +124,6 @@ class TestBecaBHT002Thermostat(
         )
 
     def test_icons(self):
-        self.dps[POWER_DPS] = True
-        self.assertEqual(self.basicLight.icon, "mdi:led-on")
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.basicLight.icon, "mdi:led-off")
-
         self.dps[LOCK_DPS] = True
         self.assertEqual(self.basicLock.icon, "mdi:hand-back-right-off")
         self.dps[LOCK_DPS] = False

+ 1 - 9
tests/devices/test_beca_bht6000_thermostat.py

@@ -10,7 +10,6 @@ from homeassistant.const import TEMP_CELSIUS
 from ..const import BECA_BHT6000_PAYLOAD
 from ..helpers import assert_device_properties_set
 from ..mixins.climate import TargetTemperatureTests
-from ..mixins.light import BasicLightTests
 from ..mixins.lock import BasicLockTests
 from ..mixins.sensor import BasicSensorTests
 from .base_device_tests import TuyaDeviceTestCase
@@ -27,7 +26,6 @@ UNKNOWN104_DPS = "104"
 
 
 class TestBecaBHT6000Thermostat(
-    BasicLightTests,
     BasicLockTests,
     BasicSensorTests,
     TargetTemperatureTests,
@@ -44,7 +42,6 @@ class TestBecaBHT6000Thermostat(
         self.setUpTargetTemperature(
             TEMPERATURE_DPS, self.subject, min=5.0, max=35.0, scale=2
         )
-        self.setUpBasicLight(POWER_DPS, self.entities.get("light_display"))
         self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
         self.setUpBasicSensor(
             FLOOR_DPS,
@@ -54,7 +51,7 @@ class TestBecaBHT6000Thermostat(
             state_class="measurement",
             testdata=(36, 18),
         )
-        self.mark_secondary(["light_display", "lock_child_lock"])
+        self.mark_secondary(["lock_child_lock"])
 
     def test_supported_features(self):
         self.assertEqual(
@@ -124,11 +121,6 @@ class TestBecaBHT6000Thermostat(
         )
 
     def test_icons(self):
-        self.dps[POWER_DPS] = True
-        self.assertEqual(self.basicLight.icon, "mdi:led-on")
-        self.dps[POWER_DPS] = False
-        self.assertEqual(self.basicLight.icon, "mdi:led-off")
-
         self.dps[LOCK_DPS] = True
         self.assertEqual(self.basicLock.icon, "mdi:hand-back-right-off")
         self.dps[LOCK_DPS] = False

+ 0 - 142
tests/devices/test_eanons_humidifier.py

@@ -1,11 +1,4 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    FAN_HIGH,
-    FAN_MEDIUM,
-    FAN_LOW,
-    HVACMode,
-)
 from homeassistant.components.fan import FanEntityFeature
 from homeassistant.components.humidifier import HumidifierEntityFeature
 from homeassistant.components.humidifier.const import (
@@ -47,7 +40,6 @@ class TestEanonsHumidifier(
         self.setUpForConfig("eanons_humidifier.yaml", EANONS_HUMIDIFIER_PAYLOAD)
         self.subject = self.entities.get("humidifier")
         self.setUpSwitchable(HVACMODE_DPS, self.subject)
-        self.climate = self.entities.get("climate")
         self.fan = self.entities.get("fan_intensity")
         self.setUpBasicSwitch(SWITCH_DPS, self.entities.get("switch_uv_sterilization"))
         self.setUpBasicSelect(
@@ -83,25 +75,9 @@ class TestEanonsHumidifier(
         self.mark_secondary(["select_timer", "sensor_timer", "binary_sensor_tank"])
 
     def test_supported_features(self):
-        self.assertEqual(
-            self.climate.supported_features,
-            (
-                ClimateEntityFeature.TARGET_HUMIDITY
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.FAN_MODE
-            ),
-        )
         self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES)
         self.assertEqual(self.fan.supported_features, FanEntityFeature.SET_SPEED)
 
-    def test_climate_icon_is_humidifier(self):
-        """Test that the icon is as expected."""
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.icon, "mdi:air-humidifier")
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.icon, "mdi:air-humidifier-off")
-
     def test_icon_is_humidifier(self):
         """Test that the icon is as expected."""
         self.dps[HVACMODE_DPS] = True
@@ -110,45 +86,16 @@ class TestEanonsHumidifier(
         self.dps[HVACMODE_DPS] = False
         self.assertEqual(self.subject.icon, "mdi:air-humidifier-off")
 
-    def test_current_humidity(self):
-        self.dps[CURRENTHUMID_DPS] = 47
-        self.assertEqual(self.climate.current_humidity, 47)
-
     def test_min_target_humidity(self):
-        self.assertEqual(self.climate.min_humidity, 40)
         self.assertEqual(self.subject.min_humidity, 40)
 
     def test_max_target_humidity(self):
-        self.assertEqual(self.climate.max_humidity, 90)
         self.assertEqual(self.subject.max_humidity, 90)
 
     def test_target_humidity(self):
         self.dps[HUMIDITY_DPS] = 55
-        self.assertEqual(self.climate.target_humidity, 55)
         self.assertEqual(self.subject.target_humidity, 55)
 
-    def test_climate_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.hvac_mode, HVACMode.DRY)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.hvac_mode, HVACMode.OFF)
-
-    def test_climate_hvac_modes(self):
-        self.assertCountEqual(self.climate.hvac_modes, [HVACMode.OFF, HVACMode.DRY])
-
-    async def test_climate_turn_on(self):
-        async with assert_device_properties_set(
-            self.climate._device, {HVACMODE_DPS: True}
-        ):
-            await self.climate.async_set_hvac_mode(HVACMode.DRY)
-
-    async def test_climate_turn_off(self):
-        async with assert_device_properties_set(
-            self.climate._device, {HVACMODE_DPS: False}
-        ):
-            await self.climate.async_set_hvac_mode(HVACMode.OFF)
-
     async def test_fan_turn_on(self):
         async with assert_device_properties_set(
             self.subject._device, {HVACMODE_DPS: True}
@@ -163,61 +110,23 @@ class TestEanonsHumidifier(
 
     def test_preset_mode(self):
         self.dps[PRESET_DPS] = "sleep"
-        self.assertEqual(self.climate.preset_mode, MODE_SLEEP)
         self.assertEqual(self.subject.mode, MODE_SLEEP)
 
         self.dps[PRESET_DPS] = "humidity"
-        self.assertEqual(self.climate.preset_mode, MODE_AUTO)
         self.assertEqual(self.subject.mode, MODE_AUTO)
 
         self.dps[PRESET_DPS] = "work"
-        self.assertEqual(self.climate.preset_mode, MODE_NORMAL)
         self.assertEqual(self.subject.mode, MODE_NORMAL)
 
         self.dps[PRESET_DPS] = None
-        self.assertEqual(self.climate.preset_mode, None)
         self.assertEqual(self.subject.mode, None)
 
     def test_preset_modes(self):
-        self.assertCountEqual(
-            self.climate.preset_modes,
-            [MODE_NORMAL, MODE_SLEEP, MODE_AUTO],
-        )
         self.assertCountEqual(
             self.subject.available_modes,
             [MODE_NORMAL, MODE_SLEEP, MODE_AUTO],
         )
 
-    async def test_set_climate_preset_to_auto(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: "humidity",
-            },
-        ):
-            await self.climate.async_set_preset_mode(MODE_AUTO)
-            self.climate._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_climate_preset_to_sleep(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: "sleep",
-            },
-        ):
-            await self.climate.async_set_preset_mode(MODE_SLEEP)
-            self.climate._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_climate_preset_to_normal(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: "work",
-            },
-        ):
-            await self.climate.async_set_preset_mode(MODE_NORMAL)
-            self.climate._device.anticipate_property_value.assert_not_called()
-
     async def test_set_mode_to_auto(self):
         async with assert_device_properties_set(
             self.subject._device,
@@ -248,31 +157,6 @@ class TestEanonsHumidifier(
             await self.subject.async_set_mode(MODE_NORMAL)
             self.subject._device.anticipate_property_value.assert_not_called()
 
-    def test_climate_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = 0
-        self.dps[TIMERHR_DPS] = "cancel"
-        self.dps[TIMER_DPS] = 0
-        self.assertDictEqual(
-            self.climate.extra_state_attributes,
-            {
-                "error": "OK",
-                "timer_hr": "cancel",
-                "timer_min": 0,
-            },
-        )
-
-        self.dps[ERROR_DPS] = 1
-        self.dps[TIMERHR_DPS] = "1"
-        self.dps[TIMER_DPS] = 60
-        self.assertDictEqual(
-            self.climate.extra_state_attributes,
-            {
-                "error": "Water Level Low",
-                "timer_hr": "1",
-                "timer_min": 60,
-            },
-        )
-
     def test_extra_state_attributes(self):
         self.dps[ERROR_DPS] = 0
         self.dps[TIMERHR_DPS] = "cancel"
@@ -300,31 +184,12 @@ class TestEanonsHumidifier(
         self.dps[FANMODE_DPS] = "large"
         self.assertEqual(self.fan.percentage, 100)
 
-    def test_climate_fan_mode(self):
-        self.dps[FANMODE_DPS] = "small"
-        self.assertEqual(self.climate.fan_mode, FAN_LOW)
-
-        self.dps[FANMODE_DPS] = "middle"
-        self.assertEqual(self.climate.fan_mode, FAN_MEDIUM)
-
-        self.dps[FANMODE_DPS] = "large"
-        self.assertEqual(self.climate.fan_mode, FAN_HIGH)
-
-        self.dps[FANMODE_DPS] = None
-        self.assertEqual(self.climate.fan_mode, None)
-
     def test_fan_speed_count(self):
         self.assertEqual(self.fan.speed_count, 3)
 
     def test_fan_percentage_step(self):
         self.assertAlmostEqual(self.fan.percentage_step, 33, 0)
 
-    def test_climate_fan_modes(self):
-        self.assertCountEqual(
-            self.climate.fan_modes,
-            [FAN_LOW, FAN_MEDIUM, FAN_HIGH],
-        )
-
     async def test_fan_set_speed(self):
         async with assert_device_properties_set(
             self.fan._device,
@@ -338,10 +203,3 @@ class TestEanonsHumidifier(
             {FANMODE_DPS: "middle"},
         ):
             await self.fan.async_set_percentage(60)
-
-    async def test_climate_set_fan_mode(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {FANMODE_DPS: "small"},
-        ):
-            await self.climate.async_set_fan_mode(FAN_LOW)

+ 0 - 299
tests/devices/test_goldair_dehumidifier.py

@@ -1,12 +1,6 @@
 from unittest.mock import ANY
 
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    FAN_HIGH,
-    FAN_LOW,
-    HVACMode,
-)
 from homeassistant.components.light import ColorMode
 from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.const import TEMP_CELSIUS, TIME_HOURS
@@ -58,7 +52,6 @@ class TestGoldairDehumidifier(
         self.subject = self.entities.get("humidifier")
         self.setUpSwitchable(HVACMODE_DPS, self.subject)
         self.fan = self.entities.get("fan")
-        self.climate = self.entities.get("climate_dehumidifier_as_climate")
         # 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"))
@@ -113,128 +106,18 @@ class TestGoldairDehumidifier(
             ],
         )
 
-    def test_supported_features(self):
-        self.assertEqual(
-            self.climate.supported_features,
-            (
-                ClimateEntityFeature.TARGET_HUMIDITY
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.FAN_MODE
-            ),
-        )
-
-    def test_icon_is_always_standard_when_off_without_error(self):
-        self.dps[ERROR_DPS] = None
-        self.dps[HVACMODE_DPS] = False
-
-        self.dps[AIRCLEAN_DPS] = False
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertEqual(self.climate.icon, "mdi:air-humidifier-off")
-
-        self.dps[AIRCLEAN_DPS] = True
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.assertEqual(self.climate.icon, "mdi:air-humidifier-off")
-
-    def test_icon_is_purifier_when_air_clean_is_active(self):
-        self.dps[ERROR_DPS] = None
-        self.dps[HVACMODE_DPS] = True
-        self.dps[AIRCLEAN_DPS] = True
-        self.assertEqual(self.climate.icon, "mdi:air-purifier")
-
-    def test_icon_is_tshirt_when_dry_clothes_is_active(self):
-        self.dps[ERROR_DPS] = None
-        self.dps[HVACMODE_DPS] = True
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertEqual(self.climate.icon, "mdi:tshirt-crew-outline")
-
-    def test_icon_is_always_melting_snowflake_when_defrosting_and_tank_not_full(self):
-        self.dps[DEFROST_DPS] = True
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.icon, "mdi:snowflake-melt")
-
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.icon, "mdi:snowflake-melt")
-
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertEqual(self.climate.icon, "mdi:snowflake-melt")
-
-        self.dps[AIRCLEAN_DPS] = True
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.assertEqual(self.climate.icon, "mdi:snowflake-melt")
-
-    def test_icon_is_always_tank_when_tank_full_error_is_present(self):
-        self.dps[ERROR_DPS] = 8
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.icon, "mdi:cup-water")
-
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.icon, "mdi:cup-water")
-
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertEqual(self.climate.icon, "mdi:cup-water")
-
-        self.dps[AIRCLEAN_DPS] = True
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.assertEqual(self.climate.icon, "mdi:cup-water")
-
-        self.dps[DEFROST_DPS] = True
-        self.assertEqual(self.climate.icon, "mdi:cup-water")
-
-    def test_current_humidity(self):
-        self.dps[CURRENTHUMID_DPS] = 47
-        self.assertEqual(self.climate.current_humidity, 47)
-
     def test_min_target_humidity(self):
-        self.assertEqual(self.climate.min_humidity, 30)
         self.assertEqual(self.subject.min_humidity, 30)
 
     def test_max_target_humidity(self):
-        self.assertEqual(self.climate.max_humidity, 80)
         self.assertEqual(self.subject.max_humidity, 80)
 
-    def test_target_humidity_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.dps[HUMIDITY_DPS] = 55
-
-        self.assertEqual(self.climate.target_humidity, 55)
-
     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)
 
-    def test_target_humidity_outside_normal_preset(self):
-        self.dps[HUMIDITY_DPS] = 55
-
-        self.dps[PRESET_DPS] = PRESET_HIGH
-        self.assertIs(self.climate.target_humidity, None)
-
-        self.dps[PRESET_DPS] = PRESET_LOW
-        self.assertIs(self.climate.target_humidity, None)
-
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertIs(self.climate.target_humidity, None)
-
-    async def test_set_target_humidity_in_normal_preset_rounds_up_to_5_percent(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.climate._device,
-            {HUMIDITY_DPS: 55},
-        ):
-            await self.climate.async_set_humidity(53)
-
-    async def test_set_target_humidity_in_normal_preset_rounds_down_to_5_percent(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-
-        async with assert_device_properties_set(
-            self.climate._device,
-            {HUMIDITY_DPS: 50},
-        ):
-            await self.climate.async_set_humidity(52)
-
     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(
@@ -251,186 +134,33 @@ class TestGoldairDehumidifier(
         ):
             await self.subject.async_set_humidity(42)
 
-    async def test_set_target_humidity_raises_error_outside_of_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_LOW
-        with self.assertRaisesRegex(
-            AttributeError, "humidity cannot be set at this time"
-        ):
-            await self.climate.async_set_humidity(50)
-
-        self.dps[PRESET_DPS] = PRESET_HIGH
-        with self.assertRaisesRegex(
-            AttributeError, "humidity cannot be set at this time"
-        ):
-            await self.climate.async_set_humidity(50)
-
-        self.dps[PRESET_DPS] = PRESET_LOW
-        with self.assertRaisesRegex(
-            AttributeError, "humidity cannot be set at this time"
-        ):
-            await self.climate.async_set_humidity(50)
-
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        with self.assertRaisesRegex(
-            AttributeError, "humidity cannot be set at this time"
-        ):
-            await self.climate.async_set_humidity(50)
-
-    def test_temperature_unit_returns_device_temperature_unit(self):
-        self.assertEqual(
-            self.climate.temperature_unit,
-            self.climate._device.temperature_unit,
-        )
-
-    def test_minimum_target_temperature(self):
-        self.assertIs(self.climate.min_temp, None)
-
-    def test_maximum_target_temperature(self):
-        self.assertIs(self.climate.max_temp, None)
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 25
-        self.assertEqual(self.climate.current_temperature, 25)
-
-    def test_climate_hvac_mode(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.hvac_mode, HVACMode.DRY)
-
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.hvac_mode, HVACMode.OFF)
-
-    def test_climate_hvac_modes(self):
-        self.assertCountEqual(self.climate.hvac_modes, [HVACMode.OFF, HVACMode.DRY])
-
-    async def test_climate_set_hvac_mode_to_dry(self):
-        async with assert_device_properties_set(
-            self.climate._device, {HVACMODE_DPS: True}
-        ):
-            await self.climate.async_set_hvac_mode(HVACMode.DRY)
-
-    async def test_climate_set_hvac_mode_to_off(self):
-
-        async with assert_device_properties_set(
-            self.climate._device, {HVACMODE_DPS: False}
-        ):
-            await self.climate.async_set_hvac_mode(HVACMode.OFF)
-
     def test_preset_mode(self):
         self.dps[PRESET_DPS] = PRESET_NORMAL
-        self.assertEqual(self.climate.preset_mode, "Normal")
         self.assertEqual(self.subject.mode, "Normal")
 
         self.dps[PRESET_DPS] = PRESET_LOW
-        self.assertEqual(self.climate.preset_mode, "Low")
         self.assertEqual(self.subject.mode, "Low")
 
         self.dps[PRESET_DPS] = PRESET_HIGH
-        self.assertEqual(self.climate.preset_mode, "High")
         self.assertEqual(self.subject.mode, "High")
 
         self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.assertEqual(self.climate.preset_mode, "Dry clothes")
         self.assertEqual(self.subject.mode, "Dry clothes")
 
         self.dps[PRESET_DPS] = None
-        self.assertEqual(self.climate.preset_mode, None)
         self.assertEqual(self.subject.mode, None)
 
-    def test_air_clean_is_surfaced_in_preset_mode(self):
-        self.dps[PRESET_DPS] = PRESET_DRY_CLOTHES
-        self.dps[AIRCLEAN_DPS] = True
-
-        self.assertEqual(self.climate.preset_mode, "Air clean")
-
-    def test_preset_modes(self):
-        self.assertCountEqual(
-            self.climate.preset_modes,
-            [
-                "Normal",
-                "Low",
-                "High",
-                "Dry clothes",
-                "Air clean",
-            ],
-        )
-
-    async def test_set_preset_mode_to_normal(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: PRESET_NORMAL,
-                AIRCLEAN_DPS: False,
-            },
-        ):
-            await self.climate.async_set_preset_mode("Normal")
-            self.climate._device.anticipate_property_value.assert_not_called()
-
-    async def test_set_preset_mode_to_low(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: PRESET_LOW,
-                AIRCLEAN_DPS: False,
-            },
-        ):
-            await self.climate.async_set_preset_mode("Low")
-
-    async def test_set_preset_mode_to_high(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: PRESET_HIGH,
-                AIRCLEAN_DPS: False,
-            },
-        ):
-            await self.climate.async_set_preset_mode("High")
-
-    async def test_set_preset_mode_to_dry_clothes(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {
-                PRESET_DPS: PRESET_DRY_CLOTHES,
-                AIRCLEAN_DPS: False,
-            },
-        ):
-            await self.climate.async_set_preset_mode("Dry clothes")
-
-    async def test_set_preset_mode_to_air_clean(self):
-        async with assert_device_properties_set(
-            self.climate._device, {AIRCLEAN_DPS: True, PRESET_DPS: ANY}
-        ):
-            await self.climate.async_set_preset_mode("Air clean")
-
     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.climate.fan_mode, FAN_LOW)
         self.assertEqual(self.fan.percentage, 50)
 
         self.dps[FANMODE_DPS] = "3"
-        self.assertEqual(self.climate.fan_mode, FAN_HIGH)
         self.assertEqual(self.fan.percentage, 100)
 
         self.dps[FANMODE_DPS] = None
-        self.assertEqual(self.climate.fan_mode, None)
         self.assertEqual(self.fan.percentage, None)
 
-    async def test_set_fan_mode_to_low_succeeds_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.climate._device,
-            {FANMODE_DPS: "1"},
-        ):
-            await self.climate.async_set_fan_mode(FAN_LOW)
-
-    async def test_set_fan_mode_to_high_succeeds_in_normal_preset(self):
-        self.dps[PRESET_DPS] = PRESET_NORMAL
-        async with assert_device_properties_set(
-            self.climate._device,
-            {FANMODE_DPS: "3"},
-        ):
-            await self.climate.async_set_fan_mode(FAN_HIGH)
-
     async def test_set_fan_50_succeeds_in_normal_preset(self):
         self.dps[PRESET_DPS] = PRESET_NORMAL
         async with assert_device_properties_set(
@@ -455,35 +185,6 @@ class TestGoldairDehumidifier(
         ):
             await self.fan.async_set_percentage(30)
 
-    def test_extra_state_attributes(self):
-        self.dps[ERROR_DPS] = None
-        self.dps[DEFROST_DPS] = False
-        self.dps[AIRCLEAN_DPS] = False
-        self.dps[UNKNOWN101_DPS] = False
-        self.assertDictEqual(
-            self.climate.extra_state_attributes,
-            {
-                "error": None,
-                "defrosting": False,
-                "air_clean_on": False,
-                "unknown_101": False,
-            },
-        )
-
-        self.dps[ERROR_DPS] = 8
-        self.dps[DEFROST_DPS] = True
-        self.dps[AIRCLEAN_DPS] = True
-        self.dps[UNKNOWN101_DPS] = True
-        self.assertDictEqual(
-            self.climate.extra_state_attributes,
-            {
-                "error": ERROR_TANK,
-                "defrosting": True,
-                "air_clean_on": True,
-                "unknown_101": True,
-            },
-        )
-
     def test_light_supported_color_modes(self):
         self.assertCountEqual(
             self.light.supported_color_modes,

+ 2 - 185
tests/devices/test_goldair_fan.py

@@ -1,11 +1,3 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-    PRESET_ECO,
-    PRESET_SLEEP,
-    SWING_HORIZONTAL,
-    SWING_OFF,
-)
 from homeassistant.components.fan import (
     FanEntityFeature,
 )
@@ -30,7 +22,6 @@ class TestGoldairFan(BasicLightTests, SwitchableTests, TuyaDeviceTestCase):
     def setUp(self):
         self.setUpForConfig("goldair_fan.yaml", FAN_PAYLOAD)
         self.subject = self.entities.get("fan")
-        self.climate = self.entities.get("climate")
         self.setUpSwitchable(HVACMODE_DPS, self.subject)
         self.setUpBasicLight(LIGHT_DPS, self.entities.get("light_display"))
         self.mark_secondary(["light_display"])
@@ -44,52 +35,14 @@ class TestGoldairFan(BasicLightTests, SwitchableTests, TuyaDeviceTestCase):
                 | FanEntityFeature.SET_SPEED
             ),
         )
-        self.assertEqual(
-            self.climate.supported_features,
-            (
-                ClimateEntityFeature.FAN_MODE
-                | ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.SWING_MODE
-            ),
-        )
-
-    def test_climate_icon_is_fan(self):
-        self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.icon, "mdi:fan")
-        self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.icon, "mdi:fan-off")
-
-    def test_temperature_unit_returns_device_temperature_unit(self):
-        self.assertEqual(
-            self.climate.temperature_unit, self.climate._device.temperature_unit
-        )
 
     def test_is_on(self):
         self.dps[HVACMODE_DPS] = True
-        self.assertEqual(self.climate.hvac_mode, HVACMode.FAN_ONLY)
         self.assertTrue(self.subject.is_on)
 
         self.dps[HVACMODE_DPS] = False
-        self.assertEqual(self.climate.hvac_mode, HVACMode.OFF)
         self.assertFalse(self.subject.is_on)
 
-    def test_climate_hvac_modes(self):
-        self.assertCountEqual(
-            self.climate.hvac_modes, [HVACMode.OFF, HVACMode.FAN_ONLY]
-        )
-
-    async def test_climate_turn_on(self):
-        async with assert_device_properties_set(
-            self.climate._device, {HVACMODE_DPS: True}
-        ):
-            await self.climate.async_set_hvac_mode(HVACMode.FAN_ONLY)
-
-    async def test_climate_turn_off(self):
-        async with assert_device_properties_set(
-            self.climate._device, {HVACMODE_DPS: False}
-        ):
-            await self.climate.async_set_hvac_mode(HVACMode.OFF)
-
     async def test_turn_on(self):
         async with assert_device_properties_set(
             self.subject._device, {HVACMODE_DPS: True}
@@ -104,47 +57,17 @@ class TestGoldairFan(BasicLightTests, SwitchableTests, TuyaDeviceTestCase):
 
     def test_preset_mode(self):
         self.dps[PRESET_DPS] = "normal"
-        self.assertEqual(self.climate.preset_mode, "normal")
         self.assertEqual(self.subject.preset_mode, "normal")
 
         self.dps[PRESET_DPS] = "nature"
-        self.assertEqual(self.climate.preset_mode, PRESET_ECO)
         self.assertEqual(self.subject.preset_mode, "nature")
 
-        self.dps[PRESET_DPS] = PRESET_SLEEP
-        self.assertEqual(self.climate.preset_mode, PRESET_SLEEP)
-        self.assertEqual(self.subject.preset_mode, PRESET_SLEEP)
-
-        self.dps[PRESET_DPS] = None
-        self.assertIs(self.climate.preset_mode, None)
+        self.dps[PRESET_DPS] = "sleep"
+        self.assertEqual(self.subject.preset_mode, "sleep")
 
     def test_preset_modes(self):
-        self.assertCountEqual(
-            self.climate.preset_modes, ["normal", PRESET_ECO, PRESET_SLEEP]
-        )
         self.assertCountEqual(self.subject.preset_modes, ["normal", "nature", "sleep"])
 
-    async def test_set_climate_preset_mode_to_normal(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {PRESET_DPS: "normal"},
-        ):
-            await self.climate.async_set_preset_mode("normal")
-
-    async def test_set_climate_preset_mode_to_eco(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {PRESET_DPS: "nature"},
-        ):
-            await self.climate.async_set_preset_mode(PRESET_ECO)
-
-    async def test_set_climate_preset_mode_to_sleep(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {PRESET_DPS: PRESET_SLEEP},
-        ):
-            await self.climate.async_set_preset_mode(PRESET_SLEEP)
-
     async def test_set_preset_mode_to_normal(self):
         async with assert_device_properties_set(
             self.subject._device,
@@ -168,34 +91,14 @@ class TestGoldairFan(BasicLightTests, SwitchableTests, TuyaDeviceTestCase):
 
     def test_swing_mode(self):
         self.dps[SWING_DPS] = False
-        self.assertEqual(self.climate.swing_mode, SWING_OFF)
         self.assertFalse(self.subject.oscillating)
 
         self.dps[SWING_DPS] = True
-        self.assertEqual(self.climate.swing_mode, SWING_HORIZONTAL)
         self.assertTrue(self.subject.oscillating)
 
         self.dps[SWING_DPS] = None
-        self.assertIs(self.climate.swing_mode, None)
         self.assertFalse(self.subject.oscillating)
 
-    def test_swing_modes(self):
-        self.assertCountEqual(self.climate.swing_modes, [SWING_OFF, SWING_HORIZONTAL])
-
-    async def test_climate_set_swing_mode_to_off(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {SWING_DPS: False},
-        ):
-            await self.climate.async_set_swing_mode(SWING_OFF)
-
-    async def test_climate_set_swing_mode_to_horizontal(self):
-        async with assert_device_properties_set(
-            self.climate._device,
-            {SWING_DPS: True},
-        ):
-            await self.climate.async_set_swing_mode(SWING_HORIZONTAL)
-
     async def test_oscillate_off(self):
         async with assert_device_properties_set(
             self.subject._device, {SWING_DPS: False}
@@ -230,94 +133,8 @@ class TestGoldairFan(BasicLightTests, SwitchableTests, TuyaDeviceTestCase):
         async with assert_device_properties_set(self.subject._device, {FANMODE_DPS: 8}):
             await self.subject.async_set_percentage(75)
 
-    def test_climate_fan_modes(self):
-        self.dps[PRESET_DPS] = "normal"
-        self.assertCountEqual(self.climate.fan_modes, list(range(1, 13)))
-
-        self.dps[PRESET_DPS] = "nature"
-        self.assertCountEqual(self.climate.fan_modes, ["low", "medium", "high"])
-
-        self.dps[PRESET_DPS] = PRESET_SLEEP
-        self.assertCountEqual(self.climate.fan_modes, ["low", "medium", "high"])
-
-        self.dps[PRESET_DPS] = None
-        self.assertEqual(self.climate.fan_modes, None)
-
-    def test_climate_fan_mode_for_normal_preset(self):
-        self.dps[PRESET_DPS] = "normal"
-
-        self.dps[FANMODE_DPS] = 1
-        self.assertEqual(self.climate.fan_mode, 1)
-
-        self.dps[FANMODE_DPS] = 6
-        self.assertEqual(self.climate.fan_mode, 6)
-
-        self.dps[FANMODE_DPS] = 12
-        self.assertEqual(self.climate.fan_mode, 12)
-
-        self.dps[FANMODE_DPS] = None
-        self.assertEqual(self.climate.fan_mode, None)
-
-    async def test_climate_set_fan_mode_for_normal_preset(self):
-        self.dps[PRESET_DPS] = "normal"
-
-        async with assert_device_properties_set(
-            self.climate._device,
-            {FANMODE_DPS: 6},
-        ):
-            await self.climate.async_set_fan_mode(6)
-
-    def test_climate_fan_mode_for_eco_preset(self):
-        self.dps[PRESET_DPS] = "nature"
-
-        self.dps[FANMODE_DPS] = 4
-        self.assertEqual(self.climate.fan_mode, "low")
-
-        self.dps[FANMODE_DPS] = 8
-        self.assertEqual(self.climate.fan_mode, "medium")
-
-        self.dps[FANMODE_DPS] = 12
-        self.assertEqual(self.climate.fan_mode, "high")
-
-        self.dps[FANMODE_DPS] = None
-        self.assertEqual(self.climate.fan_mode, None)
-
-    async def test_climate_set_fan_mode_for_eco_preset(self):
-        self.dps[PRESET_DPS] = "nature"
-
-        async with assert_device_properties_set(
-            self.climate._device,
-            {FANMODE_DPS: 4},
-        ):
-            await self.climate.async_set_fan_mode("low")
-
-    def test_climate_fan_mode_for_sleep_preset(self):
-        self.dps[PRESET_DPS] = PRESET_SLEEP
-
-        self.dps[FANMODE_DPS] = 4
-        self.assertEqual(self.climate.fan_mode, "low")
-
-        self.dps[FANMODE_DPS] = 8
-        self.assertEqual(self.climate.fan_mode, "medium")
-
-        self.dps[FANMODE_DPS] = 12
-        self.assertEqual(self.climate.fan_mode, "high")
-
-        self.dps[FANMODE_DPS] = None
-        self.assertEqual(self.climate.fan_mode, None)
-
-    async def test_climate_set_fan_mode_for_sleep_preset(self):
-        self.dps[PRESET_DPS] = PRESET_SLEEP
-
-        async with assert_device_properties_set(
-            self.climate._device,
-            {FANMODE_DPS: 8},
-        ):
-            await self.climate.async_set_fan_mode("medium")
-
     def test_extra_state_attributes(self):
         self.dps[TIMER_DPS] = "5"
-        self.assertEqual(self.climate.extra_state_attributes, {"timer": "5"})
         self.assertEqual(self.subject.extra_state_attributes, {"timer": "5"})
 
     def test_light_icon(self):

+ 25 - 24
tests/test_climate.py

@@ -33,32 +33,33 @@ async def test_init_entry(hass):
     m_add_entities.assert_called_once()
 
 
-async def test_init_entry_as_secondary(hass):
-    """Test initialisation when climate is a secondary entity"""
-    entry = MockConfigEntry(
-        domain=DOMAIN,
-        data={
-            CONF_TYPE: "goldair_dehumidifier",
-            CONF_DEVICE_ID: "dummy",
-            "climate_dehumidifier_as_climate": True,
-        },
-    )
-    # although async, the async_add_entities function passed to
-    # async_setup_entry is called truly asynchronously. If we use
-    # AsyncMock, it expects us to await the result.
-    m_add_entities = Mock()
-    m_device = AsyncMock()
+# After removal of deprecated entities, there are no secondary climate devices to test against.
+# async def test_init_entry_as_secondary(hass):
+#     """Test initialisation when climate is a secondary entity"""
+#     entry = MockConfigEntry(
+#         domain=DOMAIN,
+#         data={
+#             CONF_TYPE: "goldair_dehumidifier",
+#             CONF_DEVICE_ID: "dummy",
+#             "climate_dehumidifier_as_climate": True,
+#         },
+#     )
+#     # although async, the async_add_entities function passed to
+#     # async_setup_entry is called truly asynchronously. If we use
+#     # AsyncMock, it expects us to await the result.
+#     m_add_entities = Mock()
+#     m_device = AsyncMock()
 
-    hass.data[DOMAIN] = {}
-    hass.data[DOMAIN]["dummy"] = {}
-    hass.data[DOMAIN]["dummy"]["device"] = m_device
+#     hass.data[DOMAIN] = {}
+#     hass.data[DOMAIN]["dummy"] = {}
+#     hass.data[DOMAIN]["dummy"]["device"] = m_device
 
-    await async_setup_entry(hass, entry, m_add_entities)
-    assert (
-        type(hass.data[DOMAIN]["dummy"]["climate_dehumidifier_as_climate"])
-        == TuyaLocalClimate
-    )
-    m_add_entities.assert_called_once()
+#     await async_setup_entry(hass, entry, m_add_entities)
+#     assert (
+#         type(hass.data[DOMAIN]["dummy"]["climate_dehumidifier_as_climate"])
+#         == TuyaLocalClimate
+#     )
+#     m_add_entities.assert_called_once()
 
 
 async def test_init_entry_fails_if_device_has_no_climate(hass):