Fix climate entity creation when Shelly WallDisplay uses external relay as actuator (#115216)

* Fix climate entity creation when Shelly WallDisplay uses external relay as actuator

* More comments

* Wrap condition into function

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
Maciej Bieniek 2024-04-25 21:06:52 +02:00 committed by GitHub
parent b3124aa7ed
commit 51bceb1c99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 6 deletions

View file

@ -500,3 +500,8 @@ def async_remove_shelly_rpc_entities(
if entity_id := entity_reg.async_get_entity_id(domain, DOMAIN, f"{mac}-{key}"):
LOGGER.debug("Removing entity: %s", entity_id)
entity_reg.async_remove(entity_id)
def is_rpc_thermostat_mode(ident: int, status: dict[str, Any]) -> bool:
"""Return True if 'thermostat:<IDent>' is present in the status."""
return f"thermostat:{ident}" in status