Sensors remove reliance on global variable (#16344)

* Sensors remove reliance on global variable

* Apply fixes from StyleCI

* Clear the instance instead of reset.
Remove $valid['sensors'] from docs

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
This commit is contained in:
Tony Murray
2024-09-03 21:04:34 -05:00
committed by GitHub
parent 4efad1ae69
commit f15f8fa63a
381 changed files with 991 additions and 932 deletions

View File

@@ -105,6 +105,7 @@ global $device;
foreach (dbFetchRows("SELECT * FROM `devices` WHERE disabled = 0 $where ORDER BY device_id DESC", $sqlparams) as $device) {
$device_start = microtime(true);
DeviceCache::setPrimary($device['device_id']);
App::forgetInstance('sensor-discovery');
if (discover_device($device, $module_override)) {
$discovered_devices++;