Supereg / homebridge-http-switch

Powerful http switch for Homebridge: https://github.com/homebridge/homebridge
ISC License
218 stars 36 forks source link

URL in Series of URL is triggered twice #124

Open b1t-hunter opened 7 months ago

b1t-hunter commented 7 months ago

I would like to have a switch that triggers the execution of requests in sequence. In my example, I want to say something over multiple Sonos speakers using the sonos-http-api. Following sequence scheme is used:

[
    "<Request1>", 
    "delay(4000)",
    "<Request2>"
]

I am using the "multipleUrlExecutionStrategy": "series" and would expect that each request in the series is only executed once. However, when the switch is triggered, Request1 is executed twice, once immediately and once after the delay. Request2 is executed after the delay time, so that both requests are executed simultaneously after 4s. Am I misunderstanding the series with delays concept or is this a bug?

Version

Actual Configuration

{
    "accessory": "HTTP-SWITCH",
    "name": "Say Something",
    "switchType": "stateless",
    "timeout": 8000,
    "debug": true,
    "multipleUrlExecutionStrategy": "series",
    "onUrl": [
        {
            "url": "http://localhost:5005/Room1/say/Hello%20in%20Room1"
        },
        "delay(4000)",
        {
            "url": "http://localhost:5005/Room2/say/Hello%20in%20Room2"
        }
    ]
}