Skip to content

Commit

Permalink
Merge pull request #9 from symcon/fixes/upgrade-style-to-v3
Browse files Browse the repository at this point in the history
Update Style
  • Loading branch information
Sunnyka98 authored Nov 16, 2023
2 parents 4a4820f + 8e8fecb commit e1f4289
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: Checkout module
uses: actions/checkout@master
- name: Check style
uses: symcon/action-style@master
uses: symcon/action-style@v3
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea/
.phpunit.*
.php_cs.cache
.php_cs.cache
.php-cs-fixer.cache
2 changes: 1 addition & 1 deletion .style
Submodule .style updated 3 files
+42 −33 .php-cs-fixer.php
+22 −0 README.md
+85 −0 json-check.php
105 changes: 83 additions & 22 deletions Alpha2/form.json
Original file line number Diff line number Diff line change
@@ -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);"
}
]
}
3 changes: 1 addition & 2 deletions Alpha2/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"name": "MoehlenhoffAlpha2",
"type": 3,
"vendor": "Möhlenhoff",
"aliases":
[
"aliases": [
"Möhlenhoff Alpha 2"
],
"parentRequirements": [],
Expand Down
36 changes: 18 additions & 18 deletions Alpha2/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"name": "Möhlenhoff",
"url": "",
"compatibility": {
"version": "4.0"
},
"version": "4.0"
},
"version": "1.1",
"build": 0,
"date": 0
}
}

0 comments on commit e1f4289

Please sign in to comment.