Dokumentation
Schalter
Benötigt: Symcon >= 8.0
Parameter
Informationen zu den visuellen Eigenschaften und Bedeutungen der Parameter sind in der Objekt-Darstellung zu finden.
| Name | Typ | Parameter | Beschreibung |
|---|---|---|---|
| PRESENTATION | String | Die ID der Darstellung | VARIABLE_PRESENTATION_SWITCH {60AE6B26-B3E2-BDB1-A3A1-BE232940664B} |
| USE_ICON_FALSE | Boolean | Individuelle Icons passend zum Wert | |
| ICON_TRUE | String | Icon für true, auch für false, falls USE_ICON_FALSE false | Icons |
| ICON_FALSE | String | Icon für false, falls USE_ICON_FALSE true | Icons |
| GLOW_COLOR | Integer | Farbe des Leuchtens wenn aktiv | |
| GLOW_INTENSITY | Integer | Intensität des Leuchtens wenn aktiv | |
| USAGE_TYPE | Integer | Verwendung der Variable | 0: An/Aus, 1: Stumm schalte, 2: Keine hiervon |
Beispiele
// Beim Registrieren einer Variable für PHP-Module
// Ein Schalter, der grün leuchtet.
$this->RegisterVariableInteger('Status', 'Status', [
'PRESENTATION' => VARIABLE_PRESENTATION_SWITCH,
'GLOW_COLOR' => 3210585,
'GLOW_INTENSITY' => 20,
'USAGE_TYPE' => 0 /* An/Aus */
]);
// Ein Schalter mit eigenen Icons zum Stumm schalten
$this->RegisterVariableInteger('Mute', 'Mute', [
'PRESENTATION' => VARIABLE_PRESENTATION_SWITCH,
'USE_ICON_FALSE' => true,
'ICON_FALSE' => 'volume',
'USAGE_TYPE' => 1 /* Stumm schalten */,
'ICON_TRUE' => 'volume-xmark',
]);
// Für bestehende Variablen via Skript
// Ein Schalter, der grün leuchtet.
IPS_SetVariableCustomPresentation(12345, [
'PRESENTATION' => VARIABLE_PRESENTATION_SWITCH,
'GLOW_COLOR' => 3210585,
'GLOW_INTENSITY' => 20,
'USAGE_TYPE' => 0 /* An/Aus */
]);
// Ein Schalter mit eigenen Icons zum Stumm schalten
IPS_SetVariableCustomPresentation(12345, [
'PRESENTATION' => VARIABLE_PRESENTATION_SWITCH,
'USE_ICON_FALSE' => true,
'ICON_FALSE' => 'volume',
'USAGE_TYPE' => 1 /* Stumm schalten */,
'ICON_TRUE' => 'volume-xmark',
]);