-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Add sync clock button for Husqvarna Automower #125689
Conversation
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.
Considered making 1 generic entity and extending the entity description for the available_fn and press_fn?
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.
Tested in my dev instance and can confirm it works.
Not until you mentioned it. But it's changed now. |
entities: list[ButtonEntity] = [] | ||
entities.extend( | ||
AutomowerButtonEntity(mower_id, coordinator, description) | ||
for mower_id in coordinator.data | ||
if coordinator.data[mower_id].capabilities.can_confirm_error | ||
for description in BUTTON_TYPES | ||
if description.exists_fn(coordinator.data[mower_id]) | ||
) | ||
async_add_entities(entities) |
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.
async_add_entities(
AutomowerButtonEntity(mower_id, coordinator, description)
for mower_id in coordinator.data
for description in BUTTON_TYPES
if description.exists_fn(coordinator.data[mower_id])
)
Co-authored-by: Joost Lekkerkerker <[email protected]>
Breaking change
Proposed change
Add a button to set the time of the mower to the current time (if the clock is out of sync). As the mower and the library and the API are not aware of any timezones, we assume, the mower is in the same timezone like set in the frontend. This is already done by some other entities of this integration.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: