Closed bouwew closed 3 months ago
Thanks for opening this PR, however, it is not the correct fix because the functions that use these variables expect that the variables are booleans.
The correct fix would make sure that the types are correct to begin with.
The fact that these variables are None means that this function must have failed:
I considered that as a second option :)
What can I do to troubleshoot this error? Enable debug-logging?
If you are correct then this error should happen directly after a Core-restart. As far as I can remember, haven't seen the error for some time because I updated the code locally, this error did not show directly after a Core restart but significantly later.
Or, are there reloads happening during runtime? Yes, of course, when updating the configuration. Maybe then it happened, I'll revert and watch the HA LOGBOOK.
After capturing some logging, it turns out the error is caused by a light that is no longer present.
This fixes the error reported in #919
The
isinstance()
asserts need to match the corresponding typing definitions:Or, match to the corresponding
is_on
typing definition: