basnijholt / adaptive-lighting

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

Assert-error in HA LOG regularly #919

Closed bouwew closed 4 months ago

bouwew commented 4 months ago

Home Assistant Adaptive Lighting Issue Template

Bug Reports

If you need help with using or configuring Adaptive Lighting, please open a Q&A discussion thread here instead.

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:
  1. Your Adaptive Lighting configuration:
  1. (If using Zigbee2MQTT), provide your configuration files (remove all personal information before posting):
    • devices.yaml
    • groups.yaml
    • configuration.yaml ⚠️; Warning REMOVE ALL of the PERSONAL INFORMATION BELOW before posting ⚠️;
      • mqtt: server:
      • mqtt: user:
      • mqtt: password:
      • advanced: pan_id:
      • advanced: network_key:
      • anything in log_syslog if you use this
    • Brand and model number of problematic light(s)


4.  Describe the bug and how to reproduce it:
![image](https://github.com/basnijholt/adaptive-lighting/assets/11290930/b9eac4ec-2ac6-42e4-9e6e-76b29237f42b)

5. Steps to reproduce the behavior:
th3w1zard1 commented 4 months ago

You've left half of the issue template blank, please fill in the missing details so we can properly help you.

bouwew commented 4 months ago

@th3w1zard1 Yeah I know, sorry, too much irrelevant information to add in my opinion :)

Anyway, I fixed the error myself in the local code, it was just a small mistake in what to assert.

Switch.py line 1419 should read: assert isinstance(adapt_color, bool | None) in line with the init of in line 1243: adapt_color: bool | None = None Also, line 1418 should be corrected too as adapt_brightness is also inited as bool | None.

bouwew commented 3 months ago

After capturing some logging, it turns out the error is caused by a light that is no longer present in HA but still is configured in the integration.