瀏覽代碼

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
Jason Rumney 2 年之前
父節點
當前提交
036999054d
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      custom_components/tuya_local/climate.py

+ 6 - 0
custom_components/tuya_local/climate.py

@@ -96,6 +96,12 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
 
         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: