mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: a couple of issues with the yaml state sensor discovery (#6912)
This commit is contained in:
committed by
Neil Lathwood
parent
0854ff5f59
commit
14ed767edb
@ -1086,8 +1086,9 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
|
||||
$value = $value * $multiplier;
|
||||
}
|
||||
} else {
|
||||
$state_name = $data['descr'];
|
||||
$state_name = $data['state_name'];
|
||||
$state_index_id = create_state_index($state_name);
|
||||
if ($state_index_id != null) {
|
||||
foreach ($data['states'] as $state) {
|
||||
$insert = array(
|
||||
'state_index_id' => $state_index_id,
|
||||
@ -1099,6 +1100,7 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
}
|
||||
$tmp_index = $data['index'] ?: $index;
|
||||
$uindex = str_replace('{{ $index }}', $index, $tmp_index);
|
||||
if ($sensor_type === 'state') {
|
||||
|
Reference in New Issue
Block a user