Update lawn-mower.md with returning state (#2280)

* Update lawn-mower.md with returning state

* Update lawn-mower.md sentence improvement

* add blog post

* Text update

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Text update from suggestion

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Text update from suggestion

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* add link to documentation

* move url and make relative

* change date to today

* address the nitpick

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
Michael Arthur 2024-08-23 18:47:55 +12:00 committed by GitHub
parent 2e289b04e2
commit 90ce5bb892
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
---
author: Michael Arthur
authorURL: https://github.com/mikey0000
title: New returning type in LawnMowerActivity
---
As of Home Assistant Core 2024.9, integrations implementing `LawnMowerEntity` can indicate that their mower is returning to the dock by using the new `LawnMowerActivity.RETURNING` state.
More details can be found in the [documentation](/docs/core/entity/lawn-mower#activities)
## Example
```python
async def async_dock(self) -> None:
"""Start docking."""
self._attr_activity = LawnMowerActivity.RETURNING
self.async_write_ha_state()
```
or by returning `LawnMowerActivity.RETURNING` in the activity property of your `lawn_mower` entity.
```python
@property
def activity(self) -> LawnMowerActivity:
"""Return the state of the mower."""
mower = self.mower
if mower.state is RETURNING:
return LawnMowerActivity.RETURNING
...
```

View File

@ -23,6 +23,7 @@ Properties should always only return information from memory and not do I/O (lik
| `MOWING` | The lawn mower is currently mowing.
| `DOCKED` | The lawn mower is done mowing and is currently docked.
| `PAUSED` | The lawn mower was active and is now paused.
| `RETURNING` | The lawn mower is returning to the dock.
| `ERROR` | The lawn mower encountered an error while active and needs assistance.
## Supported features