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

climate: remove aux_heat support. BREAKING CHANGE

- already deprecated, alternative entities exist
- only 3 devices using it (ITS 45HD, Sendo and Vivax heatpumps)
- HA is properly deprecating it in 2024.4, so log messages encouraging
  users to report bugs will start appearing.

Issue #1784
Jason Rumney 1 год назад
Родитель
Сommit
a1c93e4de4

+ 0 - 22
custom_components/tuya_local/climate.py

@@ -11,7 +11,6 @@ from homeassistant.components.climate import (
     HVACMode,
     HVACMode,
 )
 )
 from homeassistant.components.climate.const import (
 from homeassistant.components.climate.const import (
-    ATTR_AUX_HEAT,
     ATTR_CURRENT_HUMIDITY,
     ATTR_CURRENT_HUMIDITY,
     ATTR_CURRENT_TEMPERATURE,
     ATTR_CURRENT_TEMPERATURE,
     ATTR_FAN_MODE,
     ATTR_FAN_MODE,
@@ -75,7 +74,6 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
         super().__init__()
         super().__init__()
         dps_map = self._init_begin(device, config)
         dps_map = self._init_begin(device, config)
 
 
-        self._aux_heat_dps = dps_map.pop(ATTR_AUX_HEAT, None)
         self._current_temperature_dps = dps_map.pop(
         self._current_temperature_dps = dps_map.pop(
             ATTR_CURRENT_TEMPERATURE,
             ATTR_CURRENT_TEMPERATURE,
             None,
             None,
@@ -102,8 +100,6 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
         # checking whether we are falling back on the auto-generation.
         # checking whether we are falling back on the auto-generation.
         self._enable_turn_on_off_backwards_compatibility = False
         self._enable_turn_on_off_backwards_compatibility = False
 
 
-        if self._aux_heat_dps:
-            self._attr_supported_features |= ClimateEntityFeature.AUX_HEAT
         if self._fan_mode_dps:
         if self._fan_mode_dps:
             self._attr_supported_features |= ClimateEntityFeature.FAN_MODE
             self._attr_supported_features |= ClimateEntityFeature.FAN_MODE
         if self._humidity_dps:
         if self._humidity_dps:
@@ -380,24 +376,6 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
         else:
         else:
             await super().async_turn_off()
             await super().async_turn_off()
 
 
-    @property
-    def is_aux_heat(self):
-        """Return state of aux heater"""
-        if self._aux_heat_dps:
-            return self._aux_heat_dps.get_value(self._device)
-
-    async def async_turn_aux_heat_on(self):
-        """Turn on aux heater."""
-        if self._aux_heat_dps is None:
-            raise NotImplementedError()
-        await self._aux_heat_dps.async_set_value(self._device, True)
-
-    async def async_turn_aux_heat_off(self):
-        """Turn off aux heater."""
-        if self._aux_heat_dps is None:
-            raise NotImplementedError()
-        await self._aux_heat_dps.async_set_value(self._device, False)
-
     @property
     @property
     def preset_mode(self):
     def preset_mode(self):
         """Return the current preset mode."""
         """Return the current preset mode."""

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

@@ -556,7 +556,6 @@ from the camera.
 **NOTE**: tuya-local does not directly support video streaming from cameras.  Some cameras provide ONVIF or WebRTC compliant streams locally which you can use the relevant integrations to capture, others may be cloud-only.
 **NOTE**: tuya-local does not directly support video streaming from cameras.  Some cameras provide ONVIF or WebRTC compliant streams locally which you can use the relevant integrations to capture, others may be cloud-only.
 
 
 ### `climate`
 ### `climate`
-- **aux_heat** (optional, boolean, DEPRECATED) a dp to control the aux heat switch if the device has one. Note this is being deprecated by HA and no longer accessible from the UI since HA 2023.9, though the deprecation announcement is yet to be made as of 2023.11. It is recommended not to use this, and instead use an separate switch entity.
 - **current_temperature** (optional, number) a dp that reports the current temperature.
 - **current_temperature** (optional, number) a dp that reports the current temperature.
 - **current_humidity** (optional, number) a dp that reports the current humidity (%).
 - **current_humidity** (optional, number) a dp that reports the current humidity (%).
 - **fan_mode** (optional, mapping of strings) a dp to control the fan mode if available.
 - **fan_mode** (optional, mapping of strings) a dp to control the fan mode if available.

+ 0 - 3
custom_components/tuya_local/devices/its_45hd_heatpump.yaml

@@ -71,9 +71,6 @@ primary_entity:
     - id: 30
     - id: 30
       type: boolean
       type: boolean
       name: chlorination
       name: chlorination
-    - id: 32
-      type: boolean
-      name: aux_heat
     - id: 40
     - id: 40
       type: integer
       type: integer
       name: model_code
       name: model_code

+ 0 - 3
custom_components/tuya_local/devices/sendo_airconditioner_c.yaml

@@ -49,9 +49,6 @@ primary_entity:
           value: eco
           value: eco
         - dps_val: false
         - dps_val: false
           value: comfort
           value: comfort
-    - id: 12
-      name: aux_heat
-      type: boolean
     - id: 33
     - id: 33
       name: swing_mode
       name: swing_mode
       type: boolean
       type: boolean

+ 0 - 3
custom_components/tuya_local/devices/vivax_heatpump.yaml

@@ -74,9 +74,6 @@ primary_entity:
           value: eco
           value: eco
         - dps_val: false
         - dps_val: false
           value: comfort
           value: comfort
-    - id: 12
-      type: boolean
-      name: aux_heat
     - id: 18
     - id: 18
       type: integer
       type: integer
       name: current_humidity
       name: current_humidity

+ 0 - 1
tests/test_device_config.py

@@ -171,7 +171,6 @@ KNOWN_DPS = {
     "climate": {
     "climate": {
         "required": [],
         "required": [],
         "optional": [
         "optional": [
-            "aux_heat",
             "current_temperature",
             "current_temperature",
             "current_humidity",
             "current_humidity",
             "fan_mode",
             "fan_mode",