Skip to content

Commit e439640

Browse files
committed
fix: reduce logs and entity updates when using Chromecast feature
1 parent da14206 commit e439640

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/driver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ async def handle_android_tv_update(atv_id: str, update: dict[str, Any]) -> None:
207207
)
208208

209209
for configured_entity in _configured_entities_from_device(atv_id):
210-
_LOG.info("[%s] update configured entity %s", atv_id, configured_entity.id)
211210
if isinstance(
212211
configured_entity,
213212
(

src/tv.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -933,21 +933,21 @@ async def _handle_new_media_status(self, status: MediaStatus):
933933
self._clear_media_information()
934934

935935
if status.album_name != self._media_album:
936+
self._media_album = status.album_name
936937
# an empty string is required to clear the information in the integration-API!
937938
# None translates to null in JSON, which means "no update" in the UI.
938-
self._media_album = status.album_name or ""
939-
update[MediaAttr.MEDIA_ALBUM] = self._media_album
939+
update[MediaAttr.MEDIA_ALBUM] = self._media_album or ""
940940

941941
if status.artist != self._media_artist:
942-
self._media_artist = status.artist or ""
943-
update[MediaAttr.MEDIA_ARTIST] = self._media_artist
942+
self._media_artist = status.artist
943+
update[MediaAttr.MEDIA_ARTIST] = self._media_artist or ""
944944

945945
if status.title != self._media_title:
946946
current_title = self.media_title
947-
self._media_title = status.title or ""
947+
self._media_title = status.title
948948
if current_title != self.media_title:
949949
_LOG.debug("[%s] Chromecast Media info updated : %s", self.log_id, status)
950-
update[MediaAttr.MEDIA_TITLE] = self.media_title
950+
update[MediaAttr.MEDIA_TITLE] = self.media_title or ""
951951

952952
current_time = int(status.current_time) if status.current_time else 0
953953
duration = int(status.duration) if status.duration else 0

0 commit comments

Comments
 (0)