From ad75ef40421c35a47a4497d8a156c8f6afc4a032 Mon Sep 17 00:00:00 2001 From: Gh0stExp10it Date: Wed, 8 Jan 2025 19:42:35 +0100 Subject: [PATCH] fix: mediaplayer attribute error --- plugin/homeassistant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/homeassistant.py b/plugin/homeassistant.py index a88a5b0..436fda1 100644 --- a/plugin/homeassistant.py +++ b/plugin/homeassistant.py @@ -324,7 +324,7 @@ def __init__(self, client: Client, entity: dict) -> None: getattr(self, source).__doc__ = 'Set Source to "{}"'.format(source) getattr(self, source).icon = "radiobox-blank" current_source = self.attributes.get("source") - if current_source: + if current_source and current_source in self.attributes.get("source_list", []): getattr(self, current_source).icon = "radiobox-marked" getattr(self, current_source).__doc__ = "Currently selected Source."