def create_api_object(self): """Create a pyControl4 device object. This exists so the director token used is always the latest one, without needing to re-init the entire entity. """ return C4Light(self.entry_data[CONF_DIRECTOR], self._idx)
async def async_added_to_hass(self): """When entity is added to hass.""" await super().async_added_to_hass() self._c4_light = C4Light(self.director, self._idx)