Hello, I’m the guy who jumped in and contributed fixes to the DateTimeAdapter which is now part of the WTIOAddons organization I created so that others could also contribute to the DateTimeAdapter if they so choose (in particular I added the original creator and some others to the organization, if you want in let me know; otherwise you can just use the normal fork and pull request method).
Anyway, on to the next thing. I am creating a konnected-adapter for konnected.io alarm board replacements. It’s a neat device that lets you hard wire all your existing wired door sensors and motion sensors to it, including the siren. With a proper Konnected adapter you will be able to drop it into your WebThings and go to town. The point I’m at now is I have an MVP working, but I’m not sure about best practices. I have implemented my own HTTPServer to receive messages from the device (by getting the ip address of wlan0 and adding my own port server at 8001), but they are just RESTful http://my.wlan.ip.addr:8001/api/konnected calls that it seems like I wouldn’t have to stand up a server for, and I could just tell it to use my https://gatewayaddress.webthings.io/thing/144223/api/konnected/xxxx144223 instead to receive messages (they’re json payloads). So, rather than my own server, how do I receive such a RESTful message directly in my python code? Second, I am initially scanning via SSDP and connecting to the Konnected.io board (V2) through urllib.request to “provision” the board (tell it where my URL is and what my zones are, among other things). Is that best practices, or is there some way to make an HTTP call with a JSON payload from within the gateway addons api and/or do the SSDP scan? It works as is, but I want to follow proper security and portability, etc. Code is at https://github.com/WTIOAddons/konnected-adapter for reference. With my adapter you won’t need to provision your card through konnected.io, just set up the wifi on it and stop there (don’t create a konnected.io account).