expanded feature set
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user