1 """Define a base Ridwell entity."""
3 from __future__
import annotations
5 from datetime
import date
7 from aioridwell.model
import RidwellAccount, RidwellPickupEvent
12 from .const
import DOMAIN
13 from .coordinator
import RidwellDataUpdateCoordinator
17 """Define a base Ridwell entity."""
19 _attr_has_entity_name =
True
23 coordinator: RidwellDataUpdateCoordinator,
24 account: RidwellAccount,
26 """Initialize the sensor."""
31 configuration_url=coordinator.dashboard_url,
32 entry_type=DeviceEntryType.SERVICE,
33 identifiers={(DOMAIN, coordinator.user_id)},
34 manufacturer=
"Ridwell",
40 """Get the next pickup event."""
43 for event
in self.coordinator.data[self.
_account_account.account_id]
44 if event.pickup_date >= date.today()
None __init__(self, RidwellDataUpdateCoordinator coordinator, RidwellAccount account)
RidwellPickupEvent next_pickup_event(self)