mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Add translated native unit of measurement - squeezebox (#131912)
This commit is contained in:
parent
584bb7bca8
commit
56ec70815c
@ -33,12 +33,10 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_INFO_TOTAL_ALBUMS,
|
key=STATUS_SENSOR_INFO_TOTAL_ALBUMS,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
native_unit_of_measurement="albums",
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_INFO_TOTAL_ARTISTS,
|
key=STATUS_SENSOR_INFO_TOTAL_ARTISTS,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
native_unit_of_measurement="artists",
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_INFO_TOTAL_DURATION,
|
key=STATUS_SENSOR_INFO_TOTAL_DURATION,
|
||||||
@ -49,12 +47,10 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_INFO_TOTAL_GENRES,
|
key=STATUS_SENSOR_INFO_TOTAL_GENRES,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
native_unit_of_measurement="genres",
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_INFO_TOTAL_SONGS,
|
key=STATUS_SENSOR_INFO_TOTAL_SONGS,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
native_unit_of_measurement="songs",
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_LASTSCAN,
|
key=STATUS_SENSOR_LASTSCAN,
|
||||||
@ -63,13 +59,11 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_PLAYER_COUNT,
|
key=STATUS_SENSOR_PLAYER_COUNT,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
native_unit_of_measurement="players",
|
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=STATUS_SENSOR_OTHER_PLAYER_COUNT,
|
key=STATUS_SENSOR_OTHER_PLAYER_COUNT,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL,
|
||||||
entity_registry_visible_default=False,
|
entity_registry_visible_default=False,
|
||||||
native_unit_of_measurement="players",
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -76,25 +76,31 @@
|
|||||||
"name": "Last scan"
|
"name": "Last scan"
|
||||||
},
|
},
|
||||||
"info_total_albums": {
|
"info_total_albums": {
|
||||||
"name": "Total albums"
|
"name": "Total albums",
|
||||||
|
"unit_of_measurement": "albums"
|
||||||
},
|
},
|
||||||
"info_total_artists": {
|
"info_total_artists": {
|
||||||
"name": "Total artists"
|
"name": "Total artists",
|
||||||
|
"unit_of_measurement": "artists"
|
||||||
},
|
},
|
||||||
"info_total_duration": {
|
"info_total_duration": {
|
||||||
"name": "Total duration"
|
"name": "Total duration"
|
||||||
},
|
},
|
||||||
"info_total_genres": {
|
"info_total_genres": {
|
||||||
"name": "Total genres"
|
"name": "Total genres",
|
||||||
|
"unit_of_measurement": "genres"
|
||||||
},
|
},
|
||||||
"info_total_songs": {
|
"info_total_songs": {
|
||||||
"name": "Total songs"
|
"name": "Total songs",
|
||||||
|
"unit_of_measurement": "songs"
|
||||||
},
|
},
|
||||||
"player_count": {
|
"player_count": {
|
||||||
"name": "Player count"
|
"name": "Player count",
|
||||||
|
"unit_of_measurement": "players"
|
||||||
},
|
},
|
||||||
"other_player_count": {
|
"other_player_count": {
|
||||||
"name": "Player count off service"
|
"name": "Player count off service",
|
||||||
|
"unit_of_measurement": "[%key:component::squeezebox::entity::sensor::player_count::unit_of_measurement%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user