mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
parent
f1dda8ef63
commit
f5b4637da8
@ -40,7 +40,7 @@ async def async_setup_entry(
|
|||||||
"""Set up the Honeywell switches."""
|
"""Set up the Honeywell switches."""
|
||||||
data: HoneywellData = hass.data[DOMAIN][config_entry.entry_id]
|
data: HoneywellData = hass.data[DOMAIN][config_entry.entry_id]
|
||||||
async_add_entities(
|
async_add_entities(
|
||||||
HoneywellSwitch(hass, config_entry, device, description)
|
HoneywellSwitch(data, device, description)
|
||||||
for device in data.devices.values()
|
for device in data.devices.values()
|
||||||
if device.raw_ui_data.get("SwitchEmergencyHeatAllowed")
|
if device.raw_ui_data.get("SwitchEmergencyHeatAllowed")
|
||||||
for description in SWITCH_TYPES
|
for description in SWITCH_TYPES
|
||||||
@ -54,13 +54,12 @@ class HoneywellSwitch(SwitchEntity):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hass: HomeAssistant,
|
honeywell_data: HoneywellData,
|
||||||
config_entry: ConfigEntry,
|
|
||||||
device: SomeComfortDevice,
|
device: SomeComfortDevice,
|
||||||
description: SwitchEntityDescription,
|
description: SwitchEntityDescription,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the switch."""
|
"""Initialize the switch."""
|
||||||
self._data = hass.data[DOMAIN][config_entry.entry_id]
|
self._data = honeywell_data
|
||||||
self._device = device
|
self._device = device
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
self._attr_unique_id = f"{device.deviceid}_{description.key}"
|
self._attr_unique_id = f"{device.deviceid}_{description.key}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user