@@ -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."""
0 commit comments