1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Don't store sensor data if temperature/occupancy are null

This commit is contained in:
Jon Ziebell 2020-02-08 11:21:31 -05:00
parent 846eb9bb93
commit 882dec840e

View File

@ -634,7 +634,7 @@ class runtime extends cora\api {
in_array($capability['type'], ['temperature', 'occupancy']) === true
) {
if ($value === null) {
$datas[$sensor['sensor_id']][$capability['type']] = null;
continue 3; // If temperature or occupancy are null, ignore
} else {
$datas[$sensor['sensor_id']][$capability['type']] = ($capability['type'] === 'temperature') ? ($value * 10) : $value;
}