Skip to content

Commit

Permalink
Set mower to idle state upon reaching daily limit (#181)
Browse files Browse the repository at this point in the history
In accordance with the GARDENA Operator's Manual, distinct mower models have varying maximum work capacity that either is defined by a minimum daily standby time or a maximum cutting time within a day.

Previously, upon reaching the daily limit, the mower's state was set to error, which implied a need for manual intervention to rectify the situation. However, the daily limit reached, is only a temporary state and resets automatically at midnight and eliminating the need for manual intervention.
  • Loading branch information
Jogge committed Feb 10, 2024
1 parent c37ae34 commit 2598fb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/gardena_smart_system/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
STATE_DOCKED,
STATE_RETURNING,
STATE_ERROR,
STATE_IDLE,
ATTR_BATTERY_LEVEL,
)

Expand Down Expand Up @@ -94,9 +95,12 @@ async def async_update(self):
state = self._device.state
_LOGGER.debug("Mower has state %s", state)
if state in ["WARNING", "ERROR", "UNAVAILABLE"]:
_LOGGER.debug("Mower has an error")
self._state = STATE_ERROR
self._error_message = self._device.last_error_code
if self._device.last_error_code == "PARKED_DAILY_LIMIT_REACHED":
self._state = STATE_IDLE
else:
_LOGGER.debug("Mower has an error")
self._state = STATE_ERROR
else:
_LOGGER.debug("Getting mower state")
activity = self._device.activity
Expand Down

0 comments on commit 2598fb2

Please sign in to comment.