newdevice: Aruba Instant AP wireless sensor support (Freq, NoiseFloor, Power, Util) (#6564)

A few other fixes elsewhere
This commit is contained in:
Tony Murray
2017-05-03 16:53:36 -05:00
committed by Neil Lathwood
parent 2b3ca49bea
commit 35414a73c7
20 changed files with 6593 additions and 569 deletions

View File

@@ -95,7 +95,6 @@ class Sensor implements DiscoveryModule, PollerModule
$entPhysicalIndex = null,
$entPhysicalMeasured = null
) {
//
$this->type = $type;
$this->device_id = $device_id;
$this->oids = (array)$oids;
@@ -113,6 +112,11 @@ class Sensor implements DiscoveryModule, PollerModule
$this->high_warn = $high_warn;
$this->low_warn = $low_warn;
// ensure leading dots
array_walk($this->oids, function (&$oid) {
$oid = '.' . ltrim($oid, '.');
});
$sensor = $this->toArray();
// validity not checked yet
if (is_null($this->current)) {
@@ -547,10 +551,10 @@ class Sensor implements DiscoveryModule, PollerModule
{
$table = static::$table;
$params = array($device_id, $type);
$where = '`device_id`=? AND `sensor_class`=? AND `sensor_id`';
$where = '`device_id`=? AND `sensor_class`=?';
if (!empty($sensor_ids)) {
$where .= ' NOT IN ' . dbGenPlaceholders(count($sensor_ids));
$where .= ' AND `sensor_id` NOT IN ' . dbGenPlaceholders(count($sensor_ids));
$params = array_merge($params, $sensor_ids);
}