I was wondering if there is a way to set a delay to set the state of all switches:
The problem is since I’m using broadlink component, when I toggle it, HA send all packets too fast and most lights does not switch on/off but are toggled on the UI. I think that if it could delay for 1 second all commands it might work!
It would be better if HA could first check if the current switched is toggled differently then the group command and only update the ones that need.
If there is no way on doing that, I might just disable the group switch and add a scene to turn on and off all lights of current group.
Anyone can sign the CLA as per these instructions:
The review of your PR suggests, though, that the code doesn’t work. You need to run a tool named tox locally and make sure all tests pass before the code will be merged to the main branch.
I recommend creating a virtual environment and doing the tests in there so you don’t clutter the rest of your environment.
Thanks for your interest and time to make this component better.
Fortunately, I gave up on using RF relays to control my lightning and appliances: now I have all of them removed and installed Sonoffs with Tasmota firmware.
I am not sure if this fix (time.sleep(0.8)) still works with today’s Broadlink component, since there were updates to the core component. Either way, I do believe this could help a lot of people that still uses these RF relays.
If you can register yourself as a CLA contribuitor, maybe you can suggest this great code to be available as a native component on HA: Broadlink IR Climate Component.
Also, have you seen this GitHub? This guy coded an incredible Broadlink RF code generator to use with relays and RF devices: Random Broadlink RM Code Generator