Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Aug 24, 2024
1 parent bdb5b98 commit 970d5c7
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions libs/AllBaseControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,45 +228,6 @@ protected function UnregisterVariableWatch(int $VarId): void
$this->UnregisterReference($VarId);
}

private function UpdateConfig(): bool
{
$this->SendDebug('UpdateConfig', '1', 0);
$Value = json_decode($this->ReadPropertyString('Value'), true);
if (!is_array($Value)) { // new Property is [] !
return false;
}
$this->SendDebug('UpdateConfig', '2', 0);
$OldConfig = json_decode(IPS_GetConfiguration($this->InstanceID), true);
if (!array_key_exists('ConditionBoolean', $OldConfig)) {
return false;
}
$this->SendDebug('UpdateConfig', '3', 0);
$VarId = $this->ReadPropertyInteger('Source');
if (!IPS_VariableExists($VarId)) {
return false;
}
$this->SendDebug('UpdateConfig', '4', 0);
$Source = IPS_GetVariable($VarId);
switch ($Source['VariableType']) {
case VARIABLETYPE_BOOLEAN:
$Value = (bool) $OldConfig['ConditionBoolean'];
break;
case VARIABLETYPE_INTEGER:
$Value = (int) $OldConfig['ConditionValue'];
break;
case VARIABLETYPE_FLOAT:
$Value = (float) $OldConfig['ConditionValue'];
break;
case VARIABLETYPE_STRING:
$Value = $OldConfig['ConditionValue'];
break;
}
$this->SendDebug('UpdateConfig', 'BANG', 0);
IPS_SetProperty($this->InstanceID, 'Value', json_encode($Value));
IPS_ApplyChanges($this->InstanceID);
return true;
}

private function UpdateForm(int $Variable): void
{
if (!IPS_VariableExists($Variable)) {
Expand Down

0 comments on commit 970d5c7

Please sign in to comment.