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

Add rainbird request debouncer and immediately update entity switch state #112152

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

allenporter
Copy link
Contributor

Proposed change

Add rainbird request debouncer and immediately update entity switch state. This avoids a problem where when setting a switch it goes back to the old state after a few seconds because the rainbird device state takes a moment to actually reflect the new state.

This adds a request debouncer with a cooldown of 5 seconds so that it will request the new state with a few seconds for it to be updated.

The existing tests still pass without modification, and this was tested manually against a live device.

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

home-assistant bot commented Mar 4, 2024

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

Code owner commands

Code owners of rainbird 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 rainbird 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.

@jellyneck84
Copy link

@allenporter thanks for your work
@balloob when will this change be available for testing? It will show up as an available update in HA, right?

@allenporter
Copy link
Contributor Author

@allenporter thanks for your work
@balloob when will this change be available for testing? It will show up as an available update in HA, right?

It's not merged yet. Once merged it will be in a release. We haven't tagged this for a specific patch release so it will probably be in the 2024.4 release.

@jellyneck84
Copy link

@allenporter thanks for your work
@balloob when will this change be available for testing? It will show up as an available update in HA, right?

It's not merged yet. Once merged it will be in a release. We haven't tagged this for a specific patch release so it will probably be in the 2024.4 release.

Thanks for explaining. I assume there is no way to test it before as a "beta" ?

@allenporter
Copy link
Contributor Author

@allenporter thanks for your work
@balloob when will this change be available for testing? It will show up as an available update in HA, right?

It's not merged yet. Once merged it will be in a release. We haven't tagged this for a specific patch release so it will probably be in the 2024.4 release.

Thanks for explaining. I assume there is no way to test it before as a "beta" ?

There are nightly dev releases, then betas are cut a week before the prod release for early community testing.

Copy link
Contributor

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Thanks @allenporter 👍

@edenhaus edenhaus merged commit ac416f7 into home-assistant:dev Mar 4, 2024
23 checks passed
@edenhaus edenhaus added this to the 2024.3.0 milestone Mar 4, 2024
@edenhaus
Copy link
Contributor

edenhaus commented Mar 4, 2024

As this is a bugfix, is it fine to ship it with the next release, or are there concerns about not doing it? @allenporter

@allenporter
Copy link
Contributor Author

As this is a bugfix, is it fine to ship it with the next release, or are there concerns about not doing it? @allenporter

I'm just being conservative... This integration has had these problems for a couple years.

There are 2 changes that probably need to go in given a merge conflict, but they are both stability fixes. I assume the current beta cycle is slowing down, but I guess we could put both changes in and make this round.

@jellyneck84
Copy link

jellyneck84 commented Mar 4, 2024 via email

@allenporter
Copy link
Contributor Author

The other change makes a connection pool change, and while I tested manually maybe there another side effect I missed...

I broke this integration a couple times before with what I thought was a small change so maybe I just prefer the full test cycle...

@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 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.

Rainbird: long wait for switch status change
4 participants