Warning when calling light.turn_on with brightness=0 (#678)

* Do not update the call when calling light.turn_on with brightness=0

* Simplify

* issue warning instead
This commit is contained in:
Bas Nijholt 2023-08-02 23:12:13 -07:00 committed by GitHub
commit b80b253fa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1993,6 +1993,13 @@ class AdaptiveLightingManager:
if self.manual_control.get(entity_id, False):
return
if data.get(ATTR_BRIGHTNESS) == 0:
_LOGGER.warning(
"Turn-on call with zero brightness detected, Adaptive Lighting"
" intercepted this service_call and adjusted it. If you use this as"
" a brightness workaround, please remove it, it is no longer necessary",
)
try:
adaptive_switch = _switch_with_lights(self.hass, [entity_id])
except NoSwitchFoundError: