Skip to content

Commit

Permalink
climate: opt out of HA's backward compatibility turn_on/off
Browse files Browse the repository at this point in the history
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
home-assistant/core#114286
  • Loading branch information
make-all committed Mar 27, 2024
1 parent 46749b1 commit 0369990
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/tuya_local/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0369990

Please sign in to comment.