Your Feinstaubwidget doesn't display temperature and humidity if sensor type is BME280. This sensor is compatible to DHT11/DHT22 and additionally measures air pressure. Your Widget should support this sensor because it's often used.
None of your JSON parsers works with BME280. I don't understand your concept of different parsers - one parser should be enough. For my own software I used the free libjansson which is part of Linux, easy to use and available for all operation systems incl. Android. https://jansson.readthedocs.io/en/2.10/gettingstarted.html
BTW: My parser routine C/C++ for array of 'sensordatavalues' looks like this:
Your Feinstaubwidget doesn't display temperature and humidity if sensor type is BME280. This sensor is compatible to DHT11/DHT22 and additionally measures air pressure. Your Widget should support this sensor because it's often used.
See difference between DHT11/DHT22 and BME280:
DHT22: http://api.luftdaten.info/v1/sensor/1315/
BME280: http://api.luftdaten.info/v1/sensor/15662/
None of your JSON parsers works with BME280. I don't understand your concept of different parsers - one parser should be enough. For my own software I used the free libjansson which is part of Linux, easy to use and available for all operation systems incl. Android. https://jansson.readthedocs.io/en/2.10/gettingstarted.html
BTW: My parser routine C/C++ for array of 'sensordatavalues' looks like this:
... array = json_array_get(sensordatavalues, i) ...
... if (json_unpack_ex(array, &error, 0, "{s:s,s:o,s?I*}", "value_type", &sensor[i].type, "value", &value, "id", &sensor[i].id)...
No regex required and order doesn't matter
Your Feinstaubwidget doesn't display temperature and humidity if sensor type is BME280. This sensor is compatible to DHT11/DHT22 and additionally measures air pressure. Your Widget should support this sensor because it's often used.
See difference between DHT11/DHT22 and BME280:
DHT22: http://api.luftdaten.info/v1/sensor/1315/
BME280: http://api.luftdaten.info/v1/sensor/15662/
None of your JSON parsers works with BME280. I don't understand your concept of different parsers - one parser should be enough. For my own software I used the free libjansson which is part of Linux, easy to use and available for all operation systems incl. Android. https://jansson.readthedocs.io/en/2.10/gettingstarted.html
BTW: My parser routine C/C++ for array of 'sensordatavalues' looks like this:
... array = json_array_get(sensordatavalues, i) ...
... if (json_unpack_ex(array, &error, 0, "{s:s,s:o,s?I*}", "value_type", &sensor[i].type, "value", &value, "id", &sensor[i].id)...
No regex required and order doesn't matter
Added partial support for the BME280 sensor: temperature & humidity, but not pressure values.