mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix AOS 7 sensors (#12599)
* AOS7 WIP * Fix AOS 7 sensors * TX Bias -> TX Power * Fixes
This commit is contained in:
@@ -1002,10 +1002,6 @@ function discovery_process(&$valid, $device, $sensor_class, $pre_cache)
|
||||
}
|
||||
}
|
||||
|
||||
echo "Cur $value, Low: $low_limit, Low Warn: $low_warn_limit, Warn: $warn_limit, High: $high_limit" . PHP_EOL;
|
||||
$entPhysicalIndex = YamlDiscovery::replaceValues('entPhysicalIndex', $index, null, $data, $pre_cache) ?: null;
|
||||
$entPhysicalIndex_measured = isset($data['entPhysicalIndex_measured']) ? $data['entPhysicalIndex_measured'] : null;
|
||||
|
||||
$sensor_name = $device['os'];
|
||||
|
||||
if ($sensor_class === 'state') {
|
||||
@@ -1016,6 +1012,10 @@ function discovery_process(&$valid, $device, $sensor_class, $pre_cache)
|
||||
$value = ($value / $divisor) * $multiplier;
|
||||
}
|
||||
|
||||
echo "Cur $value, Low: $low_limit, Low Warn: $low_warn_limit, Warn: $warn_limit, High: $high_limit" . PHP_EOL;
|
||||
$entPhysicalIndex = YamlDiscovery::replaceValues('entPhysicalIndex', $index, null, $data, $pre_cache) ?: null;
|
||||
$entPhysicalIndex_measured = isset($data['entPhysicalIndex_measured']) ? $data['entPhysicalIndex_measured'] : null;
|
||||
|
||||
//user_func must be applied after divisor/multiplier
|
||||
if (isset($user_function) && is_callable($user_function)) {
|
||||
$value = $user_function($value);
|
||||
@@ -1056,7 +1056,7 @@ function sensors($types, $device, $valid, $pre_cache = [])
|
||||
}
|
||||
}
|
||||
discovery_process($valid, $device, $sensor_class, $pre_cache);
|
||||
d_echo($valid['sensor'][$sensor_class]);
|
||||
d_echo($valid['sensor'][$sensor_class] ?? []);
|
||||
check_valid_sensors($device, $sensor_class, $valid['sensor']);
|
||||
echo "\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user