mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Fix Kodi reconnection after websocket disconnect (#8704)
This commit is contained in:
parent
f9e8d4237d
commit
2a09ac017f
@ -361,7 +361,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):
|
||||
@ -410,6 +410,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