Skip to content
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

Remove unused option flow from blink #106735

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

mkmer
Copy link
Contributor

@mkmer mkmer commented Dec 30, 2023

Breaking change

Remove option flow for scan_interval. Adjustable scan interval is no longer allowed and the option has had no effect on the integration since 2023.11. If an alternate polling rate is desired, use https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval. Updating one entity in a blink configuration will update all entities in each blink configuration.

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @fronzbot, mind taking a look at this pull request as it has been labeled with an integration (blink) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of blink can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign blink Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the introduction of the coordinator that broke the setting for the scan interval option as far as I can tell. That was released in the November release. Has anyone noticed this? Do we need to announce the removal, after the fact so to speak?

homeassistant/components/blink/config_flow.py Show resolved Hide resolved
@MartinHjelmare MartinHjelmare marked this pull request as draft December 31, 2023 02:10
@mkmer
Copy link
Contributor Author

mkmer commented Dec 31, 2023

No one has complained yet, but that doesn't mean it's not killing batteries.
I think I should at least set the polling at the original default of 300 seconds (5 minutes), then users that want to update faster can use the homeassistant.update_entity service.
@fronzbot - your for sure more intimate with the battery details. Thoughts?

@fronzbot
Copy link
Contributor

fronzbot commented Jan 1, 2024

@mkmer - 30s scan interval won't kill batteries since it just polls the servers and then the sync module, which is wall powered. The battery-operated cameras are "smart" in that they are the ones who initiate a transaction with the sync module if an event has occurred (the exception being a user-triggered image or video request).

30s is on the "most aggressive" side of the recommended refresh rate (for API rate limiting reasons), but it was the default setting for this integration prior to having the gui-based config options (back in the wild west days of HA where it was just yaml as far as the eye could see 😄). With that said, I think updating to 5 minutes is good as long as we note that in the documentation.

@fronzbot
Copy link
Contributor

fronzbot commented Jan 1, 2024

@mkmer hmm, is there a reason we can't maintain the option flow though? One use case for wanting a global update of the refresh rate (rather than disabling polling and manually triggering) is for motion detection. It's not perfect, due to the delay, but not having the ability to adjust that to lower values might be a bad change to introduce

@MartinHjelmare
Copy link
Member

To be clear, with the coordinator it's enough to update one entity via the service call to make the coordinator refresh and in turn update all entities that received a new state from the coordinator.

@mkmer
Copy link
Contributor Author

mkmer commented Jan 1, 2024

@fronzbot I believe an adjustable scan interval is no longer allowed, and since I broke it, might as well take it out.
Other than it not being "allowed", it could be fixed.
This https://community.home-assistant.io/t/recommended-way-to-define-scan-intervals-for-sensors/596265/8 is the way to do it in the current environment?

@mkmer
Copy link
Contributor Author

mkmer commented Jan 1, 2024

I think we should go with 30 seconds (leave it as it currently is). It has been at 30 seconds for 2 months now. If it generates issues with users, take a look at it at that point?

@MartinHjelmare
Copy link
Member

Let's add a breaking change paragraph in the PR description and mention that the scan interval option is removed as it's not allowed to have a config option for scan interval and it's been broken since November without issue reports. Also add a link to the docs page for custom polling.

https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval

@mkmer mkmer marked this pull request as ready for review January 2, 2024 15:00
@mkmer
Copy link
Contributor Author

mkmer commented Jan 8, 2024

It's possible the 30 second update has caught up with us. Lot's of 406 errors from Blink servers in the last few days.
#107386 puts it back to 300s.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

The other PR has been merged. Is this PR ready to merge?

@mkmer
Copy link
Contributor Author

mkmer commented Jan 9, 2024

Yes, PR is clear to merge.
Just wanted to link/document the change here as we had some conversation about the polling rate.

@MartinHjelmare MartinHjelmare merged commit 4dbaa57 into home-assistant:dev Jan 9, 2024
27 checks passed
@mkmer mkmer deleted the remove-option-flow branch January 9, 2024 15:09
tomaszsluszniak pushed a commit to tomaszsluszniak/core that referenced this pull request Jan 9, 2024
* Remove unused option flow

* remove update listener

* adjust scan_interval to original default

* default scn interval back to 30s
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants