Improve coordinator logic in Tessie to allow sleep (#107988)
* Poll status before state * Tests
This commit is contained in:
parent
cdb798bec0
commit
32b0bf6b4e
6 changed files with 60 additions and 31 deletions
|
@ -14,7 +14,7 @@ from homeassistant.const import EntityCategory
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DOMAIN, TessieStatus
|
||||
from .const import DOMAIN, TessieState
|
||||
from .coordinator import TessieStateUpdateCoordinator
|
||||
from .entity import TessieEntity
|
||||
|
||||
|
@ -30,7 +30,7 @@ DESCRIPTIONS: tuple[TessieBinarySensorEntityDescription, ...] = (
|
|||
TessieBinarySensorEntityDescription(
|
||||
key="state",
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
is_on=lambda x: x == TessieStatus.ONLINE,
|
||||
is_on=lambda x: x == TessieState.ONLINE,
|
||||
),
|
||||
TessieBinarySensorEntityDescription(
|
||||
key="charge_state_battery_heater_on",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue