diff --git a/README.md b/README.md index 0a6c629..d174a2b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Version](https://img.shields.io/badge/Symcon-PHP--Modul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/) [![Product](https://img.shields.io/badge/Symcon%20Version-6.4-blue.svg)](https://www.symcon.de/produkt/) -[![Version](https://img.shields.io/badge/Modul%20Version-3.1.20231127-orange.svg)](https://github.com/Wilkware/IPSymconTwinkly) +[![Version](https://img.shields.io/badge/Modul%20Version-3.2.20240222-orange.svg)](https://github.com/Wilkware/IPSymconTwinkly) [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/) [![Actions](https://github.com/Wilkware/IPSymconTwinkly/workflows/Check%20Style/badge.svg)](https://github.com/Wilkware/IPSymconTwinkly/actions) @@ -236,6 +236,13 @@ __Beispiel__: `TWICKLY_DeviceName(12345, 'Lichterkette');` Ausgabe "Der Name wur ### 8. Versionshistorie +v3.2.20240222 + +* _NEU_: Anpassungen für IPS 7.x (Konfigurator & TileVisu) +* _NEU_: Schaltervariable migriert auf Boolean +* _FIX_: Übersetzungen nachgezogen +* _FIX_: Interne Bibliotheken überarbeitet + v3.1.20231127 * _NEU_: Steuerung der Film(effekte) hinzugefügt diff --git a/TwinklyDevice/locale.json b/TwinklyDevice/locale.json index 64e1c35..57e87a5 100644 --- a/TwinklyDevice/locale.json +++ b/TwinklyDevice/locale.json @@ -1,6 +1,9 @@ { "translations": { "de": { + "Twinkly Device": "Twinkly Gerät", + "Twinkly fairy lights": "Twinkly Lichterkette", + "Smart LED fairy lights": "Smart LED Lichterkette", "\nTWINKLY – The smart LED light string\n ": "\nTWINKLY – Die intelligente LED-Lichterkette\n ", "The module is used to integrate and control Twinkly devices (smart LED light chains) in IP-Symcon.": "Das Modul dient zur Einbindung und Steuerung von Twinkly Geräten (Smarte LED Lichterketten) in IP-Symcon.", "Mode": "Modus", diff --git a/TwinklyDevice/module.json b/TwinklyDevice/module.json index 710eb65..f8d7b07 100644 --- a/TwinklyDevice/module.json +++ b/TwinklyDevice/module.json @@ -1,13 +1,13 @@ { "id": "{A8ACEF24-02E6-A5A6-8409-64B16A8A3DC0}", "name": "Twinkly Device", + "url": "https://wilkware.de/ip-symcon-module/twinkly", "type": 3, "vendor": "Ledworks", "aliases": [ - "Smart LED Lichterkette", - "Twinkly Lichterkette" + "Twinkly fairy lights", + "Smart LED fairy lights" ], - "url": "https://wilkware.de/ip-symcon-module/twinkly", "parentRequirements": [], "childRequirements": [], "implemented": [], diff --git a/TwinklyDevice/module.php b/TwinklyDevice/module.php index 8ab1f73..b62bf45 100644 --- a/TwinklyDevice/module.php +++ b/TwinklyDevice/module.php @@ -92,7 +92,7 @@ public function Create() $exists = @$this->GetIDForIdent('Movie'); // Profile anlegen - $this->RegisterProfileInteger('Twinkly.Switch', 'Light', '', '', 0, 0, 0, $this->assoSWITCH); + //$this->RegisterProfileInteger('Twinkly.Switch', 'Light', '', '', 0, 0, 0, $this->assoSWITCH); $this->RegisterProfileInteger('Twinkly.Effect', 'Stars', '', '', 1, 5, 1); $this->RegisterProfileInteger('Twinkly.Mode', 'Remote', '', '', 0, 0, 0, $this->assoMODE); $this->RegisterProfileInteger('Twinkly.ModeEx', 'Remote', '', '', 0, 0, 0, $this->assoMODEEX); @@ -101,7 +101,7 @@ public function Create() } // Variablen erzeugen - $this->RegisterVariableInteger('Switch', $this->Translate('Switch'), 'Twinkly.Switch', 0); + $this->RegisterVariableBoolean('Switch', $this->Translate('Switch'), '~Switch', 0); $this->RegisterVariableInteger('Mode', $this->Translate('Mode'), 'Twinkly.Mode', 1); $this->RegisterVariableInteger('Color', $this->Translate('Color'), '~HexColor', 2); $this->RegisterVariableInteger('Effect', $this->Translate('Effect'), 'Twinkly.Effect', 3); @@ -199,7 +199,7 @@ public function RequestAction($ident, $value) break; case 'Switch': $this->SetSwitch($value); - $this->SetValueInteger($ident, $value); + $this->SetValueBoolean($ident, $value); break; case 'Mode': $this->SetMode($value); @@ -516,7 +516,7 @@ public function DeviceName(string $value) * * @param bool $value State value. */ - private function SetSwitch(int $value) + private function SetSwitch(bool $value) { if ($this->CheckLogin() === false) { $this->SendDebug(__FUNCTION__, 'Login error!'); @@ -528,7 +528,7 @@ private function SetSwitch(int $value) $token = $this->ReadAttributeString('Token'); // Mode $mode = 'off'; // Default - if ($value == 1) { // 1 == 'On' + if ($value) { // 1 == 'On' (true) $mode = $this->assoMODEEX[$this->GetValue('Mode')][4]; } $this->SendDebug(__FUNCTION__, 'Switch mode: ' . $mode, 0); @@ -545,7 +545,7 @@ private function SetSwitch(int $value) */ private function SetMode(int $value) { - if ($this->GetValue('Switch') == 0) { // 0 == 'Off' + if ($this->GetValue('Switch') == false) { // 0 == 'Off' (false) return; } if ($this->CheckLogin() === false) { diff --git a/TwinklyDiscovery/form.json b/TwinklyDiscovery/form.json index ff92d0f..1709453 100644 --- a/TwinklyDiscovery/form.json +++ b/TwinklyDiscovery/form.json @@ -24,7 +24,8 @@ { "type": "SelectCategory", "name": "TargetCategory", - "caption": "Target Category:" + "caption": "Target Category:", + "visible": false } ], "actions": [ diff --git a/TwinklyDiscovery/module.json b/TwinklyDiscovery/module.json index 65d2b1f..fb9290b 100644 --- a/TwinklyDiscovery/module.json +++ b/TwinklyDiscovery/module.json @@ -1,10 +1,10 @@ { "id": "{4C36BA50-BD40-FA02-B567-354E28F45615}", "name": "Twinkly Discovery", + "url": "https://wilkware.de/ip-symcon-module/twinkly", "type": 5, "vendor": "Ledworks", "aliases": [], - "url": "https://wilkware.de/ip-symcon-module/twinkly", "parentRequirements": [], "childRequirements": [], "implemented": [], diff --git a/TwinklyDiscovery/module.php b/TwinklyDiscovery/module.php index 04d2197..0edb641 100644 --- a/TwinklyDiscovery/module.php +++ b/TwinklyDiscovery/module.php @@ -46,8 +46,14 @@ public function GetConfigurationForm() { $form = json_decode(file_get_contents(__DIR__ . '/form.json'), true); $devices = $this->DiscoverDevices(); + // Version check + $version = (float) IPS_GetKernelVersion(); // Save location $location = $this->GetPathOfCategory($this->ReadPropertyInteger('TargetCategory')); + // Enable or disable "TargetCategory" for 6.x + if ($version < 7) { + $form['elements'][2]['visible'] = true; + } // Build configuration list values if (!empty($devices)) { foreach ($devices as $device) { @@ -60,7 +66,7 @@ public function GetConfigurationForm() [ 'moduleID' => '{A8ACEF24-02E6-A5A6-8409-64B16A8A3DC0}', 'configuration' => ['Host' => $device['host']], - 'location' => $location, + 'location' => ($version < 7) ? $location : [], ], ], ]; diff --git a/libs/EventHelper.php b/libs/EventHelper.php index ca5e95d..f161265 100644 --- a/libs/EventHelper.php +++ b/libs/EventHelper.php @@ -425,4 +425,32 @@ protected function GetWeeklyScheduleInfo($id, $time = null, $checkonly = false) return $data; } + + /** + * Versucht eine Semaphore zu setzen und wiederholt dies bei Misserfolg bis zu 100 mal. + * + * @param string $ident Ein String der den Lock bezeichnet. + * @return boolean TRUE bei Erfolg, FALSE bei Misserfolg. + */ + private function SemaphoreEnter($ident) + { + for ($i = 0; $i < 100; $i++) { + if (IPS_SemaphoreEnter(__CLASS__ . '.' . (string) $this->InstanceID . (string) $ident, 1)) { + return true; + } else { + IPS_Sleep(mt_rand(1, 5)); + } + } + return false; + } + + /** + * Löscht eine Semaphore. + * + * @param string $ident Ein String der den Lock bezeichnet. + */ + private function SemaphoreLeave($ident) + { + IPS_SemaphoreLeave(__CLASS__ . '.' . (string) $this->InstanceID . (string) $ident); + } } diff --git a/libs/ProfileHelper.php b/libs/ProfileHelper.php index 1eebadf..473fb4c 100644 --- a/libs/ProfileHelper.php +++ b/libs/ProfileHelper.php @@ -106,13 +106,8 @@ protected function RegisterProfileFloat($name, $icon, $prefix, $suffix, $minvalu IPS_SetVariableProfileIcon($name, $icon); IPS_SetVariableProfileText($name, $prefix, $suffix); - IPS_SetVariableProfileDigits($name, $digits); - - if (($asso !== null) && (count($asso) !== 0)) { - $minvalue = 0; - $maxvalue = 0; - } IPS_SetVariableProfileValues($name, $minvalue, $maxvalue, $stepsize); + IPS_SetVariableProfileDigits($name, $digits); if (($asso !== null) && (count($asso) !== 0)) { foreach ($asso as $ass) { @@ -130,16 +125,32 @@ protected function RegisterProfileFloat($name, $icon, $prefix, $suffix, $minvalu * @param string $suffix Variable suffix. * @param array $asso Associations of the values. */ - protected function RegisterProfileString($name, $icon, $prefix, $suffix, $asso = null) + protected function RegisterProfileString($name, $icon, $prefix, $suffix, $asso) { $this->RegisterProfileType($name, VARIABLETYPE_STRING); - IPS_SetVariableProfileText($name, $prefix, $suffix); IPS_SetVariableProfileIcon($name, $icon); + IPS_SetVariableProfileText($name, $prefix, $suffix); + if (($asso !== null) && (count($asso) !== 0)) { foreach ($asso as $ass) { IPS_SetVariableProfileAssociation($name, $ass[0], $this->Translate($ass[1]), $ass[2], $ass[3]); } } } + + /** + * Returns the used profile name of a variable + * + * @param int $id Variable ID + * @return string Empty, or name of the profile + */ + protected function GetVariableProfile($id) + { + $variableProfileName = IPS_GetVariable($id)['VariableCustomProfile']; + if ($variableProfileName == '') { + $variableProfileName = IPS_GetVariable($id)['VariableProfile']; + } + return $variableProfileName; + } } diff --git a/libs/VariableHelper.php b/libs/VariableHelper.php index b7d4b54..a75adfa 100644 --- a/libs/VariableHelper.php +++ b/libs/VariableHelper.php @@ -61,6 +61,20 @@ protected function SetValueInteger(string $ident, int $value) } } + /** + * Update a float value. + * + * @param string $ident Ident of the float variable + * @param float $value Value of the float variable + */ + protected function SetValueFloat(string $ident, float $value) + { + $id = @$this->GetIDForIdent($ident); + if ($id !== false) { + SetValueFloat($id, $value); + } + } + /** * Sets the variable inactive. * diff --git a/libs/_traits.php b/libs/_traits.php index 6ba9a42..b2d3622 100644 --- a/libs/_traits.php +++ b/libs/_traits.php @@ -16,90 +16,90 @@ if (!defined('IPS_BASE')) { // --- BASE MESSAGE - define('IPS_BASE', 10000); //Base Message - define('IPS_KERNELSTARTED', IPS_BASE + 1); //Post Ready Message - define('IPS_KERNELSHUTDOWN', IPS_BASE + 2); //Pre Shutdown Message, Runlevel UNINIT Follows + define('IPS_BASE', 10000); // Base Message + define('IPS_KERNELSTARTED', IPS_BASE + 1); // Post Ready Message + define('IPS_KERNELSHUTDOWN', IPS_BASE + 2); // Pre Shutdown Message, Runlevel UNINIT Follows } if (!defined('IPS_KERNELMESSAGE')) { // --- KERNEL - define('IPS_KERNELMESSAGE', IPS_BASE + 100); //Kernel Message - define('KR_CREATE', IPS_KERNELMESSAGE + 1); //Kernel is beeing created - define('KR_INIT', IPS_KERNELMESSAGE + 2); //Kernel Components are beeing initialised, Modules loaded, Settings read - define('KR_READY', IPS_KERNELMESSAGE + 3); //Kernel is ready and running - define('KR_UNINIT', IPS_KERNELMESSAGE + 4); //Got Shutdown Message, unloading all stuff - define('KR_SHUTDOWN', IPS_KERNELMESSAGE + 5); //Uninit Complete, Destroying Kernel Inteface + define('IPS_KERNELMESSAGE', IPS_BASE + 100); // Kernel Message + define('KR_CREATE', IPS_KERNELMESSAGE + 1); // Kernel is beeing created + define('KR_INIT', IPS_KERNELMESSAGE + 2); // Kernel Components are beeing initialised, Modules loaded, Settings read + define('KR_READY', IPS_KERNELMESSAGE + 3); // Kernel is ready and running + define('KR_UNINIT', IPS_KERNELMESSAGE + 4); // Got Shutdown Message, unloading all stuff + define('KR_SHUTDOWN', IPS_KERNELMESSAGE + 5); // Uninit Complete, Destroying Kernel Inteface } if (!defined('IPS_LOGMESSAGE')) { // --- KERNEL LOGMESSAGE - define('IPS_LOGMESSAGE', IPS_BASE + 200); //Logmessage Message - define('KL_MESSAGE', IPS_LOGMESSAGE + 1); //Normal Message | FG: Black | BG: White | STLYE : NONE - define('KL_SUCCESS', IPS_LOGMESSAGE + 2); //Success Message | FG: Black | BG: Green | STYLE : NONE - define('KL_NOTIFY', IPS_LOGMESSAGE + 3); //Notiy about Changes | FG: Black | BG: Blue | STLYE : NONE - define('KL_WARNING', IPS_LOGMESSAGE + 4); //Warnings | FG: Black | BG: Yellow | STLYE : NONE - define('KL_ERROR', IPS_LOGMESSAGE + 5); //Error Message | FG: Black | BG: Red | STLYE : BOLD - define('KL_DEBUG', IPS_LOGMESSAGE + 6); //Debug Informations + Script Results | FG: Grey | BG: White | STLYE : NONE - define('KL_CUSTOM', IPS_LOGMESSAGE + 7); //User Message | FG: Black | BG: White | STLYE : NONE + define('IPS_LOGMESSAGE', IPS_BASE + 200); // Logmessage Message + define('KL_MESSAGE', IPS_LOGMESSAGE + 1); // Normal Message | FG: Black | BG: White | STLYE : NONE + define('KL_SUCCESS', IPS_LOGMESSAGE + 2); // Success Message | FG: Black | BG: Green | STYLE : NONE + define('KL_NOTIFY', IPS_LOGMESSAGE + 3); // Notiy about Changes | FG: Black | BG: Blue | STLYE : NONE + define('KL_WARNING', IPS_LOGMESSAGE + 4); // Warnings | FG: Black | BG: Yellow | STLYE : NONE + define('KL_ERROR', IPS_LOGMESSAGE + 5); // Error Message | FG: Black | BG: Red | STLYE : BOLD + define('KL_DEBUG', IPS_LOGMESSAGE + 6); // Debug Informations + Script Results | FG: Grey | BG: White | STLYE : NONE + define('KL_CUSTOM', IPS_LOGMESSAGE + 7); // User Message | FG: Black | BG: White | STLYE : NONE } if (!defined('IPS_MODULEMESSAGE')) { // --- MODULE LOADER - define('IPS_MODULEMESSAGE', IPS_BASE + 300); //ModuleLoader Message - define('ML_LOAD', IPS_MODULEMESSAGE + 1); //Module loaded - define('ML_UNLOAD', IPS_MODULEMESSAGE + 2); //Module unloaded + define('IPS_MODULEMESSAGE', IPS_BASE + 300); // ModuleLoader Message + define('ML_LOAD', IPS_MODULEMESSAGE + 1); // Module loaded + define('ML_UNLOAD', IPS_MODULEMESSAGE + 2); // Module unloaded } if (!defined('IPS_OBJECTMESSAGE')) { // --- OBJECT MANAGER define('IPS_OBJECTMESSAGE', IPS_BASE + 400); - define('OM_REGISTER', IPS_OBJECTMESSAGE + 1); //Object was registered - define('OM_UNREGISTER', IPS_OBJECTMESSAGE + 2); //Object was unregistered - define('OM_CHANGEPARENT', IPS_OBJECTMESSAGE + 3); //Parent was Changed - define('OM_CHANGENAME', IPS_OBJECTMESSAGE + 4); //Name was Changed - define('OM_CHANGEINFO', IPS_OBJECTMESSAGE + 5); //Info was Changed - define('OM_CHANGETYPE', IPS_OBJECTMESSAGE + 6); //Type was Changed - define('OM_CHANGESUMMARY', IPS_OBJECTMESSAGE + 7); //Summary was Changed - define('OM_CHANGEPOSITION', IPS_OBJECTMESSAGE + 8); //Position was Changed - define('OM_CHANGEREADONLY', IPS_OBJECTMESSAGE + 9); //ReadOnly was Changed - define('OM_CHANGEHIDDEN', IPS_OBJECTMESSAGE + 10); //Hidden was Changed - define('OM_CHANGEICON', IPS_OBJECTMESSAGE + 11); //Icon was Changed - define('OM_CHILDADDED', IPS_OBJECTMESSAGE + 12); //Child for Object was added - define('OM_CHILDREMOVED', IPS_OBJECTMESSAGE + 13); //Child for Object was removed - define('OM_CHANGEIDENT', IPS_OBJECTMESSAGE + 14); //Ident was Changed + define('OM_REGISTER', IPS_OBJECTMESSAGE + 1); // Object was registered + define('OM_UNREGISTER', IPS_OBJECTMESSAGE + 2); // Object was unregistered + define('OM_CHANGEPARENT', IPS_OBJECTMESSAGE + 3); // Parent was Changed + define('OM_CHANGENAME', IPS_OBJECTMESSAGE + 4); // Name was Changed + define('OM_CHANGEINFO', IPS_OBJECTMESSAGE + 5); // Info was Changed + define('OM_CHANGETYPE', IPS_OBJECTMESSAGE + 6); // Type was Changed + define('OM_CHANGESUMMARY', IPS_OBJECTMESSAGE + 7); // Summary was Changed + define('OM_CHANGEPOSITION', IPS_OBJECTMESSAGE + 8); // Position was Changed + define('OM_CHANGEREADONLY', IPS_OBJECTMESSAGE + 9); // ReadOnly was Changed + define('OM_CHANGEHIDDEN', IPS_OBJECTMESSAGE + 10); // Hidden was Changed + define('OM_CHANGEICON', IPS_OBJECTMESSAGE + 11); // Icon was Changed + define('OM_CHILDADDED', IPS_OBJECTMESSAGE + 12); // Child for Object was added + define('OM_CHILDREMOVED', IPS_OBJECTMESSAGE + 13); // Child for Object was removed + define('OM_CHANGEIDENT', IPS_OBJECTMESSAGE + 14); // Ident was Changed } if (!defined('IPS_INSTANCEMESSAGE')) { // --- INSTANCE MANAGER - define('IPS_INSTANCEMESSAGE', IPS_BASE + 500); //Instance Manager Message - define('IM_CREATE', IPS_INSTANCEMESSAGE + 1); //Instance created - define('IM_DELETE', IPS_INSTANCEMESSAGE + 2); //Instance deleted - define('IM_CONNECT', IPS_INSTANCEMESSAGE + 3); //Instance connectged - define('IM_DISCONNECT', IPS_INSTANCEMESSAGE + 4); //Instance disconncted - define('IM_CHANGESTATUS', IPS_INSTANCEMESSAGE + 5); //Status was Changed - define('IM_CHANGESETTINGS', IPS_INSTANCEMESSAGE + 6); //Settings were Changed - define('IM_CHANGESEARCH', IPS_INSTANCEMESSAGE + 7); //Searching was started/stopped - define('IM_SEARCHUPDATE', IPS_INSTANCEMESSAGE + 8); //Searching found new results - define('IM_SEARCHPROGRESS', IPS_INSTANCEMESSAGE + 9); //Searching progress in % - define('IM_SEARCHCOMPLETE', IPS_INSTANCEMESSAGE + 10); //Searching is complete + define('IPS_INSTANCEMESSAGE', IPS_BASE + 500); // Instance Manager Message + define('IM_CREATE', IPS_INSTANCEMESSAGE + 1); // Instance created + define('IM_DELETE', IPS_INSTANCEMESSAGE + 2); // Instance deleted + define('IM_CONNECT', IPS_INSTANCEMESSAGE + 3); // Instance connectged + define('IM_DISCONNECT', IPS_INSTANCEMESSAGE + 4); // Instance disconncted + define('IM_CHANGESTATUS', IPS_INSTANCEMESSAGE + 5); // Status was Changed + define('IM_CHANGESETTINGS', IPS_INSTANCEMESSAGE + 6); // Settings were Changed + define('IM_CHANGESEARCH', IPS_INSTANCEMESSAGE + 7); // Searching was started/stopped + define('IM_SEARCHUPDATE', IPS_INSTANCEMESSAGE + 8); // Searching found new results + define('IM_SEARCHPROGRESS', IPS_INSTANCEMESSAGE + 9); // Searching progress in % + define('IM_SEARCHCOMPLETE', IPS_INSTANCEMESSAGE + 10); // Searching is complete } if (!defined('IPS_VARIABLEMESSAGE')) { // --- VARIABLE MANAGER - define('IPS_VARIABLEMESSAGE', IPS_BASE + 600); //Variable Manager Message - define('VM_CREATE', IPS_VARIABLEMESSAGE + 1); //Variable Created - define('VM_DELETE', IPS_VARIABLEMESSAGE + 2); //Variable Deleted - define('VM_UPDATE', IPS_VARIABLEMESSAGE + 3); //On Variable Update - define('VM_CHANGEPROFILENAME', IPS_VARIABLEMESSAGE + 4); //On Profile Name Change - define('VM_CHANGEPROFILEACTION', IPS_VARIABLEMESSAGE + 5); //On Profile Action Change + define('IPS_VARIABLEMESSAGE', IPS_BASE + 600); // Variable Manager Message + define('VM_CREATE', IPS_VARIABLEMESSAGE + 1); // Variable Created + define('VM_DELETE', IPS_VARIABLEMESSAGE + 2); // Variable Deleted + define('VM_UPDATE', IPS_VARIABLEMESSAGE + 3); // On Variable Update + define('VM_CHANGEPROFILENAME', IPS_VARIABLEMESSAGE + 4); // On Profile Name Change + define('VM_CHANGEPROFILEACTION', IPS_VARIABLEMESSAGE + 5); // On Profile Action Change } if (!defined('IPS_SCRIPTMESSAGE')) { // --- SCRIPT MANAGER - define('IPS_SCRIPTMESSAGE', IPS_BASE + 700); //Script Manager Message - define('SM_CREATE', IPS_SCRIPTMESSAGE + 1); //On Script Create - define('SM_DELETE', IPS_SCRIPTMESSAGE + 2); //On Script Delete - define('SM_CHANGEFILE', IPS_SCRIPTMESSAGE + 3); //On Script File changed - define('SM_BROKEN', IPS_SCRIPTMESSAGE + 4); //Script Broken Status changed + define('IPS_SCRIPTMESSAGE', IPS_BASE + 700); // Script Manager Message + define('SM_CREATE', IPS_SCRIPTMESSAGE + 1); // On Script Create + define('SM_DELETE', IPS_SCRIPTMESSAGE + 2); // On Script Delete + define('SM_CHANGEFILE', IPS_SCRIPTMESSAGE + 3); // On Script File changed + define('SM_BROKEN', IPS_SCRIPTMESSAGE + 4); // Script Broken Status changed } if (!defined('IPS_EVENTMESSAGE')) { // --- EVENT MANAGER - define('IPS_EVENTMESSAGE', IPS_BASE + 800); //Event Scripter Message - define('EM_CREATE', IPS_EVENTMESSAGE + 1); //On Event Create - define('EM_DELETE', IPS_EVENTMESSAGE + 2); //On Event Delete + define('IPS_EVENTMESSAGE', IPS_BASE + 800); // Event Scripter Message + define('EM_CREATE', IPS_EVENTMESSAGE + 1); // On Event Create + define('EM_DELETE', IPS_EVENTMESSAGE + 2); // On Event Delete define('EM_UPDATE', IPS_EVENTMESSAGE + 3); define('EM_CHANGEACTIVE', IPS_EVENTMESSAGE + 4); define('EM_CHANGELIMIT', IPS_EVENTMESSAGE + 5); @@ -115,32 +115,32 @@ } if (!defined('IPS_MEDIAMESSAGE')) { // --- MEDIA MANAGER - define('IPS_MEDIAMESSAGE', IPS_BASE + 900); //Media Manager Message - define('MM_CREATE', IPS_MEDIAMESSAGE + 1); //On Media Create - define('MM_DELETE', IPS_MEDIAMESSAGE + 2); //On Media Delete - define('MM_CHANGEFILE', IPS_MEDIAMESSAGE + 3); //On Media File changed - define('MM_AVAILABLE', IPS_MEDIAMESSAGE + 4); //Media Available Status changed + define('IPS_MEDIAMESSAGE', IPS_BASE + 900); // Media Manager Message + define('MM_CREATE', IPS_MEDIAMESSAGE + 1); // On Media Create + define('MM_DELETE', IPS_MEDIAMESSAGE + 2); // On Media Delete + define('MM_CHANGEFILE', IPS_MEDIAMESSAGE + 3); // On Media File changed + define('MM_AVAILABLE', IPS_MEDIAMESSAGE + 4); // Media Available Status changed define('MM_UPDATE', IPS_MEDIAMESSAGE + 5); } if (!defined('IPS_LINKMESSAGE')) { // --- LINK MANAGER - define('IPS_LINKMESSAGE', IPS_BASE + 1000); //Link Manager Message - define('LM_CREATE', IPS_LINKMESSAGE + 1); //On Link Create - define('LM_DELETE', IPS_LINKMESSAGE + 2); //On Link Delete - define('LM_CHANGETARGET', IPS_LINKMESSAGE + 3); //On Link TargetID change + define('IPS_LINKMESSAGE', IPS_BASE + 1000); // Link Manager Message + define('LM_CREATE', IPS_LINKMESSAGE + 1); // On Link Create + define('LM_DELETE', IPS_LINKMESSAGE + 2); // On Link Delete + define('LM_CHANGETARGET', IPS_LINKMESSAGE + 3); // On Link TargetID change } if (!defined('IPS_FLOWMESSAGE')) { // --- DATA HANDLER - define('IPS_FLOWMESSAGE', IPS_BASE + 1100); //Data Handler Message - define('FM_CONNECT', IPS_FLOWMESSAGE + 1); //On Instance Connect - define('FM_DISCONNECT', IPS_FLOWMESSAGE + 2); //On Instance Disconnect + define('IPS_FLOWMESSAGE', IPS_BASE + 1100); // Data Handler Message + define('FM_CONNECT', IPS_FLOWMESSAGE + 1); // On Instance Connect + define('FM_DISCONNECT', IPS_FLOWMESSAGE + 2); // On Instance Disconnect } if (!defined('IPS_ENGINEMESSAGE')) { // --- SCRIPT ENGINE - define('IPS_ENGINEMESSAGE', IPS_BASE + 1200); //Script Engine Message - define('SE_UPDATE', IPS_ENGINEMESSAGE + 1); //On Library Refresh - define('SE_EXECUTE', IPS_ENGINEMESSAGE + 2); //On Script Finished execution - define('SE_RUNNING', IPS_ENGINEMESSAGE + 3); //On Script Started execution + define('IPS_ENGINEMESSAGE', IPS_BASE + 1200); // Script Engine Message + define('SE_UPDATE', IPS_ENGINEMESSAGE + 1); // On Library Refresh + define('SE_EXECUTE', IPS_ENGINEMESSAGE + 2); // On Script Finished execution + define('SE_RUNNING', IPS_ENGINEMESSAGE + 3); // On Script Started execution } if (!defined('IPS_PROFILEMESSAGE')) { // --- PROFILE POOL @@ -157,25 +157,25 @@ } if (!defined('IPS_TIMERMESSAGE')) { // --- TIMER POOL - define('IPS_TIMERMESSAGE', IPS_BASE + 1400); //Timer Pool Message + define('IPS_TIMERMESSAGE', IPS_BASE + 1400); // Timer Pool Message define('TM_REGISTER', IPS_TIMERMESSAGE + 1); define('TM_UNREGISTER', IPS_TIMERMESSAGE + 2); define('TM_SETINTERVAL', IPS_TIMERMESSAGE + 3); define('TM_UPDATE', IPS_TIMERMESSAGE + 4); define('TM_RUNNING', IPS_TIMERMESSAGE + 5); } -if (!defined('IS_ACTIVE')) { //Nur wenn Konstanten noch nicht bekannt sind. +if (!defined('IS_ACTIVE')) { // --- STATUS CODES define('IS_SBASE', 100); - define('IS_CREATING', IS_SBASE + 1); //module is being created - define('IS_ACTIVE', IS_SBASE + 2); //module created and running - define('IS_DELETING', IS_SBASE + 3); //module us being deleted - define('IS_INACTIVE', IS_SBASE + 4); //module is not beeing used + define('IS_CREATING', IS_SBASE + 1); // Module is being created + define('IS_ACTIVE', IS_SBASE + 2); // Module created and running + define('IS_DELETING', IS_SBASE + 3); // Module us being deleted + define('IS_INACTIVE', IS_SBASE + 4); // Module is not beeing used // --- ERROR CODES - define('IS_EBASE', 200); //default errorcode - define('IS_NOTCREATED', IS_EBASE + 1); //instance could not be created + define('IS_EBASE', 200); // Default errorcode + define('IS_NOTCREATED', IS_EBASE + 1); // Instance could not be created } -if (!defined('vtBoolean')) { //Nur wenn Konstanten noch nicht bekannt sind. +if (!defined('vtBoolean')) { define('vtBoolean', 0); define('vtInteger', 1); define('vtFloat', 2);