SpaceApi-archive / SpaceApi

Android app and widget showing hackerspace status
18 stars 10 forks source link

sensor arrays #6

Closed sonologic closed 11 years ago

sonologic commented 12 years ago

(from my inbox, from Lennart)

I propose the following changes to the HackspaceStatus API which will break compatibility with 0.12 so I also propose a version bump to 0.13: The sensors part of the API is more or less not defined so I propose the following layout for the object:

"sensors":{ "temperature":[{"name":"inside", "value":20.2, "unit":"C"}], "humidity":[{"name":"inside", "value":0.75}], "barometer":[{"name":"outside", "value":1030.8, "unit":"hPA"}], "wind":[{"name":"outside", "speed":0.3, "gust": 1, "unit":"m/s", "direction":"SE"}], "wifi":[{"name":"freifunk", "connections":8}]}

Sensors in itself are debatable but the layout should be quite easy to implement and is more versatile than before. Which would make, and does make parsing a lot easier and displaying the value is always accompanied by the correct unit.

slopjong commented 11 years ago

Have a look at the current specs and adapt it accordingly if necessary.