Add icon translation to Jellyfin (#108559)

This commit is contained in:
Jan Rieger 2024-01-21 13:30:03 +01:00 committed by GitHub
parent 5c0a67a3d2
commit 969ee5dd9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -0,0 +1,9 @@
{
"entity": {
"sensor": {
"watching": {
"default": "mdi:television-play"
}
}
}
}

View file

@ -42,8 +42,8 @@ def _count_now_playing(data: JellyfinDataT) -> int:
SENSOR_TYPES: dict[str, JellyfinSensorEntityDescription] = {
"sessions": JellyfinSensorEntityDescription(
key="watching",
translation_key="watching",
name=None,
icon="mdi:television-play",
native_unit_of_measurement="Watching",
value_fn=_count_now_playing,
)

View file

@ -27,7 +27,7 @@ async def test_watching(
assert state
assert state.attributes.get(ATTR_DEVICE_CLASS) is None
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "JELLYFIN-SERVER"
assert state.attributes.get(ATTR_ICON) == "mdi:television-play"
assert state.attributes.get(ATTR_ICON) is None
assert state.attributes.get(ATTR_STATE_CLASS) is None
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "Watching"
assert state.state == "3"