1 """Binary sensor platform for Squeezebox integration."""
3 from __future__
import annotations
8 BinarySensorDeviceClass,
10 BinarySensorEntityDescription,
16 from .
import SqueezeboxConfigEntry
17 from .const
import STATUS_SENSOR_NEEDSRESTART, STATUS_SENSOR_RESCAN
18 from .entity
import LMSStatusEntity
20 SENSORS: tuple[BinarySensorEntityDescription, ...] = (
22 key=STATUS_SENSOR_RESCAN,
23 device_class=BinarySensorDeviceClass.RUNNING,
26 key=STATUS_SENSOR_NEEDSRESTART,
27 device_class=BinarySensorDeviceClass.UPDATE,
28 entity_category=EntityCategory.DIAGNOSTIC,
32 _LOGGER = logging.getLogger(__name__)
37 entry: SqueezeboxConfigEntry,
38 async_add_entities: AddEntitiesCallback,
40 """Platform setup using common elements."""
44 for description
in SENSORS
49 """LMS Status based sensor from LMS via cooridnatior."""
53 """LMS Status directly from coordinator data."""
None async_setup_entry(HomeAssistant hass, SqueezeboxConfigEntry entry, AddEntitiesCallback async_add_entities)