1 """Entity representing a Blue Current charge point."""
3 from abc
import abstractmethod
11 from .
import Connector
12 from .const
import DOMAIN, MODEL_TYPE
16 """Define a base Blue Current entity."""
18 _attr_has_entity_name =
True
19 _attr_should_poll =
False
21 def __init__(self, connector: Connector, signal: str) ->
None:
22 """Initialize the entity."""
28 """Register callbacks."""
32 """Update the state."""
42 """Return entity availability."""
48 """Update the entity from the latest data."""
51 class ChargepointEntity(BlueCurrentEntity):
52 """Define a base charge point entity."""
54 def __init__(self, connector: Connector, evse_id: str) ->
None:
55 """Initialize the entity."""
56 super().
__init__(connector, f
"{DOMAIN}_charge_point_update_{evse_id}")
58 chargepoint_name = connector.charge_points[evse_id][ATTR_NAME]
62 identifiers={(DOMAIN, evse_id)},
63 name=chargepoint_name
if chargepoint_name !=
"" else evse_id,
64 manufacturer=
"Blue Current",
65 model=connector.charge_points[evse_id][MODEL_TYPE],
None async_added_to_hass(self)
None update_from_latest_data(self)
None __init__(self, Connector connector, str signal)
None __init__(self, Connector connector, str evse_id)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)