Move Skybell attributes to their own sensors (#73089)

This commit is contained in:
Robert Hillis 2022-06-05 15:56:31 -04:00 committed by GitHub
parent 58d4ea0db9
commit c13e55ca02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 77 additions and 35 deletions

View file

@ -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."""