mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
* fix: reduce log verbosity for self-triggered off-to-on warning (#1433) Move full event object dump from warning to debug level in _off_to_on_state_event_is_from_turn_on() (switch.py:2717). For lights with large effect_list attributes (e.g. Govee lights with 130+ effects), the warning dumped the entire Event object including both old_state and new_state, creating log entries thousands of characters long. The warning now logs only entity_id and context.id, while the full event remains available at debug level for troubleshooting. Fixes #1433 * fix: correct indentation for _LOGGER.debug block * fix: correct indentation for _LOGGER.warning and _LOGGER.debug * fix: remove unintended encoding corruption, keep only log level change Reset switch.py to main and re-apply only the intended change: move the full event object from warning to debug level in _off_to_on_state_event_is_from_turn_on(). Addresses reviewer feedback about unintended Unicode corruption (→ and ≈ characters were corrupted to mojibake). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Florian Horner <florianhorner@Mac.fritz.box> Co-authored-by: Bas Nijholt <basnijholt@users.noreply.github.com>
This commit is contained in:
parent
7dcad99d81
commit
830c5589f7
1 changed files with 6 additions and 2 deletions
|
|
@ -2718,12 +2718,16 @@ class AdaptiveLightingManager:
|
|||
"service", # adaptive_lighting.apply is allowed to turn on lights
|
||||
):
|
||||
_LOGGER.warning(
|
||||
"Detected an 'off' → 'on' event for '%s' with context.id='%s' and"
|
||||
" event='%s', triggered by the adaptive_lighting integration itself,"
|
||||
"Detected an 'off' → 'on' event for '%s' with context.id='%s',"
|
||||
" triggered by the adaptive_lighting integration itself,"
|
||||
" which *should* not happen. If you see this please submit an issue with"
|
||||
" your full logs at https://github.com/basnijholt/adaptive-lighting",
|
||||
entity_id,
|
||||
off_to_on_event.context.id,
|
||||
)
|
||||
_LOGGER.debug(
|
||||
"Full 'off' → 'on' event for '%s': %s",
|
||||
entity_id,
|
||||
off_to_on_event,
|
||||
)
|
||||
turn_on_event: Event | None = self.turn_on_event.get(entity_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue