1 """Support for HLK-SW16 switches."""
10 from .
import DATA_DEVICE_REGISTER
11 from .const
import DOMAIN
12 from .entity
import SW16Entity
18 """Parse configuration and add HLK-SW16 switch devices."""
19 device_client = hass.data[DOMAIN][entry.entry_id][DATA_DEVICE_REGISTER]
22 device_port = f
"{i:01x}"
23 device =
SW16Switch(device_port, entry.entry_id, device_client)
24 devices.append(device)
29 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
31 """Set up the HLK-SW16 platform."""
36 """Representation of a HLK-SW16 switch."""
40 """Return true if device is on."""
44 """Turn the device on."""
48 """Turn the device off."""
None async_turn_off(self, **Any kwargs)
None async_turn_on(self, **Any kwargs)
None turn_off(self, **Any kwargs)
None turn_on(self, **Any kwargs)
def devices_from_entities(hass, entry)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)