From 036999054dc77b462b9dc59fdd2d6b554d1c2caf Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Wed, 27 Mar 2024 19:28:42 +0900 Subject: [PATCH] climate: opt out of HA's backward compatibility turn_on/off We already effectively opt out by explicitly defining these functions, but the braindead way the deprecation notices work mean we need to also opt out with this secret flag. Issue #1513, #1737, #1734, #1637, #1632 https://github.com/home-assistant/core/issues/114286 --- custom_components/tuya_local/climate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/custom_components/tuya_local/climate.py b/custom_components/tuya_local/climate.py index bb14c1628f..5cfeabe87b 100644 --- a/custom_components/tuya_local/climate.py +++ b/custom_components/tuya_local/climate.py @@ -96,6 +96,12 @@ def __init__(self, device: TuyaLocalDevice, config: TuyaEntityConfig): self._init_end(dps_map) + # Disable HA's backwards compatibility auto creation of turn_on/off + # we explicitly define our own so this should have no effect, but + # the deprecation notices in HA use this flag rather than properly + # checking whether we are falling back on the auto-generation. + 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: