Add icon translation to Jellyfin (#108559)
This commit is contained in:
parent
5c0a67a3d2
commit
969ee5dd9f
3 changed files with 11 additions and 2 deletions
9
homeassistant/components/jellyfin/icons.json
Normal file
9
homeassistant/components/jellyfin/icons.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"watching": {
|
||||
"default": "mdi:television-play"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
)
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue