mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-13 23:34:04 +02:00
Do not assert but issue a warning (#687)
* Do not assert but issue a warning * bump to 1.18.2
This commit is contained in:
parent
e98f0dfa55
commit
1842ac9bd5
2 changed files with 11 additions and 2 deletions
|
|
@ -8,5 +8,5 @@
|
|||
"iot_class": "calculated",
|
||||
"issue_tracker": "https://github.com/basnijholt/adaptive-lighting/issues",
|
||||
"requirements": ["ulid-transform"],
|
||||
"version": "1.18.1"
|
||||
"version": "1.18.2"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2476,7 +2476,16 @@ class AdaptiveLightingManager:
|
|||
off_to_on_event: Event,
|
||||
) -> bool:
|
||||
# Adaptive Lighting should never turn on lights itself
|
||||
assert not is_our_context(off_to_on_event.context)
|
||||
if is_our_context(off_to_on_event.context):
|
||||
_LOGGER.warning(
|
||||
"Detected an 'off' → 'on' event for '%s' with context.id='%s' and"
|
||||
" event='%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,
|
||||
off_to_on_event,
|
||||
)
|
||||
turn_on_event: Event | None = self.turn_on_event.get(entity_id)
|
||||
id_off_to_on = off_to_on_event.context.id
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue