Address late review in Honeywell (#115702)

Pass honeywell_data
This commit is contained in:
mkmer 2024-04-29 10:16:46 -04:00 committed by GitHub
parent f1dda8ef63
commit f5b4637da8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,7 @@ async def async_setup_entry(
"""Set up the Honeywell switches."""
data: HoneywellData = hass.data[DOMAIN][config_entry.entry_id]
async_add_entities(
HoneywellSwitch(hass, config_entry, device, description)
HoneywellSwitch(data, device, description)
for device in data.devices.values()
if device.raw_ui_data.get("SwitchEmergencyHeatAllowed")
for description in SWITCH_TYPES
@ -54,13 +54,12 @@ class HoneywellSwitch(SwitchEntity):
def __init__(
self,
hass: HomeAssistant,
config_entry: ConfigEntry,
honeywell_data: HoneywellData,
device: SomeComfortDevice,
description: SwitchEntityDescription,
) -> None:
"""Initialize the switch."""
self._data = hass.data[DOMAIN][config_entry.entry_id]
self._data = honeywell_data
self._device = device
self.entity_description = description
self._attr_unique_id = f"{device.deviceid}_{description.key}"