diff --git a/includes/discovery/sensors/humidity/geist-watchdog.inc.php b/includes/discovery/sensors/humidity/geist-watchdog.inc.php index 8375264d85..5c01b109cf 100644 --- a/includes/discovery/sensors/humidity/geist-watchdog.inc.php +++ b/includes/discovery/sensors/humidity/geist-watchdog.inc.php @@ -22,7 +22,10 @@ * @copyright 2017 Neil Lathwood * @author Neil Lathwood */ -$value = return_number(snmp_get($device, 'climateHumidity', '-Oqv', 'GEIST-MIB-V3')); + +use LibreNMS\Util\Number; + +$value = Number::cast(SnmpQuery::get('GEIST-MIB-V3::climateHumidity')->value()); if ($value) { $current_oid = '.1.3.6.1.4.1.21239.2.2.1.7.1'; $descr = 'Humidity'; diff --git a/includes/rewrites.php b/includes/rewrites.php index 2078e75ace..652bfe0155 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -264,20 +264,6 @@ function apc_relay_state($state) } } -/** - * @param $value - * @return mixed - */ -function return_number($value) -{ - preg_match('/[\d\.\-]+/', $value, $temp_response); - if (! empty($temp_response[0])) { - $value = $temp_response[0]; - } - - return $value; -} - function parse_entity_state($state, $value) { $data = [