From 8e8fecb8986c0e62048fa5ed3ddb4aecaa4a1d0b Mon Sep 17 00:00:00 2001 From: Sunnyka <71286632+Sunnyka98@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:21:25 +0100 Subject: [PATCH] Update Style --- .github/workflows/style.yml | 2 +- .gitignore | 3 +- .style | 2 +- Alpha2/form.json | 105 ++++++++++++++++++++++++++++-------- Alpha2/module.json | 3 +- Alpha2/module.php | 36 ++++++------- library.json | 6 +-- 7 files changed, 109 insertions(+), 48 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 714b5b5..3713f68 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -10,4 +10,4 @@ jobs: - name: Checkout module uses: actions/checkout@master - name: Check style - uses: symcon/action-style@master \ No newline at end of file + uses: symcon/action-style@v3 \ No newline at end of file diff --git a/.gitignore b/.gitignore index c013e4b..df90c89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store .idea/ .phpunit.* -.php_cs.cache \ No newline at end of file +.php_cs.cache +.php-cs-fixer.cache \ No newline at end of file diff --git a/.style b/.style index 3828f66..ec73bf7 160000 --- a/.style +++ b/.style @@ -1 +1 @@ -Subproject commit 3828f66b5e632e0596249f14a8ac9d1c5c8e97f3 +Subproject commit ec73bf742e18b049ad5c90de09033987d3ce671e diff --git a/Alpha2/form.json b/Alpha2/form.json index 848071b..27294b7 100644 --- a/Alpha2/form.json +++ b/Alpha2/form.json @@ -1,24 +1,85 @@ { - "elements": - [ - { "type": "ValidationTextBox", "name": "IPAddress", "caption": "IP-Adresse" }, - { "type": "Label", "label": "Intervall für das Abfragen der Daten" }, - { "type": "IntervalBox", "name" : "Interval", "caption": "Sekunden" }, - { "type": "CheckBox", "name": "ShowHeatArea01", "caption": "Heizzone 1" }, - { "type": "CheckBox", "name": "ShowHeatArea02", "caption": "Heizzone 2" }, - { "type": "CheckBox", "name": "ShowHeatArea03", "caption": "Heizzone 3" }, - { "type": "CheckBox", "name": "ShowHeatArea04", "caption": "Heizzone 4" }, - { "type": "CheckBox", "name": "ShowHeatArea05", "caption": "Heizzone 5" }, - { "type": "CheckBox", "name": "ShowHeatArea06", "caption": "Heizzone 6" }, - { "type": "CheckBox", "name": "ShowHeatArea07", "caption": "Heizzone 7" }, - { "type": "CheckBox", "name": "ShowHeatArea08", "caption": "Heizzone 8" }, - { "type": "CheckBox", "name": "ShowHeatArea09", "caption": "Heizzone 9" }, - { "type": "CheckBox", "name": "ShowHeatArea10", "caption": "Heizzone 10" }, - { "type": "CheckBox", "name": "ShowHeatArea11", "caption": "Heizzone 11" }, - { "type": "CheckBox", "name": "ShowHeatArea12", "caption": "Heizzone 12" } - ], - "actions": - [ - { "type": "Button", "label": "Gerät auslesen", "onClick": "MA2_RequestStatus($id);" } - ] + "elements": [ + { + "type": "ValidationTextBox", + "name": "IPAddress", + "caption": "IP-Adresse" + }, + { + "type": "Label", + "label": "Intervall für das Abfragen der Daten" + }, + { + "type": "IntervalBox", + "name": "Interval", + "caption": "Sekunden" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea01", + "caption": "Heizzone 1" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea02", + "caption": "Heizzone 2" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea03", + "caption": "Heizzone 3" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea04", + "caption": "Heizzone 4" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea05", + "caption": "Heizzone 5" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea06", + "caption": "Heizzone 6" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea07", + "caption": "Heizzone 7" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea08", + "caption": "Heizzone 8" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea09", + "caption": "Heizzone 9" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea10", + "caption": "Heizzone 10" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea11", + "caption": "Heizzone 11" + }, + { + "type": "CheckBox", + "name": "ShowHeatArea12", + "caption": "Heizzone 12" + } + ], + "actions": [ + { + "type": "Button", + "label": "Gerät auslesen", + "onClick": "MA2_RequestStatus($id);" + } + ] } \ No newline at end of file diff --git a/Alpha2/module.json b/Alpha2/module.json index fbb1bf7..9d45749 100644 --- a/Alpha2/module.json +++ b/Alpha2/module.json @@ -3,8 +3,7 @@ "name": "MoehlenhoffAlpha2", "type": 3, "vendor": "Möhlenhoff", - "aliases": - [ + "aliases": [ "Möhlenhoff Alpha 2" ], "parentRequirements": [], diff --git a/Alpha2/module.php b/Alpha2/module.php index 61b8645..7cf9860 100644 --- a/Alpha2/module.php +++ b/Alpha2/module.php @@ -726,6 +726,24 @@ public function RequestAction($Ident, $Value) $this->WriteValue($Ident, $Value); } + public function RequestStatus() + { + $xml = @simplexml_load_file('http://' . $this->ReadPropertyString('IPAddress') . '/data/static.xml'); + if ($xml === false) { + return; + } + + $this->SetValuesArray(self::$values, $xml); + + if (GetValue($this->GetIDForIdent($this->ReduceToIdent('VERS_SW_STM'))) >= '02.02') { + $this->MaintainArray(self::$valuesHeatCtrlExt); + $this->SetValuesArray(self::$valuesHeatCtrlExt, $xml); + } else { + $this->MaintainArray(self::$valuesHeatCtrl); + $this->SetValuesArray(self::$valuesHeatCtrl, $xml); + } + } + private function SendChanges($Xml) { $url = 'http://' . $this->ReadPropertyString('IPAddress') . '/data/changes.xml'; @@ -755,24 +773,6 @@ private function SendChanges($Xml) } } - public function RequestStatus() - { - $xml = @simplexml_load_file('http://' . $this->ReadPropertyString('IPAddress') . '/data/static.xml'); - if ($xml === false) { - return; - } - - $this->SetValuesArray(self::$values, $xml); - - if (GetValue($this->GetIDForIdent($this->ReduceToIdent('VERS_SW_STM'))) >= '02.02') { - $this->MaintainArray(self::$valuesHeatCtrlExt); - $this->SetValuesArray(self::$valuesHeatCtrlExt, $xml); - } else { - $this->MaintainArray(self::$valuesHeatCtrl); - $this->SetValuesArray(self::$valuesHeatCtrl, $xml); - } - } - private function MaintainArray($Array) { foreach ($Array as $key => $value) { diff --git a/library.json b/library.json index 6a0e3b9..99225a1 100644 --- a/library.json +++ b/library.json @@ -4,9 +4,9 @@ "name": "Möhlenhoff", "url": "", "compatibility": { - "version": "4.0" - }, + "version": "4.0" + }, "version": "1.1", "build": 0, "date": 0 -} +} \ No newline at end of file