Skip to content

Commit

Permalink
feat: add reset mower blades button (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
geertmeersman authored Jul 26, 2024
2 parents 8e5b664 + 2e45306 commit 11daf5e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions custom_components/robonect/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class RobonectButtonEntityDescription(ButtonEntityDescription):
params={"reset": 1},
category="NONE",
),
RobonectButtonEntityDescription(
key="blades_reset",
icon="mdi:backup-restore",
cmd="reset_blades",
category="NONE",
),
RobonectButtonEntityDescription(
key="home",
icon="mdi:home-import-outline",
Expand Down
5 changes: 3 additions & 2 deletions custom_components/robonect/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ async def async_send_command(
try:
response = await self.coordinator.client.async_cmd(command, params)
except Exception as exception:
response = {"successful": False, "exception": f"{exception}"}
_LOGGER.error(f"Exception during async command execution: {exception}")
response = {"successful": False, "exception": str(exception)}
await self.async_fire_event(
response | {"command": command, "params": params}
{**response, "command": command, "params": params}
)
elif self.entry.data[CONF_MQTT_ENABLED] is True and "topic" in kwargs:
_LOGGER.debug(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/robonect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"automower/mqtt"
],
"requirements": [
"aiorobonect>=1.0.8",
"aiorobonect>=1.1.3",
"jsonpath"
],
"version": "v1.7.3"
Expand Down
3 changes: 3 additions & 0 deletions custom_components/robonect/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@
"error_reset": {
"name": "Fehler zur\u00fccksetzen"
},
"blades_reset": {
"name": "Messer zur\u00fccksetzen"
},
"start": {
"name": "Start"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/robonect/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@
"error_reset": {
"name": "Reset error"
},
"blades_reset": {
"name": "Reset blades"
},
"start": {
"name": "Start"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/robonect/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@
"error_reset": {
"name": "R\u00e9initialiser l'erreur"
},
"blades_reset": {
"name": "R\u00e9initialiser les lames"
},
"start": {
"name": "D\u00e9marrer"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/robonect/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@
"error_reset": {
"name": "Fout resetten"
},
"blades_reset": {
"name": "Messen resetten"
},
"start": {
"name": "Start"
},
Expand Down

0 comments on commit 11daf5e

Please sign in to comment.