1 """WiZ integration entities."""
3 from __future__
import annotations
5 from abc
import abstractmethod
8 from pywizlight.bulblibrary
import BulbType
16 DataUpdateCoordinator,
19 from .models
import WizData
23 """Representation of WiZ entity."""
25 _attr_has_entity_name =
True
27 def __init__(self, wiz_data: WizData, name: str) ->
None:
28 """Initialize a WiZ entity."""
29 super().
__init__(wiz_data.coordinator)
31 bulb_type: BulbType = self.
_device_device.bulbtype
34 connections={(CONNECTION_NETWORK_MAC, self.
_device_device.mac)},
37 sw_version=bulb_type.fw_version,
39 if bulb_type.name
is None:
41 hw_data = bulb_type.name.split(
"_")
42 board = hw_data.pop(0)
43 model = hw_data.pop(0)
44 hw_version = f
"{board} {hw_data[0]}" if hw_data
else board
50 """Handle updated data from the coordinator."""
57 """Handle updating _attr values."""
60 class WizToggleEntity(WizEntity, ToggleEntity):
61 """Representation of WiZ toggle entity."""
65 """Handle updating _attr values."""
69 """Instruct the device to turn off."""
None _handle_coordinator_update(self)
None __init__(self, WizData wiz_data, str name)
None _async_update_attrs(self)
None async_turn_off(self, **Any kwargs)
None _async_update_attrs(self)
None turn_off(self, **Any kwargs)
None async_request_refresh(self)