1 """Entity for the opengarage.io component."""
3 from __future__
import annotations
10 from .const
import DOMAIN
11 from .coordinator
import OpenGarageDataUpdateCoordinator
15 """Representation of a OpenGarage entity."""
17 _attr_has_entity_name =
True
21 open_garage_data_coordinator: OpenGarageDataUpdateCoordinator,
23 description: EntityDescription |
None =
None,
25 """Initialize the entity."""
26 super().
__init__(open_garage_data_coordinator)
28 if description
is not None:
39 """Update the state and attributes."""
43 """Handle updated data from the coordinator."""
45 self.async_write_ha_state()
49 """Return the device_info of the device."""
51 configuration_url=self.coordinator.open_garage_connection.device_url,
52 connections={(CONNECTION_NETWORK_MAC, self.coordinator.data[
"mac"])},
53 identifiers={(DOMAIN, self.
_device_id_device_id)},
54 manufacturer=
"Open Garage",
55 name=self.coordinator.data[
"name"],
56 suggested_area=
"Garage",
57 sw_version=self.coordinator.data[
"fwv"],
None __init__(self, OpenGarageDataUpdateCoordinator open_garage_data_coordinator, str device_id, EntityDescription|None description=None)
None _handle_coordinator_update(self)
DeviceInfo device_info(self)