Fix Kodi on/off status (#117436)
* Fix Kodi Issue 104603 Fixes issue, that Kodi media player is displayed as online even when offline. The issue occurrs when using HTTP(S) only (no web Socket) integration after kodi was found online once. Issue: In async_update the connection exceptions from self._kodi.get_players are not catched and therefore self._players (and the like) are not reset. The call of self._connection.connected returns always true for HTTP(S) connections. Solution: Catch Exceptions from self._kodi.get_players und reset state in case of HTTP(S) only connection. Otherwise keep current behaviour. * Fix Kodi Issue 104603 / code style adjustments as requestedpull/117588/head
parent
641754e0bb
commit
0df9006bf7
|
@ -480,7 +480,13 @@ class KodiEntity(MediaPlayerEntity):
|
|||
self._reset_state()
|
||||
return
|
||||
|
||||
self._players = await self._kodi.get_players()
|
||||
try:
|
||||
self._players = await self._kodi.get_players()
|
||||
except (TransportError, ProtocolError):
|
||||
if not self._connection.can_subscribe:
|
||||
self._reset_state()
|
||||
return
|
||||
raise
|
||||
|
||||
if self._kodi_is_off:
|
||||
self._reset_state()
|
||||
|
|
Loading…
Reference in New Issue