|
@@ -193,6 +193,7 @@ class DeviceListener
|
|
if ($entity instanceof DeviceInterface) {
|
|
if ($entity instanceof DeviceInterface) {
|
|
$data = $entity->getDeviceData();
|
|
$data = $entity->getDeviceData();
|
|
$data = $this->addLocationData($entity, $data);
|
|
$data = $this->addLocationData($entity, $data);
|
|
|
|
+ $data = $this->addExtraDataFields($entity, $data);
|
|
|
|
|
|
return $this->webservice->makeGetRequest($url, $method, $data, $credentials);
|
|
return $this->webservice->makeGetRequest($url, $method, $data, $credentials);
|
|
}
|
|
}
|
|
@@ -222,6 +223,25 @@ class DeviceListener
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private function addExtraDataFields($entity, $data)
|
|
|
|
+ {
|
|
|
|
+ if(!$this->enabled){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ $extraData = json_decode($data['extraData'], true);
|
|
|
|
+
|
|
|
|
+ $className = get_class($entity);
|
|
|
|
+
|
|
|
|
+ if($className == 'FTTHBundle\Entity\OLT' && !array_key_exists('timeOltScan', $extraData)){
|
|
|
|
+ $extraData['timeOltScan'] = 10;
|
|
|
|
+ }else if($className == 'FTTHBundle\Entity\NAS' && !array_key_exists('executeSnmp', $extraData)){
|
|
|
|
+ $extraData['executeSnmp'] = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data['extraData'] = json_encode($extraData);
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param object $entity
|
|
* @param object $entity
|
|
*
|
|
*
|