1 """The Keenetic Client class."""
4 BinarySensorDeviceClass,
12 from .
import KeeneticRouter
13 from .const
import DOMAIN, ROUTER
18 config_entry: ConfigEntry,
19 async_add_entities: AddEntitiesCallback,
21 """Set up device tracker for Keenetic NDMS2 component."""
22 router: KeeneticRouter = hass.data[DOMAIN][config_entry.entry_id][ROUTER]
28 """Representation router connection status."""
30 _attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
31 _attr_should_poll =
False
32 _attr_has_entity_name =
True
34 def __init__(self, router: KeeneticRouter) ->
None:
35 """Initialize the APCUPSd binary device."""
42 """Return true if the UPS is online, else false."""
43 return self.
_router_router.available
46 """Client entity created."""
50 self.
_router_router.signal_update,
None async_added_to_hass(self)
None __init__(self, KeeneticRouter router)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)