Skip to content

Commit

Permalink
Update module.php
Browse files Browse the repository at this point in the history
Added number of connected devices
  • Loading branch information
elueckel authored Jun 8, 2024
1 parent 5ab2542 commit 3a3f6f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UniFi Endpoint Monitor/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function ApplyChanges()
$this->MaintainVariable("RSSI", $this->Translate("RSSI"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0);
$this->MaintainVariable("Noise", $this->Translate("Noise"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0);
$this->MaintainVariable("SignalStrength", $this->Translate("Signal Strength"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0);
$this->MaintainVariable("ConnectedDevices", $this->Translate("Connected Devices"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0);

//Transfer Data
$vpos = 300;
Expand Down Expand Up @@ -253,6 +254,9 @@ public function EndpointMonitor()
$SignalStrength = $JSONData["data"][0]["signal"];
SetValue($this->GetIDForIdent("SignalStrength"), $SignalStrength);
$this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data SignalStrength ").$SignalStrength, 0);
$ConnectedDevices = $JSONData["data"][0]["num_sta"];
SetValue($this->GetIDForIdent("ConnectedDevices"), ConnectedDevices);
$this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connected Devices ").$ConnectedDevices, 0);
}
if ($this->ReadPropertyBoolean("DataPointTransfer") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0 && $ConnectionConfigError == false)
{
Expand Down

0 comments on commit 3a3f6f2

Please sign in to comment.