expanded feature set

This commit is contained in:
2026-02-23 21:16:21 -06:00
parent e1ba4ad727
commit f86d2fec4a
7 changed files with 434 additions and 35 deletions
+11 -1
View File
@@ -18,7 +18,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DATA_API, DATA_COORDINATOR, DOMAIN
from .const import DATA_API, DATA_COORDINATOR, DATA_LAST_SNAPSHOT_URL, DOMAIN
def _num(v: Any) -> Optional[float]:
@@ -222,6 +222,16 @@ class RelayTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
return t.replace(tzinfo=timezone.utc)
return t
@property
def extra_state_attributes(self) -> dict[str, Any]:
attrs: dict[str, Any] = {}
store = self.hass.data.get(DOMAIN, {}).get(self._entry.entry_id, {})
snapshot_url = store.get(DATA_LAST_SNAPSHOT_URL)
if snapshot_url:
attrs["snapshot_url"] = snapshot_url
return attrs
@property
def entity_picture(self) -> Optional[str]:
v = _parse_status(self.coordinator.data)