homedash / kankun-json

A CGI script that provides a simple web interface and RESTful JSON API for the Kankun Small K wifi switch.
http://homedash.org
MIT License
34 stars 25 forks source link

Slider is show for older json.cgi versions #6

Closed mattjoyce closed 8 years ago

mattjoyce commented 8 years ago

I noticed that on one of my switches, that uses an older json.cgi, the slider is show, but is meaningless. I'm not sure this is really a big problem, but a simple fix would be to test the version of json (info.version).

Japh commented 8 years ago

Ah, nice one! Yeah, that would be ideal. I guess at the moment, the assumption is that if you have the latest switcher.html on there, you'd also have the latest json.cgi.

I assume you're running the html from a separate device from this switch, which is just configured in switches.json?

Should be simple enough to check, but will get annoying as we develop more features and need to constantly check for supported features... something for #10.

mattjoyce commented 8 years ago

yup, it will be annoying to have If Versions... everywhere. Increasingly so. I'm much more of a mind to add a manifest to the switch to describe what it can do, and have the controller respond.