From c2761b4e12791c3c2e8a8ce6e084768ae3f526e9 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sun, 4 Sep 2022 05:04:55 -0500 Subject: [PATCH] Remove unused function (#14283) duplicates other functionality --- .../sensors/humidity/geist-watchdog.inc.php | 5 ++++- includes/rewrites.php | 14 -------------- 2 files changed, 4 insertions(+), 15 deletions(-) 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 = [