From 7da9cac1f866a10c25d7ee5e33c7b807182da41c Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 23 May 2022 17:48:41 +0200 Subject: [PATCH] Log SamsungTV state changes (#71989) --- homeassistant/components/samsungtv/media_player.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/samsungtv/media_player.py b/homeassistant/components/samsungtv/media_player.py index 6a884c59a87..cf3bfcd64a1 100644 --- a/homeassistant/components/samsungtv/media_player.py +++ b/homeassistant/components/samsungtv/media_player.py @@ -197,12 +197,15 @@ class SamsungTVDevice(MediaPlayerEntity): """Update state of device.""" if self._auth_failed or self.hass.is_stopping: return + old_state = self._attr_state if self._power_off_in_progress(): self._attr_state = STATE_OFF else: self._attr_state = ( STATE_ON if await self._bridge.async_is_on() else STATE_OFF ) + if self._attr_state != old_state: + LOGGER.debug("TV %s state updated to %s", self._host, self._attr_state) if self._attr_state != STATE_ON: if self._dmr_device and self._dmr_device.is_subscribed: