mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add entity translations to Tautulli (#96239)
This commit is contained in:
parent
2b3a379b8e
commit
c2d66cc14a
@ -61,14 +61,14 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:plex",
|
icon="mdi:plex",
|
||||||
key="watching_count",
|
key="watching_count",
|
||||||
name="Watching",
|
translation_key="watching_count",
|
||||||
native_unit_of_measurement="Watching",
|
native_unit_of_measurement="Watching",
|
||||||
value_fn=lambda home_stats, activity, _: cast(int, activity.stream_count),
|
value_fn=lambda home_stats, activity, _: cast(int, activity.stream_count),
|
||||||
),
|
),
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:plex",
|
icon="mdi:plex",
|
||||||
key="stream_count_direct_play",
|
key="stream_count_direct_play",
|
||||||
name="Direct plays",
|
translation_key="stream_count_direct_play",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
native_unit_of_measurement="Streams",
|
native_unit_of_measurement="Streams",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -79,7 +79,7 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:plex",
|
icon="mdi:plex",
|
||||||
key="stream_count_direct_stream",
|
key="stream_count_direct_stream",
|
||||||
name="Direct streams",
|
translation_key="stream_count_direct_stream",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
native_unit_of_measurement="Streams",
|
native_unit_of_measurement="Streams",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -90,7 +90,7 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:plex",
|
icon="mdi:plex",
|
||||||
key="stream_count_transcode",
|
key="stream_count_transcode",
|
||||||
name="Transcodes",
|
translation_key="stream_count_transcode",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
native_unit_of_measurement="Streams",
|
native_unit_of_measurement="Streams",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -100,7 +100,7 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
key="total_bandwidth",
|
key="total_bandwidth",
|
||||||
name="Total bandwidth",
|
translation_key="total_bandwidth",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
native_unit_of_measurement=UnitOfInformation.KILOBITS,
|
native_unit_of_measurement=UnitOfInformation.KILOBITS,
|
||||||
device_class=SensorDeviceClass.DATA_SIZE,
|
device_class=SensorDeviceClass.DATA_SIZE,
|
||||||
@ -109,7 +109,7 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
key="lan_bandwidth",
|
key="lan_bandwidth",
|
||||||
name="LAN bandwidth",
|
translation_key="lan_bandwidth",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
native_unit_of_measurement=UnitOfInformation.KILOBITS,
|
native_unit_of_measurement=UnitOfInformation.KILOBITS,
|
||||||
device_class=SensorDeviceClass.DATA_SIZE,
|
device_class=SensorDeviceClass.DATA_SIZE,
|
||||||
@ -119,7 +119,7 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
key="wan_bandwidth",
|
key="wan_bandwidth",
|
||||||
name="WAN bandwidth",
|
translation_key="wan_bandwidth",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
native_unit_of_measurement=UnitOfInformation.KILOBITS,
|
native_unit_of_measurement=UnitOfInformation.KILOBITS,
|
||||||
device_class=SensorDeviceClass.DATA_SIZE,
|
device_class=SensorDeviceClass.DATA_SIZE,
|
||||||
@ -130,21 +130,21 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:movie-open",
|
icon="mdi:movie-open",
|
||||||
key="top_movies",
|
key="top_movies",
|
||||||
name="Top movie",
|
translation_key="top_movies",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=get_top_stats,
|
value_fn=get_top_stats,
|
||||||
),
|
),
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:television",
|
icon="mdi:television",
|
||||||
key="top_tv",
|
key="top_tv",
|
||||||
name="Top TV show",
|
translation_key="top_tv",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=get_top_stats,
|
value_fn=get_top_stats,
|
||||||
),
|
),
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
icon="mdi:walk",
|
icon="mdi:walk",
|
||||||
key=ATTR_TOP_USER,
|
key=ATTR_TOP_USER,
|
||||||
name="Top user",
|
translation_key="top_user",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=get_top_stats,
|
value_fn=get_top_stats,
|
||||||
),
|
),
|
||||||
@ -169,26 +169,26 @@ SESSION_SENSOR_TYPES: tuple[TautulliSessionSensorEntityDescription, ...] = (
|
|||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
icon="mdi:plex",
|
icon="mdi:plex",
|
||||||
key="state",
|
key="state",
|
||||||
name="State",
|
translation_key="state",
|
||||||
value_fn=lambda session: cast(str, session.state),
|
value_fn=lambda session: cast(str, session.state),
|
||||||
),
|
),
|
||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
key="full_title",
|
key="full_title",
|
||||||
name="Full title",
|
translation_key="full_title",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda session: cast(str, session.full_title),
|
value_fn=lambda session: cast(str, session.full_title),
|
||||||
),
|
),
|
||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
icon="mdi:progress-clock",
|
icon="mdi:progress-clock",
|
||||||
key="progress",
|
key="progress",
|
||||||
name="Progress",
|
translation_key="progress",
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda session: cast(str, session.progress_percent),
|
value_fn=lambda session: cast(str, session.progress_percent),
|
||||||
),
|
),
|
||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
key="stream_resolution",
|
key="stream_resolution",
|
||||||
name="Stream resolution",
|
translation_key="stream_resolution",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda session: cast(str, session.stream_video_resolution),
|
value_fn=lambda session: cast(str, session.stream_video_resolution),
|
||||||
@ -196,21 +196,21 @@ SESSION_SENSOR_TYPES: tuple[TautulliSessionSensorEntityDescription, ...] = (
|
|||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
icon="mdi:plex",
|
icon="mdi:plex",
|
||||||
key="transcode_decision",
|
key="transcode_decision",
|
||||||
name="Transcode decision",
|
translation_key="transcode_decision",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda session: cast(str, session.transcode_decision),
|
value_fn=lambda session: cast(str, session.transcode_decision),
|
||||||
),
|
),
|
||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
key="session_thumb",
|
key="session_thumb",
|
||||||
name="session thumbnail",
|
translation_key="session_thumb",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda session: cast(str, session.user_thumb),
|
value_fn=lambda session: cast(str, session.user_thumb),
|
||||||
),
|
),
|
||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
key="video_resolution",
|
key="video_resolution",
|
||||||
name="Video resolution",
|
translation_key="video_resolution",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda session: cast(str, session.video_resolution),
|
value_fn=lambda session: cast(str, session.video_resolution),
|
||||||
|
@ -26,5 +26,60 @@
|
|||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]",
|
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]",
|
||||||
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
|
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"watching_count": {
|
||||||
|
"name": "Watching"
|
||||||
|
},
|
||||||
|
"stream_count_direct_play": {
|
||||||
|
"name": "Direct plays"
|
||||||
|
},
|
||||||
|
"stream_count_direct_stream": {
|
||||||
|
"name": "Direct streams"
|
||||||
|
},
|
||||||
|
"stream_count_transcode": {
|
||||||
|
"name": "Transcodes"
|
||||||
|
},
|
||||||
|
"total_bandwidth": {
|
||||||
|
"name": "Total bandwidth"
|
||||||
|
},
|
||||||
|
"lan_bandwidth": {
|
||||||
|
"name": "LAN bandwidth"
|
||||||
|
},
|
||||||
|
"wan_bandwidth": {
|
||||||
|
"name": "WAN bandwidth"
|
||||||
|
},
|
||||||
|
"top_movies": {
|
||||||
|
"name": "Top movie"
|
||||||
|
},
|
||||||
|
"top_tv": {
|
||||||
|
"name": "Top TV show"
|
||||||
|
},
|
||||||
|
"top_user": {
|
||||||
|
"name": "Top user"
|
||||||
|
},
|
||||||
|
"state": {
|
||||||
|
"name": "State"
|
||||||
|
},
|
||||||
|
"full_title": {
|
||||||
|
"name": "Full title"
|
||||||
|
},
|
||||||
|
"progress": {
|
||||||
|
"name": "Progress"
|
||||||
|
},
|
||||||
|
"stream_resolution": {
|
||||||
|
"name": "Stream resolution"
|
||||||
|
},
|
||||||
|
"transcode_decision": {
|
||||||
|
"name": "Transcode decision"
|
||||||
|
},
|
||||||
|
"session_thumb": {
|
||||||
|
"name": "Session thumbnail"
|
||||||
|
},
|
||||||
|
"video_resolution": {
|
||||||
|
"name": "Video resolution"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user