Skip to content

Commit

Permalink
Align channel name translations with HA standards
Browse files Browse the repository at this point in the history
  • Loading branch information
monty68 committed Jan 1, 2024
1 parent 2af2b8a commit 54bda78
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion custom_components/uniled/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _channel_name(self) -> str | None:
# translations = platform.component_translations
translations = platform.object_id_platform_translations
name_translation_key = (
f"component.{platform.platform_name}.entity.channel.{channel_id}"
f"component.{platform.platform_name}.entity.channel.{channel_id}.name"
)
return translations.get(name_translation_key, self.channel.name)

Expand Down
36 changes: 27 additions & 9 deletions custom_components/uniled/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@
"title": "Universal Light Controller",
"entity": {
"channel": {
"master": "Master",
"channel_1": "Channel 1",
"channel_2": "Channel 2",
"channel_3": "Channel 3",
"channel_4": "Channel 4",
"channel_5": "Channel 5",
"channel_6": "Channel 6",
"channel_7": "Channel 7",
"channel_8": "Channel 8"
"master": {
"name": "Master"
},
"channel_1": {
"name": "Channel 1"
},
"channel_2": {
"name": "Channel 2"
},
"channel_3": {
"name": "Channel 3"
},
"channel_4": {
"name": "Channel 4"
},
"channel_5": {
"name": "Channel 5"
},
"channel_6": {
"name": "Channel 6"
},
"channel_7": {
"name": "Channel 7"
},
"channel_8": {
"name": "Channel 8"
}
},
"scene": {
"scene_0": {
Expand Down

0 comments on commit 54bda78

Please sign in to comment.