Skip to content

Commit

Permalink
Add translated native unit of measurement - squeezebox (home-assistan…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp authored Dec 2, 2024
1 parent 584bb7b commit 56ec708
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 0 additions & 6 deletions homeassistant/components/squeezebox/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@
SensorEntityDescription(
key=STATUS_SENSOR_INFO_TOTAL_ALBUMS,
state_class=SensorStateClass.TOTAL,
native_unit_of_measurement="albums",
),
SensorEntityDescription(
key=STATUS_SENSOR_INFO_TOTAL_ARTISTS,
state_class=SensorStateClass.TOTAL,
native_unit_of_measurement="artists",
),
SensorEntityDescription(
key=STATUS_SENSOR_INFO_TOTAL_DURATION,
Expand All @@ -49,12 +47,10 @@
SensorEntityDescription(
key=STATUS_SENSOR_INFO_TOTAL_GENRES,
state_class=SensorStateClass.TOTAL,
native_unit_of_measurement="genres",
),
SensorEntityDescription(
key=STATUS_SENSOR_INFO_TOTAL_SONGS,
state_class=SensorStateClass.TOTAL,
native_unit_of_measurement="songs",
),
SensorEntityDescription(
key=STATUS_SENSOR_LASTSCAN,
Expand All @@ -63,13 +59,11 @@
SensorEntityDescription(
key=STATUS_SENSOR_PLAYER_COUNT,
state_class=SensorStateClass.TOTAL,
native_unit_of_measurement="players",
),
SensorEntityDescription(
key=STATUS_SENSOR_OTHER_PLAYER_COUNT,
state_class=SensorStateClass.TOTAL,
entity_registry_visible_default=False,
native_unit_of_measurement="players",
),
)

Expand Down
18 changes: 12 additions & 6 deletions homeassistant/components/squeezebox/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,31 @@
"name": "Last scan"
},
"info_total_albums": {
"name": "Total albums"
"name": "Total albums",
"unit_of_measurement": "albums"
},
"info_total_artists": {
"name": "Total artists"
"name": "Total artists",
"unit_of_measurement": "artists"
},
"info_total_duration": {
"name": "Total duration"
},
"info_total_genres": {
"name": "Total genres"
"name": "Total genres",
"unit_of_measurement": "genres"
},
"info_total_songs": {
"name": "Total songs"
"name": "Total songs",
"unit_of_measurement": "songs"
},
"player_count": {
"name": "Player count"
"name": "Player count",
"unit_of_measurement": "players"
},
"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%]"
}
}
}
Expand Down

0 comments on commit 56ec708

Please sign in to comment.