Skip to content

Commit 43e64f1

Browse files
committed
async
1 parent cf6bb9a commit 43e64f1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

openevsehttp/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ def state(self):
6969
return self._state
7070

7171
@state.setter
72-
def state(self, value):
72+
async def state(self, value):
7373
"""Set the state."""
7474
self._state = value
7575
_LOGGER.debug("Websocket %s", value)
76-
self.callback(SIGNAL_CONNECTION_STATE, value, self._error_reason)
76+
await self.callback(SIGNAL_CONNECTION_STATE, value, self._error_reason)
7777
self._error_reason = None
7878

7979
@staticmethod
@@ -249,7 +249,7 @@ def _start_listening(self):
249249
self._ws_listening = True
250250
self._loop.run_until_complete(asyncio.gather(*pending))
251251

252-
def _update_status(self, msgtype, data, error):
252+
async def _update_status(self, msgtype, data, error):
253253
"""Update data from websocket listener."""
254254
if msgtype == SIGNAL_CONNECTION_STATE:
255255
if data == STATE_CONNECTED:
@@ -276,7 +276,7 @@ def _update_status(self, msgtype, data, error):
276276
self._status.update(data)
277277

278278
if self.callback is not None:
279-
self.callback(self)
279+
await self.callback(self)
280280

281281
def ws_disconnect(self) -> None:
282282
"""Disconnect the websocket listener."""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
PROJECT_DIR = Path(__file__).parent.resolve()
77
README_FILE = PROJECT_DIR / "README.md"
8-
VERSION = "0.1.8-24"
8+
VERSION = "0.1.8-25"
99

1010

1111
setup(

0 commit comments

Comments
 (0)