Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing to async task #104

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions custom_components/casambi/casambi/CasambiController.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Support for Casambi lights.
"""

import logging

import aiocasambi
Expand Down Expand Up @@ -131,15 +132,15 @@ def signalling_callback(self, signal, data):
self.set_all_lights_offline()

_LOGGER.debug("signalling_callback: creating reconnection")
self._hass.loop.create_task(self.async_reconnect())
self._hass.loop.async_create_task(self.async_reconnect())
elif signal == SIGNAL_CONNECTION_STATE and (data == STATE_DISCONNECTED):
_LOGGER.debug("signalling_callback websocket STATE_DISCONNECTED")

# Set all units to offline
self.set_all_lights_offline()

_LOGGER.debug("signalling_callback: creating reconnection")
self._hass.loop.create_task(self.async_reconnect())
self._hass.loop.async_create_task(self.async_reconnect())
elif signal == SIGNAL_UNIT_PULL_UPDATE:
# Update units that is specified
for unit in data:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/casambi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"aiocasambi==0.285"
],
"ssdp": [],
"version": "0.127",
"version": "0.128",
"zeroconf": []
}
Loading