Issue #478 vtherm doesn't follow underlying (#548)

* Dispatch test_bugs into each own VTherm type tests

* Local tests ok

* With testus ok.

---------

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
This commit is contained in:
Jean-Marc Collin
2024-10-13 11:30:04 +02:00
committed by GitHub
parent 1334bdbd8f
commit 73a9ca4e53
13 changed files with 1028 additions and 960 deletions

View File

@@ -15,10 +15,12 @@ from homeassistant.core import (
callback,
Event,
State,
)
from homeassistant.components.climate import ClimateEntity
from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.helpers.entity import Entity
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.device_registry import DeviceInfo, DeviceEntryType
@@ -1159,10 +1161,17 @@ class BaseThermostat(ClimateEntity, RestoreEntity, Generic[T]):
return len(self._underlyings)
@property
def underlying_entities(self) -> int:
def underlying_entities(self) -> list | None:
"""Returns the underlying entities"""
return self._underlyings
def find_underlying_by_entity_id(self, entity_id: str) -> Entity | None:
"""Get the underlying entity by a entity_id"""
for under in self._underlyings:
if under.entity_id == entity_id:
return under
return None
@property
def is_on(self) -> bool:
"""True if the VTherm is on (! HVAC_OFF)"""