Skip to content

Commit

Permalink
Remove sleep and replace to refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Oct 27, 2023
1 parent 1370f47 commit 6dbae2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/heatzy/climate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Climate sensors for Heatzy."""
from __future__ import annotations

import asyncio
import logging
from typing import Any

Expand Down Expand Up @@ -237,7 +236,7 @@ async def async_turn_on(self) -> None:
}
},
)
await asyncio.sleep(5)
await self.coordinator.async_request_refresh()
await self.coordinator.api.async_control_device(
self.unique_id,
{CONF_ATTRS: {CONF_MODE: self.HA_TO_HEATZY_STATE[PRESET_COMFORT]}},
Expand All @@ -263,7 +262,7 @@ async def async_turn_off(self) -> None:
}
},
)
await asyncio.sleep(5)
await self.coordinator.async_request_refresh()
await self.coordinator.api.async_control_device(
self.unique_id,
{CONF_ATTRS: {CONF_MODE: self.HEATZY_STOP}},
Expand Down

0 comments on commit 6dbae2e

Please sign in to comment.