Log SamsungTV state changes (#71989)
This commit is contained in:
parent
c10d456d11
commit
7da9cac1f8
1 changed files with 3 additions and 0 deletions
|
@ -197,12 +197,15 @@ class SamsungTVDevice(MediaPlayerEntity):
|
||||||
"""Update state of device."""
|
"""Update state of device."""
|
||||||
if self._auth_failed or self.hass.is_stopping:
|
if self._auth_failed or self.hass.is_stopping:
|
||||||
return
|
return
|
||||||
|
old_state = self._attr_state
|
||||||
if self._power_off_in_progress():
|
if self._power_off_in_progress():
|
||||||
self._attr_state = STATE_OFF
|
self._attr_state = STATE_OFF
|
||||||
else:
|
else:
|
||||||
self._attr_state = (
|
self._attr_state = (
|
||||||
STATE_ON if await self._bridge.async_is_on() else STATE_OFF
|
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._attr_state != STATE_ON:
|
||||||
if self._dmr_device and self._dmr_device.is_subscribed:
|
if self._dmr_device and self._dmr_device.is_subscribed:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue