Handle OSError when forcibly turning off media_player.samsungtv (#10997)

This commit is contained in:
Lewis Juggins 2017-12-07 16:30:51 +00:00 committed by GitHub
parent f21da7cfdc
commit 3c1f8cd882
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,7 +190,10 @@ class SamsungTVDevice(MediaPlayerDevice):
else:
self.send_key('KEY_POWEROFF')
# Force closing of remote session to provide instant UI feedback
self.get_remote().close()
try:
self.get_remote().close()
except OSError:
_LOGGER.debug("Could not establish connection.")
def volume_up(self):
"""Volume up the media player."""