Skip to content

Commit

Permalink
Add translation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyroberts committed Nov 15, 2023
1 parent adec825 commit 8355165
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
3 changes: 1 addition & 2 deletions custom_components/wundasmart/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@
"water_heater": {
"wundasmart": {
"state": {
"auto": "Auto",
"auto_on": "On (Auto)",
"auto_off": "Off (Auto)",
"boost_on": "On",
"off": "Off"
"boost_off": "Off"
},
"state_attributes": {
"operation_mode": {
Expand Down
27 changes: 26 additions & 1 deletion custom_components/wundasmart/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@
}
}
}
},
"water_heater": {
"wundasmart": {
"state": {
"auto_on": "On (Auto)",
"auto_off": "Off (Auto)",
"boost_on": "On",
"boost_off": "Off"
},
"state_attributes": {
"operation_mode": {
"state": {
"auto": "Auto",
"boost_30": "Boost (30 mins)",
"boost_60": "Boost (1 hour)",
"boost_90": "Boost (1.5 hours)",
"boost_120": "Boost (2 hours)",
"off_30": "Off (30 mins)",
"off_60": "Off (1 hour)",
"off_90": "Off (1.5 hours)",
"off_120": "Off (2 hours)"
}
}
}
}
}
}
}
}
5 changes: 2 additions & 3 deletions custom_components/wundasmart/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
STATE_AUTO_ON = "auto_on"
STATE_AUTO_OFF = "auto_off"
STATE_BOOST_ON = "boost_on"
STATE_OFF = "boost_off"
STATE_AUTO = "auto"
STATE_BOOST_OFF = "boost_off"

OPERATION_SET_AUTO = "auto"
OPERATION_BOOST_30 = "boost_30"
Expand Down Expand Up @@ -176,7 +175,7 @@ def __update_state(self):
if hw_mode_state:
self._attr_current_operation = STATE_BOOST_ON if hw_boost_state else STATE_AUTO_ON
else:
self._attr_current_operation = STATE_OFF if hw_boost_state else STATE_AUTO_OFF
self._attr_current_operation = STATE_BOOST_OFF if hw_boost_state else STATE_AUTO_OFF

@callback
def _handle_coordinator_update(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ async def test_water_header_boost(hass: HomeAssistant, config):
# Check send_command was called correctly
assert mock.call_count == 1
assert mock.call_args.kwargs["params"]["cmd"] == 3
assert mock.call_args.kwargs["params"]["hw_boost_time"] == 600
assert mock.call_args.kwargs["params"]["hw_boost_time"] == 600

0 comments on commit 8355165

Please sign in to comment.