From 97e27851a10a405850be76026db96464dd1fd0c3 Mon Sep 17 00:00:00 2001 From: definitio <37266727+definitio@users.noreply.github.com> Date: Fri, 21 Aug 2020 23:26:22 +0400 Subject: [PATCH] Fix state reporting --- custom_components/sox/media_player.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/sox/media_player.py b/custom_components/sox/media_player.py index 6b3a4d8..2ae6d6f 100644 --- a/custom_components/sox/media_player.py +++ b/custom_components/sox/media_player.py @@ -81,6 +81,7 @@ def play_media(self, media_type, media_id, **kwargs): sock = socket(AF_INET, SOCK_STREAM) sock.connect((self._host, self._port)) self._play = True + self.schedule_update_ha_state() sock.sendall("{};".format(media_id).encode()) sock.close() sleep(10)