Move Skybell attributes to their own sensors (#73089)
This commit is contained in:
parent
58d4ea0db9
commit
c13e55ca02
3 changed files with 77 additions and 35 deletions
|
@ -1,8 +1,6 @@
|
|||
"""Binary sensor support for the Skybell HD Doorbell."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from aioskybell.helpers import const as CONST
|
||||
import voluptuous as vol
|
||||
|
||||
|
@ -69,16 +67,6 @@ class SkybellBinarySensor(SkybellEntity, BinarySensorEntity):
|
|||
super().__init__(coordinator, description)
|
||||
self._event: dict[str, str] = {}
|
||||
|
||||
@property
|
||||
def extra_state_attributes(
|
||||
self,
|
||||
) -> dict[str, str | int | datetime | tuple[str, str]]:
|
||||
"""Return the state attributes."""
|
||||
attrs = super().extra_state_attributes
|
||||
if event := self._event.get(CONST.CREATED_AT):
|
||||
attrs["event_date"] = event
|
||||
return attrs
|
||||
|
||||
@callback
|
||||
def _handle_coordinator_update(self) -> None:
|
||||
"""Handle updated data from the coordinator."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue