| | |
| | | }
|
| | | returnMap = AQICalculation.hourlyAQI(AQIMap);
|
| | | }
|
| | |
|
| | | long aqi = Math.round(Double.valueOf(returnMap.get("AQI").toString()));
|
| | | returnMap.put("AQI",aqi);
|
| | | return returnMap;
|
| | | }
|
| | |
|
| | |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) {
|
| | | for (Sensor sensor : sensors) {
|
| | | if (sensor.getSensorKey().equals(entry.getKey())) {
|
| | | mapAvg.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | if (entry.getValue() != null) {
|
| | | mapAvg.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | }
|
| | | } else if (("min" + sensor.getSensorKey()).equals(entry.getKey())) {
|
| | | mapMin.put(entry.getKey().substring(3), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString());
|
| | | } else if (("max" + sensor.getSensorKey()).equals(entry.getKey())) {
|