Skip to content

Commit

Permalink
Fix deprecated asyncio.wait use with coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak authored Jun 24, 2023
1 parent 5c72969 commit e53c8a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions custom_components/clientraw/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"domain": "clientraw",
"name": "Clientraw",
"version": "2.4.0",
"codeowners": ["@pilotak"],
"dependencies": [],
"documentation": "https://github.com/pilotak/homeassistant-clientraw",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/pilotak/homeassistant-clientraw/issues",
"requirements": [],
"dependencies": [],
"codeowners": ["@pilotak"],
"iot_class": "cloud_polling"
"version": "2.4.1"
}
5 changes: 3 additions & 2 deletions custom_components/clientraw/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
async_call_later)
from homeassistant.util.unit_system import METRIC_SYSTEM

__version__ = '2.4.0'
__version__ = '2.4.1'

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -581,7 +581,8 @@ def try_again(err: str):
# pylint: disable=protected-access
if new_state != dev._state:
dev._state = new_state
tasks.append(dev.async_update_ha_state())
tasks.append(asyncio.create_task(
dev.async_update_ha_state(True)))

if tasks:
await asyncio.wait(tasks)
Expand Down

0 comments on commit e53c8a8

Please sign in to comment.