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

Update lawn-mower.md with returning state #2280

Merged
Prev Previous commit
Next Next commit
add blog post
  • Loading branch information
mikey0000 committed Aug 20, 2024
commit 799ed2ac054026bf1170bb705ed101a1cf56f53f
29 changes: 29 additions & 0 deletions blog/2024-09-04-lawn-mower-activity-returning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the filename to todays date and then I think it's good to go 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 08-23

author: Michael Arthur
authorURL: https://github.com/mikey0000
title: "New returning type in LawnMowerActivity"
---

As of Home Assistant Core 2024.9, integrations using the lawn_mower platform can indicate that their mower
is returning by using the new `LawnMowerActivity.RETURNING` state.
mikey0000 marked this conversation as resolved.
Show resolved Hide resolved

## Example

```python
async def async_dock(self) -> None:
"""Start docking."""
self._attr_activity = LawnMowerActivity.RETURNING
self.async_write_ha_state()
```

or returning `LawnMowerActivity.RETURNING` in the activity function property of your lawn_mower entity.
mikey0000 marked this conversation as resolved.
Show resolved Hide resolved

```python
@property
def activity(self) -> LawnMowerActivity:
"""Return the state of the mower."""
mower = self.mower
if mower.state is RETURNING:
return LawnMowerActivity.RETURNING
...
```