luisiam / homebridge-cmdswitch2

CMD Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
Apache License 2.0
176 stars 29 forks source link

synchronous functionality #74

Open gjcopperwheat opened 2 years ago

gjcopperwheat commented 2 years ago

Hi,

I'm not seeing the functionality expected with "synchronous": true.

Three lights and some Python code to bit bash a 433 MHz transmitter. All three lights configured to the same room in Home. Turn the room off and three instances of the transmitter code are initiated almost straight away, there's no attempt made to sequence them - see below.

Transmitter Log File

2022-01-02 14:45:36,335 2758 DEBUG: new instance started
2022-01-02 14:45:36,507 2760 DEBUG: new instance started
2022-01-02 14:45:36,528 2762 DEBUG: new instance started

Have I misunderstood the functionality?

Thanks.

config.json

{
        "bridge":
                {
                        "name": "Homebridge Mini",
                        "username": "CC:22:3D:E3:CE:41",
                        "port": 51826,
                        "pin": "031-45-199"
                },
        "description": "Homebridge Mini Config File",
        "platforms":
        [
                {
                        "platform": "cmdSwitch2",
                        "name": "cmdSwitch2",
                        "synchronous": true,
                        "switches":
                        [
                                {
                                        "name": "Christmas Lights",
                                        "on_cmd": "python3 /home/pi/transmit.py 1070387",
                                        "off_cmd": "python3 /home/pi/transmit.py 1070396",
                                        "timeout": 5
                                },
                                {
                                        "name": "Garden Room Lights",
                                        "on_cmd": "python3 /home/pi/transmit.py 1070851",
                                        "off_cmd": "python3 /home/pi/transmit.py 1070860",
                                        "timeout": 5
                                },
                                {
                                        "name": "Kitchen Lights",
                                        "on_cmd": "python3 /home/pi/transmit.py 1072387",
                                        "off_cmd": "python3 /home/pi/transmit.py 1072396",
                                        "timeout": 5
                                }
                        ]
                }
        ]
}