sensebox / openSenseMap-API

API for opensensemap.org
https://docs.opensensemap.org/
MIT License
49 stars 41 forks source link

Provide the sensor icon and a link by the API #117

Open dbaelz opened 6 years ago

dbaelz commented 6 years ago

As an external developer who uses the API it's extremely helpful when the API supplies not only the required information, but also the referenced assets. At the moment the openSenseMap-API reference some standard osem-* icons. As far as I can see, there's no way to fetch these resources with the API.

It would be convenient if the API provides:

Example of an expanded sensor data entry (extract from the Get one senseBox call)

{
    "_id": "579f9eae68b4a2120069edc8",
    "sensorType": "VCC",
    "unit": "V",
    "title": "Eingangsspannung",
    "lastMeasurement": {
        "value": "2.73",
        "createdAt": "2016-11-11T21:22:01.675Z"
    },
    "icon": "osem-shock",
    "icon-url": "https://api.opensensemap.org/assets/osem-humidity.png"
}
ubergesundheit commented 6 years ago

Good suggestion! Another place where an resource link could be returned is the image of the box (in the same call).

We're planning to rebuild the sensor definitions soon and will think about including links to these kind of resources!

As you maybe already know, the icons are implemented as webfont, which you'll find here. Maybe this will help you short-term.

nobodyinperson commented 5 years ago

This would also help me a lot with OpenSenseFish, my SailfishOS app to access the OpenSenseMap.