1 """Entity to track connections to websocket API."""
3 from __future__
import annotations
13 SIGNAL_WEBSOCKET_CONNECTED,
14 SIGNAL_WEBSOCKET_DISCONNECTED,
21 async_add_entities: AddEntitiesCallback,
22 discovery_info: DiscoveryInfoType |
None =
None,
24 """Set up the API streams platform."""
31 """Entity to represent how many people are connected to the stream API."""
33 _attr_name =
"Connected clients"
34 _attr_native_unit_of_measurement =
"clients"
37 """Initialize the API count."""
41 """Handle addition to hass."""
None async_added_to_hass(self)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)