-
-
Notifications
You must be signed in to change notification settings - Fork 995
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
gjohansson-ST
merged 10 commits into
home-assistant:master
from
mikey0000:feature/lawn-mower-returning-state
Aug 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ac22f97
Update lawn-mower.md with returning state
mikey0000 39494f6
Update lawn-mower.md sentence improvement
mikey0000 799ed2a
add blog post
mikey0000 0d396a3
Text update
mikey0000 ff36a6a
Text update from suggestion
mikey0000 4fb1ff0
Text update from suggestion
mikey0000 86892f6
add link to documentation
mikey0000 02ca450
move url and make relative
mikey0000 4b030e9
change date to today
mikey0000 11d9cc7
address the nitpick
mikey0000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add blog post
- Loading branch information
commit 799ed2ac054026bf1170bb705ed101a1cf56f53f
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
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 | ||
... | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to 08-23