Supereg / homebridge-http-switch

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

Multiple "onUrl" and "offUrl" with "stateful" switches #53

Closed downloard closed 4 years ago

downloard commented 4 years ago

Please add possibility that 'onUrl' can be an array. I've an device (frontier silicon radio) which needs for preset channel change 3 http calls:

  1. activate preset mode
  2. do preset change action
  3. deactivate preset mode

So for one "Homekit-Use-Case" 3 http calls are necessary.

Supereg commented 4 years ago

The onUrl property can already be an array. The only requirement is that you use an switchType different from stateful. The reason I designed it like this is, that it would make no sense to call multiple http servers for the onUrl but query the current state from ONE statusUrl. If I may ask, what's your setup like. You require to have three urls for setting but can query the current state from only one url?

downloard commented 4 years ago

I really could not understand what the problem is with to call multiple urls for onUrl, but just a single url for status. My problem is to support a poor API from DAB radio. What I want to do is a switch which activated a preset channel and I want also to poll the status to track if it is really active, but activating need the 3 calls I explained above :(

downloard commented 4 years ago

Hi, thanks for investigation. But in the meantime I forked your great project: homebridge-http-switch-unlimited So I am fine. Bye