Fix Bravia TV refreshing zero volume level (#87318)

fixes undefined
pull/87339/head^2
Artem Draft 2023-02-04 01:22:33 +03:00 committed by GitHub
parent ca1a12898c
commit 3ccd0ef013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ class BraviaTVCoordinator(DataUpdateCoordinator[None]):
async def async_update_volume(self) -> None:
"""Update volume information."""
volume_info = await self.client.get_volume_info()
if volume_level := volume_info.get("volume"):
if (volume_level := volume_info.get("volume")) is not None:
self.volume_level = volume_level / 100
self.volume_muted = volume_info.get("mute", False)
self.volume_target = volume_info.get("target")