From 465dcc3999be77616c80c811b765f5a82276434b Mon Sep 17 00:00:00 2001 From: elueckel <30531515+elueckel@users.noreply.github.com> Date: Sun, 1 Sep 2024 10:54:51 +0200 Subject: [PATCH] this->setvalue & last uplink --- .DS_Store | Bin 14340 -> 12292 bytes UniFi Device Monitor/README_en.md | 5 +-- UniFi Device Monitor/module.php | 30 +++++++++--------- UniFi Endpoint Blocker/module.php | 2 +- UniFi Endpoint Monitor/module.php | 36 +++++++++++----------- UniFi Internet Controller/module.php | 6 ++-- UniFi Multi Endpoint Monitor/README.md | 3 +- UniFi Multi Endpoint Monitor/README_en.md | 1 + UniFi Multi Endpoint Monitor/locale.json | 1 + UniFi Multi Endpoint Monitor/module.php | 6 ++++ UniFi PoE Control/module.php | 4 +-- UniFi Presence Manager/module.php | 8 ++--- tests/.DS_Store | Bin 6148 -> 6148 bytes 13 files changed, 56 insertions(+), 46 deletions(-) diff --git a/.DS_Store b/.DS_Store index 4284437f780c58647f0aa77ae1b377be7d88ec2a..1b99c0725db13bd9bea8d5e5302309aaaa636b7b 100644 GIT binary patch literal 12292 zcmeHNO^6&t6n?!ko9$&IS#i}B6dU{t7&p7d1Vx0|*;ysvO2|Y7qi&{mhTSne-NSTm zhOjKmMMQ%~y(;3}zUE+UJ;yBLG|mYdhgYH zuU@~ZdNo93ly~bZL`R9pL=|xUFdlCaS#y9&5&fbLl>%A})aOz0K2Ox7XHhL$CwB;Y zxM2!Sg1(4)7rh7?mA+1G^3dW^0FGsH@N0`MQiD3}ot5gA*J_6>uZnSlmRGOXj%TCI z{N*wGgGb6=u1elZv@QA>%@N3|i?)EafVP0PfVRM`X#uhJqL_*GK5W%bZ2@h8TiOC5 zK3J#%mLk{-p$r{(h%LP67h8B)@Gke(fR<$!=!9ZKJA1>D=wy^asGr&b+5*ECcoGV*Du#P=f$scp6A&8_nQ4uv(eq0Us&_ppw@I79ZArvH-Pf$%T2fLb<5ta zTlXbxHS92F&DqWQ#l5`~Pc9#`o;Z1G|CqJ+)Z^m)#Hs!LS@X^Zjz4{N^P8-&p>tI930h2%|Xtm_MV4V15|0pK=UN&JHw2Mgz5M9EIBhMKAP2`#S4!qQ9 z%guK}qEK%ARp-skguC$DHxDw=sv}=J5~qQ4%ce%He}f-)Y8kaO3u8OPleo6AMu@f+J@ z1xCKj>>Ml{jIxs%g=|>s--WwRn#?F8GFetYXtJERB$`N`xWeQ!Liv+>g(tE${xNWw zG&xtqa&n9a51iLJ`H%AP$&17+CwqwnGqt{*JYUR%?YNAg%Ou;$Z^gV|Ok43io2@0H z897>=KvKsXC;yjF6G8R@vc%+nl0}>MNI5XFX2b)P1084&XBls{X<)N%f zMYYNQ6%AF@m4V{0_{agqMiN6Yvb|vW$)QS0lev{mHH1?fj!cKBW@RX0NM$Gnk|^pS zDkf(r`v8OcKco5N3(7i^Z;SD8=v)UzASgIN0@~te0@dPtleej6ZO&0+Vr0rWH2I*Q z@??Dh-pLEpd05qUfSeAAdU-))$DznfJRmsvl#mion(5n7;pn=SL8GeOpWiEC-dw0@-RV?yah<*SetValue \ No newline at end of file diff --git a/UniFi Device Monitor/module.php b/UniFi Device Monitor/module.php index d63dafa..94643a4 100644 --- a/UniFi Device Monitor/module.php +++ b/UniFi Device Monitor/module.php @@ -154,62 +154,62 @@ public function DeviceMonitor() if ($this->ReadPropertyBoolean("DataPointBasic") == 1) { $DeviceModel = $JSONData["data"][0]["model"]; - SetValue($this->GetIDForIdent("DeviceModel"), $DeviceModel); + $this->SetValue("DeviceModel", $DeviceModel); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Device Model ").$DeviceModel, 0); $SoftwareVersion = $JSONData["data"][0]["version"]; - SetValue($this->GetIDForIdent("SoftwareVersion"), $SoftwareVersion); + $this->SetValue("SoftwareVersion", $SoftwareVersion); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Software Version ").$SoftwareVersion, 0); //$Satisfaction = $JSONData["data"][0]["satisfaction"]; //SetValue($this->GetIDForIdent("Satisfaction"),$Satisfaction); //$this->SendDebug($this->Translate("Device Monitor"),$this->Translate("Device Satisfaction ").$Satisfaction,0); $SLastSeen = $JSONData["data"][0]["last_seen"]; - SetValue($this->GetIDForIdent("LastSeen"), gmdate("Y-m-d H:i:s", $SLastSeen)); + $this->SetValue("LastSeen", gmdate("Y-m-d H:i:s", $SLastSeen)); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Connection Data Last Seen ").gmdate("Y-m-d H:i:s", $SLastSeen), 0); $Uptime = $JSONData["data"][0]["uptime"]; - SetValue($this->GetIDForIdent("Uptime"), round($Uptime / 3600, 0)); + $this->SetValue("Uptime", round($Uptime / 3600, 0)); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Connection Data Uptime in hours ").round($Uptime / 3600, 0), 0); if (isset($JSONData["data"][0]["name"])) { $Name = $JSONData["data"][0]["name"]; - SetValue($this->GetIDForIdent("Name"), $Name); + $this->SetValue("Name", $Name); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Devicename ").$Name, 0); } } if ($this->ReadPropertyBoolean("DataPointHardware") == 1) { $CPULoad = $JSONData["data"][0]["system-stats"]["cpu"]; - SetValue($this->GetIDForIdent("CPULoad"), $CPULoad); + $this->SetValue("CPULoad", $CPULoad); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("CPU Load ").$CPULoad, 0); $MemoryLoad = $JSONData["data"][0]["system-stats"]["mem"]; - SetValue($this->GetIDForIdent("MemoryLoad"), $MemoryLoad); + $this->SetValue("MemoryLoad", $MemoryLoad); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Memory Load ").$MemoryLoad, 0); $ConnectedDevices = $JSONData["data"][0]["num_sta"]; - SetValue($this->GetIDForIdent("ConnectedDevices"), $ConnectedDevices); + $this->SetValue("ConnectedDevices", $ConnectedDevices); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connected Devices ").$ConnectedDevices, 0); } if ($this->ReadPropertyBoolean("DataPointSpecific") == 1 && $this->ReadPropertyInteger("DeviceType") == 0 && $DeviceConfigError == false) { $WAN1IP = $JSONData["data"][0]["wan1"]["ip"]; - SetValue($this->GetIDForIdent("WAN1IP"), $WAN1IP); + $this->SetValue("WAN1IP", $WAN1IP); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Connection Data WAN 1 IP ").$WAN1IP, 0); $WAN1TXBytes = $JSONData["data"][0]["wan1"]["tx_bytes"]; - SetValue($this->GetIDForIdent("WAN1TXBytes"), $WAN1TXBytes / 1000000); + $this->SetValue("WAN1TXBytes", $WAN1TXBytes / 1000000); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Transfer Data WAN 1 TX Bytes ").$WAN1TXBytes, 0); $WAN1RXBytes = $JSONData["data"][0]["wan1"]["rx_bytes"]; - SetValue($this->GetIDForIdent("WAN1RXBytes"), $WAN1RXBytes / 1000000); + $this->SetValue("WAN1RXBytes", $WAN1RXBytes / 1000000); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data WAN 1 RX Bytes ").$WAN1RXBytes, 0); $WAN1TXPackets = $JSONData["data"][0]["wan1"]["tx_packets"]; - SetValue($this->GetIDForIdent("WAN1TXPackets"), $WAN1TXPackets); + $this->SetValue("WAN1TXPackets", $WAN1TXPackets); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Transfer Data WAN 1 TX Packets ").$WAN1TXPackets, 0); $WAN1RXPackets = $JSONData["data"][0]["wan1"]["tx_packets"]; - SetValue($this->GetIDForIdent("WAN1RXPackets"), $WAN1RXPackets); + $this->SetValue("WAN1RXPackets", $WAN1RXPackets); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Transfer Data WAN 1 RXPackets ").$WAN1RXPackets, 0); $WAN1TXErrors = $JSONData["data"][0]["wan1"]["tx_errors"]; - SetValue($this->GetIDForIdent("WAN1TXErrors"), $WAN1TXErrors); + $this->SetValue("WAN1TXErrors", $WAN1TXErrors); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Transfer Data WAN 1 TX Errors ").$WAN1TXErrors, 0); $WAN1RXErrors = $JSONData["data"][0]["wan1"]["rx_errors"]; - SetValue($this->GetIDForIdent("WAN1RXErrors"), $WAN1RXErrors); + $this->SetValue("WAN1RXErrors", $WAN1RXErrors); $this->SendDebug($this->Translate("Device Monitor"), $this->Translate("Transfer Data WAN 1 RX Errors ").$WAN1RXErrors, 0); } } diff --git a/UniFi Endpoint Blocker/module.php b/UniFi Endpoint Blocker/module.php index 2a14184..15cd5bd 100644 --- a/UniFi Endpoint Blocker/module.php +++ b/UniFi Endpoint Blocker/module.php @@ -64,7 +64,7 @@ public function ApplyChanges() $this->RegisterVariableBoolean($DeviceMacClean, $DeviceName, "~Switch"); $DeviceMacCleanID = @IPS_GetObjectIDByIdent($DeviceMacClean, $this->InstanceID); - SetValue($DeviceMacCleanID, true); + $this->SetValue($DeviceMacCleanID, true); IPS_Sleep(1000); $this->EnableAction($DeviceMacClean); $this->RegisterMessage($DeviceMacCleanID, VM_UPDATE); diff --git a/UniFi Endpoint Monitor/module.php b/UniFi Endpoint Monitor/module.php index 7cd364d..5d42bf6 100644 --- a/UniFi Endpoint Monitor/module.php +++ b/UniFi Endpoint Monitor/module.php @@ -175,7 +175,7 @@ public function EndpointMonitor() //after a device gets reconnected, wait until the controller has rebuilt the data set $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Device was disconnected and is now connected again. Module waits for Controller to collect data."), 0); IPS_Sleep(10000); - SetValue($this->GetIDForIdent("Connected"), true); + $this->SetValue("Connected", true); $RawData = $this->getRawData($Cookie, $ServerAddress, $ServerPort, $UnifiAPI, $ControllerType); $JSONData = json_decode($RawData, true); } @@ -195,7 +195,7 @@ public function EndpointMonitor() if ($this->ReadPropertyBoolean("DataPointNetwork") == 1) { $IPAddress = $JSONData["data"][0]["ip"]; - SetValue($this->GetIDForIdent("IPAddress"), $IPAddress); + $this->SetValue("IPAddress", $IPAddress); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Network Data IP ").$IPAddress, 0); if ("" != $JSONData["data"][0]["hostname"]) @@ -210,7 +210,7 @@ public function EndpointMonitor() { $Hostname = ""; } - SetValue($this->GetIDForIdent("Hostname"), $Hostname); + $this->SetValue("Hostname", $Hostname); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Network Data Hostname ").$Hostname, 0); //$Name = $JSONData["data"][0]["name"]; //SetValue($this->GetIDForIdent("Name"),$Name); @@ -220,60 +220,60 @@ public function EndpointMonitor() { if (isset($JSONData["data"][0]["satisfaction"])) { $Satisfaction = isset($JSONData["data"][0]["satisfaction"]); - SetValue($this->GetIDForIdent("Satisfaction"), $Satisfaction); + $this->SetValue("Satisfaction", $Satisfaction); } $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Satisfaction ").$Satisfaction, 0); $SLastSeen = $JSONData["data"][0]["last_seen"]; - SetValue($this->GetIDForIdent("LastSeen"), gmdate("Y-m-d H:i:s", $SLastSeen)); + $this->SetValue("LastSeen", gmdate("Y-m-d H:i:s", $SLastSeen)); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Last Seen ").gmdate("Y-m-d H:i:s", $SLastSeen), 0); $Uptime = $JSONData["data"][0]["uptime"]; - SetValue($this->GetIDForIdent("Uptime"), round($Uptime / 3600, 0)); + $this->SetValue("Uptime", round($Uptime / 3600, 0)); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Uptime in hours ").round($Uptime / 3600, 0), 0); } if ($this->ReadPropertyBoolean("DataPointConnection") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0 && $ConnectionConfigError == false) { $Accesspoint = $JSONData["data"][0]["ap_mac"]; - SetValue($this->GetIDForIdent("Accesspoint"), $Accesspoint); + $this->SetValue("Accesspoint", $Accesspoint); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Accesspoint ").$Accesspoint, 0); $Channel = $JSONData["data"][0]["channel"]; - SetValue($this->GetIDForIdent("Channel"), $Channel); + $this->SetValue("Channel", $Channel); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Channel ").$Channel, 0); $Radio = $JSONData["data"][0]["radio"]; - SetValue($this->GetIDForIdent("Radio"), $Radio); + $this->SetValue("Radio", $Radio); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Radio ").$Radio, 0); $ESSID = $JSONData["data"][0]["essid"]; - SetValue($this->GetIDForIdent("ESSID"), $ESSID); + $this->SetValue("ESSID", $ESSID); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data ESSID ").$ESSID, 0); $RSSI = $JSONData["data"][0]["rssi"]; - SetValue($this->GetIDForIdent("RSSI"), $RSSI); + $this->SetValue("RSSI", $RSSI); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data RSSI ").$RSSI, 0); $Noise = $JSONData["data"][0]["noise"]; - SetValue($this->GetIDForIdent("Noise"), $Noise); + $this->SetValue("Noise", $Noise); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Noise ").$Noise, 0); $SignalStrength = $JSONData["data"][0]["signal"]; - SetValue($this->GetIDForIdent("SignalStrength"), $SignalStrength); + $this->SetValue("SignalStrength", $SignalStrength); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data SignalStrength ").$SignalStrength, 0); } if ($this->ReadPropertyBoolean("DataPointTransfer") == 1 && $this->ReadPropertyInteger("ConnectionType") == 0 && $ConnectionConfigError == false) { $TXBytes = $JSONData["data"][0]["tx_bytes"]; - SetValue($this->GetIDForIdent("TXBytes"), $TXBytes / 1000000); + $this->SetValue("TXBytes", $TXBytes / 1000000); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data TXBytes ").$TXBytes / 1000000, 0); $RXBytes = $JSONData["data"][0]["rx_bytes"]; - SetValue($this->GetIDForIdent("RXBytes"), $RXBytes / 1000000); + $this->SetValue("RXBytes", $RXBytes / 1000000); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data RXBytes ").$RXBytes / 1000000, 0); $TXPackets = $JSONData["data"][0]["tx_packets"]; - SetValue($this->GetIDForIdent("TXPackets"), $TXPackets); + $this->SetValue("TXPackets", $TXPackets); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data TXPackets ").$TXPackets, 0); $RXPackets = $JSONData["data"][0]["rx_packets"]; - SetValue($this->GetIDForIdent("RXPackets"), $RXPackets); + $this->SetValue("RXPackets", $RXPackets); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data RXPackets ").$RXPackets, 0); } } elseif ($DeviceAvailable == "error") { $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Device to be monitored is not available / Disconnected"), 0); - SetValue($this->GetIDForIdent("Connected"), false); + $this->SetValue("Connected", false); } } else diff --git a/UniFi Internet Controller/module.php b/UniFi Internet Controller/module.php index 24aa8a0..f58e1d0 100644 --- a/UniFi Internet Controller/module.php +++ b/UniFi Internet Controller/module.php @@ -198,7 +198,7 @@ public function GetInternetData() if ($value != GetValue($this->GetIDForIdent($variable['ident']))) { $this->SendDebug($this->Translate($variable['localeName']), $this->Translate("updated to ").$value, 0); - SetValue($this->GetIDForIdent($variable['ident']), $value); + $this->SetValue($variable['ident'], $value); } else { @@ -243,7 +243,7 @@ public function GetInternetData() if ($value != GetValue($this->GetIDForIdent($variable['ident']))) { $this->SendDebug($this->Translate($variable['localeName']), $this->Translate("updated to ").$value, 0); - SetValue($this->GetIDForIdent($variable['ident']), $value); + $this->SetValue($variable['ident'], $value); } else { @@ -322,7 +322,7 @@ public function GetInternetData() if ($value != GetValue($this->GetIDForIdent($variable['ident']))) { $this->SendDebug($this->Translate($variable['localeName']), $this->Translate("updated to ").$value, 0); - SetValue($this->GetIDForIdent($variable['ident']), $value); + $this->SetValue($variable['ident'], $value); } else { diff --git a/UniFi Multi Endpoint Monitor/README.md b/UniFi Multi Endpoint Monitor/README.md index 2f05832..2b01ecc 100644 --- a/UniFi Multi Endpoint Monitor/README.md +++ b/UniFi Multi Endpoint Monitor/README.md @@ -90,7 +90,8 @@ Das Modul gibt diverse Informationen im Debug Bereich aus. Version 1.5 - 02-12-2023 * Neu - Modul verfügbar -Version 1.6 - 25-08-2024 (Credit M70 - Danke) +Version 1.6 - 01-09-2024 (Credit M70 - Danke) +* Neu - WLAN Geräte melden wo sie zuletzt angemeldet waren * Fix - Connection wurde nicht gesetzt * Fix - Satisfaction wurde nicht aktualisiert * Fix - IP wurde nicht gesetzt diff --git a/UniFi Multi Endpoint Monitor/README_en.md b/UniFi Multi Endpoint Monitor/README_en.md index b84ce11..00faef9 100644 --- a/UniFi Multi Endpoint Monitor/README_en.md +++ b/UniFi Multi Endpoint Monitor/README_en.md @@ -77,6 +77,7 @@ Version 1.6 - 02-12-2023 * Neu - Modul verfügbar Version 1.6 - 25-08-2024 (Credit M70 - Danke) +* New - WLAN Devices report where they have been logged in last * Fix - Connection was not set * Fix - Satisfaction was not set * Fix - IP was not set diff --git a/UniFi Multi Endpoint Monitor/locale.json b/UniFi Multi Endpoint Monitor/locale.json index c8c8528..0cf19ac 100644 --- a/UniFi Multi Endpoint Monitor/locale.json +++ b/UniFi Multi Endpoint Monitor/locale.json @@ -42,6 +42,7 @@ "Radio": "Funktechnologie", "Noise": "Störung", "Signal Strength": "Signal Stärke", + "Last Uplink Name": "Letzte Verbindung (Access Point)", "TX Packets": "TX Pakete", "RX Packets": "RX Pakete", "Check site name": "Name der Site prüfen", diff --git a/UniFi Multi Endpoint Monitor/module.php b/UniFi Multi Endpoint Monitor/module.php index b581b44..8c5e4dc 100644 --- a/UniFi Multi Endpoint Monitor/module.php +++ b/UniFi Multi Endpoint Monitor/module.php @@ -93,6 +93,7 @@ public function ApplyChanges() $this->MaintainVariable($DeviceMac."RSSI", $DeviceName.$this->Translate(" RSSI"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $ConnectionType == 0); $this->MaintainVariable($DeviceMac."Noise", $DeviceName.$this->Translate(" Noise"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $ConnectionType == 0); $this->MaintainVariable($DeviceMac."SignalStrength", $DeviceName.$this->Translate(" Signal Strength"), vtInteger, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $ConnectionType == 0); + $this->MaintainVariable($DeviceMac."LastUplinkName", $DeviceName.$this->Translate(" Last Uplink Name"), vtString, "", $vpos++, $this->ReadPropertyBoolean("DataPointConnection") == 1 && $ConnectionType == 0); //Transfer Data $vpos = 600; @@ -295,6 +296,11 @@ public function EndpointMonitor() $this->SetValue($DeviceMac."SignalStrength", $SignalStrength); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data SignalStrength ").$SignalStrength, 0); } + if(isset($DeviceFromController["last_uplink_name"])) { + $LastUplinkName = $DeviceFromController["last_uplink_name"]; + $this->SetValue($DeviceMac."LastUplinkName", $LastUplinkName); + $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Last Uplink Name ").$LastUplinkName, 0); + } } if ($this->ReadPropertyBoolean("DataPointTransfer") == 1 AND $ConnectionType == 0 AND $ConnectionConfigError == false) { diff --git a/UniFi PoE Control/module.php b/UniFi PoE Control/module.php index b91c060..2d40219 100644 --- a/UniFi PoE Control/module.php +++ b/UniFi PoE Control/module.php @@ -63,7 +63,7 @@ public function ApplyChanges() $this->RegisterVariableBoolean($DeviceMacClean . $i, $DeviceName . " Port: " . $i, "~Switch"); $DeviceMacCleanID = @IPS_GetObjectIDByIdent($DeviceMacClean .$i, $this->InstanceID); - SetValue($DeviceMacCleanID, false); + $this->SetValue($DeviceMacCleanID, false); IPS_Sleep(1000); $this->EnableAction($DeviceMacClean . $i); $this->RegisterMessage($DeviceMacCleanID, VM_UPDATE); @@ -218,7 +218,7 @@ public function AuthenticateAndProcessRequest(string $UnifiAPI = "") if ($ControllerFeedbackOK == "ok") { // reset variable - SetValue($SenderID, false); + $this->SetValue($SenderID, false); //WFC_SendPopup(12345, "Test", "Eine nette
Meldung"); } elseif ($ControllerFeedbackOK == "error") diff --git a/UniFi Presence Manager/module.php b/UniFi Presence Manager/module.php index 78f0051..3059597 100644 --- a/UniFi Presence Manager/module.php +++ b/UniFi Presence Manager/module.php @@ -144,10 +144,10 @@ public function CheckPresence() { if ($OldPresenceValue == 0) { //check if new value is different and only than trigger a replacement - SetValue($this->GetIDForIdent($DeviceMac), 1); + $this->SetValue($DeviceMac, 1); if ($this->ReadPropertyBoolean("GeneralPresenceUpdatedVariable") == 1) { - SetValue($this->GetIDForIdent("GeneralPresenceUpdatedVariable"), 1); + $this->SetValue("GeneralPresenceUpdatedVariable", 1); } $this->SendDebug($this->Translate("Presence Manager"), $this->Translate("Device ACTIVE with MAC: ".$DeviceMac), 0); } @@ -159,10 +159,10 @@ public function CheckPresence() { if ($OldPresenceValue == 1) { - SetValue($this->GetIDForIdent($DeviceMac), 0); + $this->SetValue($DeviceMac, 0); if ($this->ReadPropertyBoolean("GeneralPresenceUpdatedVariable") == 1) { - SetValue($this->GetIDForIdent("GeneralPresenceUpdatedVariable"), 1); + $this->SetValue("GeneralPresenceUpdatedVariable", 1); } $this->SendDebug($this->Translate("Presence Manager"), $this->Translate("Device NOT active with MAC: ".$DeviceMac), 0); } diff --git a/tests/.DS_Store b/tests/.DS_Store index a2944cfb99b7052f63fdea0a87009563ce378972..a7dcb5ecdb6b1651d623812e7936bea62a153774 100644 GIT binary patch delta 52 ucmZoMXffE}!o+IzP`3NrWKSkpC@Y(3B5T)LX`mP*vn8CRyE%t>h6n)qZxY!6 delta 52 ucmZoMXffE}!o*sDL^qsW=l9rcXJN&3=shAM-kru