Closed DigitalBites closed 1 year ago
Yesterday evening, I had a chance to start digging into the Home Assistant code and then the Luxor API that is used by this and I believe have found the cause of the issue.
The API has a default pool connection size of 100. Reading that API documentation, it appears that it will queue calls beyond that threshold and going back to my initial thoughts that the landscape lighting controller is getting overwhelmed by repeated requests in the above scenarios, I changed the default pool configuration from 100 -> 1. Applying this patch fixed the issue, more testing is necessary and I need to see if this is a simple parameter/configuration that can be applied via parameter/inputs from this module.
For those interested, that line in the configuration for the API is here ->
lib/python3.11/site-packages/luxor_openapi_asyncio/configuration.py:173: self.connection_pool_maxsize = 100
Changing that value, restarting HA appears to solve this problem. I'll see what can be done from a pull request for this module to influence a change to the default value to what this module requires.
HA version 2023.8.3/latest
Thank you for such a great integration. This worked right away for me, but when I started to integrate some of the groups into my scenes in home assistant I noticed an issue.
When you in rapid secession turn on, off or any combination there of of multiple groups - it appears the controller is abandoning the subsequent requests. first one wins and then there is an error in the logs that it disconnects (although it continues to work for later single status change calls). You can still turn on/off other groups one at a time.
Another example of this is having a card setup in the front end with the header toggle available. As soon as you toggle it only one of the groups will change status with the same error.
Log output when it successfully turns on/off a light:
Here's the relevant debug lines from the log file:
Update: clarification/spelling