mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-09 11:51:58 -04:00
Fix climate not available #52
This commit is contained in:
parent
29238d3d08
commit
d963086dbf
9 changed files with 13 additions and 25 deletions
|
@ -56,8 +56,8 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
|
|||
for description in descriptions:
|
||||
if description.key not in list(device.commands):
|
||||
continue
|
||||
appliances.extend(
|
||||
[HonClimateEntity(hass, coordinator, entry, device, description)]
|
||||
appliances.append(
|
||||
HonClimateEntity(hass, coordinator, entry, device, description)
|
||||
)
|
||||
async_add_entities(appliances)
|
||||
|
||||
|
@ -67,10 +67,7 @@ class HonClimateEntity(HonEntity, ClimateEntity):
|
|||
self, hass, coordinator, entry, device: HonAppliance, description
|
||||
) -> None:
|
||||
super().__init__(hass, entry, coordinator, device)
|
||||
self._coordinator = coordinator
|
||||
self._device = device
|
||||
self.entity_description = description
|
||||
self._hass = hass
|
||||
self._attr_unique_id = f"{super().unique_id}climate"
|
||||
|
||||
self._attr_temperature_unit = TEMP_CELSIUS
|
||||
|
@ -96,7 +93,7 @@ class HonClimateEntity(HonEntity, ClimateEntity):
|
|||
| ClimateEntityFeature.SWING_MODE
|
||||
)
|
||||
|
||||
self._handle_coordinator_update()
|
||||
self._handle_coordinator_update(update=False)
|
||||
|
||||
async def async_set_hvac_mode(self, hvac_mode):
|
||||
if hvac_mode == HVACMode.OFF:
|
||||
|
@ -161,4 +158,5 @@ class HonClimateEntity(HonEntity, ClimateEntity):
|
|||
self._attr_swing_mode = SWING_VERTICAL
|
||||
else:
|
||||
self._attr_swing_mode = SWING_OFF
|
||||
self.async_write_ha_state()
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue