Skip to content

feat: add active scan interval for dynamic polling rate - #968

Open
D34DC3N73R wants to merge 1 commit into
ollo69:masterfrom
D34DC3N73R:master
Open

feat: add active scan interval for dynamic polling rate#968
D34DC3N73R wants to merge 1 commit into
ollo69:masterfrom
D34DC3N73R:master

Conversation

@D34DC3N73R

Copy link
Copy Markdown

Introduce a separate polling interval that activates while a device is running, replacing the single static scan interval.

  • Add CONF_ACTIVE_SCAN_INTERVAL constant (default 35s, min 30s, max 3600s); LG's API returns a 9006 rate-limit warning at exactly 30s
  • Add LGEDevice._apply_scan_interval() which switches each device's coordinator between the idle and active interval based on is_on state; called after every poll so the transition is immediate on the next cycle
  • Expose both intervals as config-category number entities and in the options flow so they can be adjusted from the UI without a reload
  • Update _options_update_listener to re-apply per-device intervals when either setting changes, rather than blindly writing one delta to all coordinators

Introduce a separate polling interval that activates while a device is
running, replacing the single static scan interval.

- Add CONF_ACTIVE_SCAN_INTERVAL constant (default 35s, min 30s, max 3600s);
  LG's API returns a 9006 rate-limit warning at exactly 30s
- Add LGEDevice._apply_scan_interval() which switches each device's
  coordinator between the idle and active interval based on is_on state;
  called after every poll so the transition is immediate on the next cycle
- Expose both intervals as config-category number entities and in the
  options flow so they can be adjusted from the UI without a reload
- Update _options_update_listener to re-apply per-device intervals when
  either setting changes, rather than blindly writing one delta to all
  coordinators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant