1 """The FiveM binary sensor platform."""
3 from dataclasses
import dataclass
6 BinarySensorDeviceClass,
8 BinarySensorEntityDescription,
14 from .const
import DOMAIN, NAME_STATUS
15 from .entity
import FiveMEntity, FiveMEntityDescription
18 @dataclass(frozen=True)
20 BinarySensorEntityDescription, FiveMEntityDescription
22 """Describes FiveM binary sensor entity."""
25 BINARY_SENSORS: tuple[FiveMBinarySensorEntityDescription, ...] = (
28 translation_key=
"status",
29 device_class=BinarySensorDeviceClass.CONNECTIVITY,
37 async_add_entities: AddEntitiesCallback,
39 """Set up the FiveM binary sensor platform."""
40 coordinator = hass.data[DOMAIN][entry.entry_id]
48 """Representation of a FiveM sensor base entity."""
50 entity_description: FiveMBinarySensorEntityDescription
54 """Return the state of the sensor."""
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)