Skip to content

Commit

Permalink
Use HA 2023.4 translation_key for state translations
Browse files Browse the repository at this point in the history
  • Loading branch information
amosyuen committed Apr 5, 2023
1 parent 91eab5f commit deb9c31
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion custom_components/epson_projector_link/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/amosyuen/ha-epson-projector-link/issues",
"requirements": ["pyserial_asyncio>=0.4", "async_timeout>=3.0.0"],
"version": "0.0.0"
"version": "1.0.0"
}
1 change: 1 addition & 0 deletions custom_components/epson_projector_link/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def __init__(
self._attr_source_list = None
self._attr_state = None
self._attr_supported_features = _get_supported_features(poll_properties)
self._attr_translation_key = "projector"

projector.set_callback(self._callback)

Expand Down
14 changes: 9 additions & 5 deletions custom_components/epson_projector_link/strings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"state": {
"entity": {
"media_player": {
"cooldown": "Cooldown",
"on": "[%key:common::state::on%]",
"off": "[%key:common::state::off%]",
"warmup": "Warmup"
"projector": {
"state": {
"cooldown": "Cooldown",
"on": "On",
"off": "Off",
"warmup": "Warmup"
}
}
}
},
"config": {
Expand Down
14 changes: 9 additions & 5 deletions custom_components/epson_projector_link/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"state": {
"entity": {
"media_player": {
"cooldown": "Cooldown",
"on": "On",
"off": "Off",
"warmup": "Warmup"
"projector": {
"state": {
"cooldown": "Cooldown",
"on": "On",
"off": "Off",
"warmup": "Warmup"
}
}
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Epson Projector Link",
"hacs": "1.6.0",
"homeassistant": "0.118.0",
"homeassistant": "2023.4.0",
"render_readme": true
}

0 comments on commit deb9c31

Please sign in to comment.