Hallo Leute,
vielleicht liegt es ja an der Wärme…
Folgende Konstellation:
Im Create (Auszug):
$this->RegisterVariableBoolean("Automatic", "Automatik", "~Switch", 10);
$this->EnableAction("Automatic");
$this->RegisterVariableBoolean("State", "Status", "~Switch", 20);
$this->EnableAction("State");
Im ApplyChanges (Auszug):
If (GetValueBoolean($this->GetIDForIdent("Automatic")) == true) {
$this->DisableAction("State");
}
else {
$this->EnableAction("State");
}
Im RequestAction (Auszug):
public function RequestAction($Ident, $Value)
{
switch($Ident) {
case "Automatic":
If ($this->ReadPropertyBoolean("Open") == true) {
SetValueBoolean($this->GetIDForIdent("Automatic"), $Value);
If ($Value == true) {
$this->SendDebug("RequestAction", "State wird Disabled", 0);
$this->DisableAction("State");
}
else {
$this->SendDebug("RequestAction", "State wird Enabled", 0);
$this->EnableAction("State");
}
}
break;
case "State":
Erwartungshaltung: Wird „Automatic“ gesetzt, wird „State“ „DisableAction“ gesetzt und umgekehrt…
Das funktioniert aber offenbar nur, wenn „Automatic“ beim Start des Moduls „false“ war…
Bei den Instanzen, bei denen „Automatic“ zum Start der Instanz „true“ war, durchläuft er zwar korrekt die Funktion (sehe ich an der Debug-Ausgabe), aber „State“ wird nicht „EnableAction“, sondern bleibt in seinem (DisableAction-)Zustand…
Ich verstehe das nicht…
Joachim