homebridge-http-switch
homebridge-http-switch copied to clipboard
Timeout on stateless
Regardless of the timeout parameter on stateless switches, it appears to default to 1 second.
What timeout value did you set? Would you mind providing the relevant parts of your config file?
Have tried different timeouts, but was wanting 5 seconds. Is it due to there being no offUrl? The reason for a timeout is so a button in an iOS app animates properly.
{ "name": "Entryway Door Lock", "switchType": "stateless", "timeout": 5000, "onUrl": "http://****", "accessory": "HTTP-SWITCH" }
So to understand you: You have a stateless switch which when turned on should only return to the off state after 5 seconds right? And to your observation it doesn't do that?
That is correct.
Did you get to the bottom as to why the timeout value on a stateless switch isn't work? Regardless of the value set, it seems to default to immediate.
I've just hit this issue also, I added some debug and the values for the timeout report to be correct.
Could the issue be that the main home bridge code use async/ await and this plugin doesn't? Also a quick google indicates that setTimeout is not awaitable.
Same for me. Stateless switch, wanted a 20s timeout, put "timeout: 20000" in the config, but I'm getting an "instant" return to original state. Could we please get a fix for this? Thank you!