Use built in config entry from coordinator in HomeWizard (#102959)
This commit is contained in:
parent
94e192db12
commit
b7667d44fd
8 changed files with 30 additions and 32 deletions
|
@ -21,7 +21,7 @@ async def async_setup_entry(
|
|||
"""Set up numbers for device."""
|
||||
coordinator: HWEnergyDeviceUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||
if coordinator.supports_state():
|
||||
async_add_entities([HWEnergyNumberEntity(coordinator, entry)])
|
||||
async_add_entities([HWEnergyNumberEntity(coordinator)])
|
||||
|
||||
|
||||
class HWEnergyNumberEntity(HomeWizardEntity, NumberEntity):
|
||||
|
@ -35,11 +35,12 @@ class HWEnergyNumberEntity(HomeWizardEntity, NumberEntity):
|
|||
def __init__(
|
||||
self,
|
||||
coordinator: HWEnergyDeviceUpdateCoordinator,
|
||||
entry: ConfigEntry,
|
||||
) -> None:
|
||||
"""Initialize the control number."""
|
||||
super().__init__(coordinator)
|
||||
self._attr_unique_id = f"{entry.unique_id}_status_light_brightness"
|
||||
self._attr_unique_id = (
|
||||
f"{coordinator.config_entry.unique_id}_status_light_brightness"
|
||||
)
|
||||
|
||||
@homewizard_exception_handler
|
||||
async def async_set_native_value(self, value: float) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue