mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Fix Kodi reconnection after websocket disconnect (#8704)
This commit is contained in:
parent
431a381c8d
commit
e992527c68
@ -353,7 +353,7 @@ class KodiDevice(MediaPlayerDevice):
|
||||
self._properties = {}
|
||||
self._item = {}
|
||||
self._app_properties = {}
|
||||
self.hass.async_add_job(self.async_update_ha_state())
|
||||
self.hass.async_add_job(self._ws_server.close())
|
||||
|
||||
@asyncio.coroutine
|
||||
def _get_players(self):
|
||||
@ -402,6 +402,8 @@ class KodiDevice(MediaPlayerDevice):
|
||||
# Kodi abruptly ends ws connection when exiting. We will try
|
||||
# to reconnect on the next poll.
|
||||
pass
|
||||
# Update HA state after Kodi disconnects
|
||||
self.hass.async_add_job(self.async_update_ha_state())
|
||||
|
||||
# Create a task instead of adding a tracking job, since this task will
|
||||
# run until the websocket connection is closed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user