basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.86k stars 135 forks source link

When interval is set to 0 lights get spammed constantly #852

Open mikz opened 10 months ago

mikz commented 10 months ago

Home Assistant Adaptive Lighting Issue Template

Before submitting a bug report, please follow these troubleshooting steps:

Please confirm that you have completed the following steps:

Required information for bug reports:

Please include the following information in your issue.

Issues missing this information may not be addressed.

  1. Debug logs captured while the issue occurred. See here for instructions on enabling debug logging:
2023-11-21 08:20:49.782 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: Called '_setup_listeners'
2023-11-21 08:20:49.782 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: Cancelled '_setup_listeners'
2023-11-21 08:20:49.783 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: Called 'async_turn_on', current state is 'None'
2023-11-21 08:20:49.783 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: Called '_setup_listeners'
2023-11-21 08:20:50.284 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1MBC:al:JNXX:ntrv:00' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:50.785 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1MV1:al:JNXX:ntrv:01' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:51.285 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1NAN:al:JNXX:ntrv:02' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:51.787 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1NTB:al:JNXX:ntrv:03' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:52.288 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1PA0:al:JNXX:ntrv:04' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:52.790 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1PSN:al:JNXX:ntrv:05' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:53.291 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1Q9B:al:JNXX:ntrv:06' lights: 'None', transition: '0.0', force: 'False'
2023-11-21 08:20:53.792 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Koupelna: '_update_attrs_and_maybe_adapt_lights' called with context.id='01HFRC1QS0:al:JNXX:ntrv:07' lights: 
  1. Your Adaptive Lighting configuration:
interval: 0
  1. Describe the bug and how to reproduce it:

Set up interval 0. It will spam all the lights and eventually break something - like Hue runs out of sockets.

  1. Steps to reproduce the behavior:

Set up interval 0. Wait.

Maybe there should be a validation that interval needs to be greater than 0 or 0 would mean never update?