diff --git a/blog/2024-08-23-lawn-mower-activity-returning.md b/blog/2024-08-23-lawn-mower-activity-returning.md new file mode 100644 index 00000000..9192377e --- /dev/null +++ b/blog/2024-08-23-lawn-mower-activity-returning.md @@ -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 + ... +``` \ No newline at end of file diff --git a/docs/core/entity/lawn-mower.md b/docs/core/entity/lawn-mower.md index 1facc937..61dbb6df 100644 --- a/docs/core/entity/lawn-mower.md +++ b/docs/core/entity/lawn-mower.md @@ -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