mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Fix daikin entities not refreshing quickly (#128230)
* Fix daikin entities not refreshing quickly * Update homeassistant/components/daikin/switch.py --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
5a8fa6cf38
commit
d66d87d271
@ -159,6 +159,7 @@ class DaikinClimate(DaikinEntity, ClimateEntity):
|
||||
|
||||
if values:
|
||||
await self.device.set(values)
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
@ -261,6 +262,7 @@ class DaikinClimate(DaikinEntity, ClimateEntity):
|
||||
await self.device.set_advanced_mode(
|
||||
HA_PRESET_TO_DAIKIN[PRESET_ECO], ATTR_STATE_OFF
|
||||
)
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
@property
|
||||
def preset_modes(self) -> list[str]:
|
||||
@ -275,9 +277,11 @@ class DaikinClimate(DaikinEntity, ClimateEntity):
|
||||
async def async_turn_on(self) -> None:
|
||||
"""Turn device on."""
|
||||
await self.device.set({})
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
async def async_turn_off(self) -> None:
|
||||
"""Turn device off."""
|
||||
await self.device.set(
|
||||
{HA_ATTR_TO_DAIKIN[ATTR_HVAC_MODE]: HA_STATE_TO_DAIKIN[HVACMode.OFF]}
|
||||
)
|
||||
await self.coordinator.async_refresh()
|
||||
|
@ -63,10 +63,12 @@ class DaikinZoneSwitch(DaikinEntity, SwitchEntity):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the zone on."""
|
||||
await self.device.set_zone(self._zone_id, "zone_onoff", "1")
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn the zone off."""
|
||||
await self.device.set_zone(self._zone_id, "zone_onoff", "0")
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
|
||||
class DaikinStreamerSwitch(DaikinEntity, SwitchEntity):
|
||||
@ -88,10 +90,12 @@ class DaikinStreamerSwitch(DaikinEntity, SwitchEntity):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the zone on."""
|
||||
await self.device.set_streamer("on")
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn the zone off."""
|
||||
await self.device.set_streamer("off")
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
|
||||
class DaikinToggleSwitch(DaikinEntity, SwitchEntity):
|
||||
@ -112,7 +116,9 @@ class DaikinToggleSwitch(DaikinEntity, SwitchEntity):
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the zone on."""
|
||||
await self.device.set({})
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn the zone off."""
|
||||
await self.device.set({DAIKIN_ATTR_MODE: "off"})
|
||||
await self.coordinator.async_refresh()
|
||||
|
Loading…
x
Reference in New Issue
Block a user