Skip to content

Conversation

agoode
Copy link
Contributor

@agoode agoode commented Aug 23, 2025

While the standard update rate of this intgration is 30 seconds, it's possible to use homeassistant.update_entity to poll more frequently, see https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval.

But this method is limited by the update coordinator default cooldown, 10 seconds, which is too long to collect rapidly-changing metrics like temperature.

This change will allow homeassistant.update_entity to update up to twice per second, which should be fast enough while still providing some protection against polling the printer too fast.

Proposed change

This will allow the use of automations to poll prusalink metrics more often than every 10 seconds.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

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

Code owner commands

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

@agoode agoode force-pushed the cooldown branch 2 times, most recently from f3f7ea5 to a432a92 Compare August 29, 2025 04:00
@frenck
Copy link
Member

frenck commented Aug 29, 2025

This change will allow homeassistant.update_entity to update up to twice per second, which should be fast enough while still providing some protection against polling the printer too fast.

That sounds extremely high. What is the use case for this? As allowing such high polling rate, impacts databases and storages.

../Frenck

@frenck frenck marked this pull request as draft August 29, 2025 11:11
@agoode
Copy link
Contributor Author

agoode commented Aug 29, 2025

This is a high rate, but it shouldn't change anything for anyone who's not calling homeassistant.update_entity from an automation already.

I have prometheus running at a 1 second scrape interval against home assistant, and I want to get the temperature data for the nozzle at this rate so that I can make sure cooling between filament changes (with MMU3) is happening as expected.

Without this change, I am limited to once every 10 seconds regardless of how I set my polling rate in my automation. I have many other devices working at this high rate without problem (mostly esphome).

It's pretty common to have a <1.0 debounce interval in home assistant, I see it in hue, tplink, roku.

While the standard update rate of this intgration is 30 seconds, it's
possible to use homeassistant.update_entity to poll more frequently,
see https://www.home-assistant.io/common-tasks/general/#why-use-an-automation-instead-of-changing-the-integrations-polling-configuration.

But this method is limited by the update coordinator default cooldown,
10 seconds, which is too long to collect rapidly-changing metrics like
temperature.

This change will allow homeassistant.update_entity to update up to
twice per second, which should be fast enough while still providing
some protection against polling the printer too fast.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants