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

cycle_min: 0 causes 100% load as timer gets scheduled in a loop with 0 delay #929

Open
mikz opened this issue Feb 24, 2025 · 1 comment
Open
Labels
bug Something isn't working P1 Priority 1

Comments

@mikz
Copy link

mikz commented Feb 24, 2025

Version of the custom_component

main

If it is releveant to regulation performance or optimisation some curves are needed

no

Describe the bug

I configured cycle_min: 0 and Versatile Thermostat goes into infinite interval spawning loop.

async_track_time_interval(
self.hass,
self.async_control_heating,
interval=timedelta(minutes=self._cycle_min),
)

will start spawning cycle jobs with 0 delay causing 100% load.

I know this is poor API from homeassistant and other integrations suffer the same (adaptive lighting).

Yet it can be fixed by either requiring > 0 int in the configuration schema or by having some min(1, timedelta(...)) to have at least some enforced delay.

I learned this the hard way, but having a foolproof setup would prevent some folks going down this rabbit hole.

@jmcollin78
Copy link
Owner

Hello @mikz ,

Yes good point, I will add that. Thank you for your report.

@jmcollin78 jmcollin78 added bug Something isn't working P1 Priority 1 labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Priority 1
Projects
None yet
Development

No branches or pull requests

2 participants