Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reset mower blades button #187

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2"
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
Loading