Fix null in sensors discovery (#16201)

This commit is contained in:
Tony Murray
2024-07-14 17:30:43 -05:00
committed by GitHub
parent b0c7fe8c8d
commit ac8a69fa3b

View File

@@ -198,7 +198,7 @@ class Sensor implements DiscoveryModule, PollerModule
'WHERE `device_id`=? AND `sensor_class`=? AND `sensor_type`=? AND `sensor_index`=?',
[$this->device_id, $this->type, $this->subtype, $this->index]
);
$this->sensor_id = $sensor['sensor_id'];
$this->sensor_id = $sensor['sensor_id'] ?? null;
return $sensor;
}