Skip to content

Commit

Permalink
Remove unused function (librenms#14283)
Browse files Browse the repository at this point in the history
duplicates other functionality
  • Loading branch information
murrant authored Sep 4, 2022
1 parent 9f39acd commit c2761b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
5 changes: 4 additions & 1 deletion includes/discovery/sensors/humidity/geist-watchdog.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <[email protected]>
*/
$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';
Expand Down
14 changes: 0 additions & 14 deletions includes/rewrites.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit c2761b4

Please sign in to comment.