mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-08 01:46:29 +00:00
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:
parent
2e289b04e2
commit
90ce5bb892
30
blog/2024-08-23-lawn-mower-activity-returning.md
Normal file
30
blog/2024-08-23-lawn-mower-activity-returning.md
Normal 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
|
||||
...
|
||||
```
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user