homebridge-http-switch icon indicating copy to clipboard operation
homebridge-http-switch copied to clipboard

Timeout on stateless

Open jameswestcott opened this issue 3 years ago • 7 comments

Regardless of the timeout parameter on stateless switches, it appears to default to 1 second.

jameswestcott avatar Oct 19 '20 13:10 jameswestcott

What timeout value did you set? Would you mind providing the relevant parts of your config file?

Supereg avatar Nov 01 '20 18:11 Supereg

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" }

jameswestcott avatar Nov 01 '20 20:11 jameswestcott

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?

Supereg avatar Dec 04 '20 11:12 Supereg

That is correct.

jameswestcott avatar Dec 04 '20 16:12 jameswestcott

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.

jameswestcott avatar Jan 20 '21 18:01 jameswestcott

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.

grahamhar avatar Feb 08 '21 18:02 grahamhar

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!

mrei-kiel avatar Sep 11 '21 17:09 mrei-kiel