Skip to content

Commit

Permalink
Update style
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunnyka98 committed Nov 16, 2023
1 parent 0fb138b commit 53185a7
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 137 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
.idea/
.phpunit.*
.php_cs.cache
.php-cs-fixer.cache
2 changes: 1 addition & 1 deletion .style
Submodule .style updated 3 files
+36 −32 .php-cs-fixer.php
+22 −0 README.md
+85 −0 json-check.php
4 changes: 3 additions & 1 deletion FormDemo/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"name": "FormDemo",
"type": 3,
"vendor": "",
"aliases": ["Form Demo"],
"aliases": [
"Form Demo"
],
"parentRequirements": [],
"childRequirements": [],
"implemented": [],
Expand Down
2 changes: 1 addition & 1 deletion FormDemo/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public function Create()
//Never delete this line!
parent::Create();

$this->RegisterPropertyBoolean("Test", false);
$this->RegisterPropertyBoolean('Test', false);
}

public function Destroy()
Expand Down
81 changes: 52 additions & 29 deletions Rechenmodul/form.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
{
"elements": [{
"type": "Select",
"name": "Calculation",
"caption": "Calculation",
"options": [
{ "label": "Everything", "value": 0 },
{ "label": "Sum", "value": 1 },
{ "label": "Minimum", "value": 2 },
{ "label": "Maximum", "value": 3 },
{ "label": "Average", "value": 4 },
{ "label": "Count", "value": 5 }
]
}, {
"type": "List",
"name": "Variables",
"caption": "Variables",
"add": true,
"delete": true,
"columns": [{
"label": "VariableID",
"name": "ID",
"width": "auto",
"add": 0,
"edit": {
"type": "SelectVariable"
}
}],
"values": []
}]
"elements": [
{
"type": "Select",
"name": "Calculation",
"caption": "Calculation",
"options": [
{
"label": "Everything",
"value": 0
},
{
"label": "Sum",
"value": 1
},
{
"label": "Minimum",
"value": 2
},
{
"label": "Maximum",
"value": 3
},
{
"label": "Average",
"value": 4
},
{
"label": "Count",
"value": 5
}
]
},
{
"type": "List",
"name": "Variables",
"caption": "Variables",
"add": true,
"delete": true,
"columns": [
{
"label": "VariableID",
"name": "ID",
"width": "auto",
"add": 0,
"edit": {
"type": "SelectVariable"
}
}
],
"values": []
}
]
}
3 changes: 1 addition & 2 deletions Rechenmodul/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"name": "RechenmodulWebinar",
"type": 3,
"vendor": "",
"aliases":
[
"aliases": [
"Rechen-Modul (Webinar)"
],
"parentRequirements": [],
Expand Down
2 changes: 1 addition & 1 deletion Rechenmodul/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function ApplyChanges()
$this->RegisterVariableFloat('Sum', $this->Translate('Sum'));
$this->RegisterVariableFloat('Minimum', $this->Translate('Minimum'));
$this->RegisterVariableFloat('Maximum', $this->Translate('Maximum'));
$this->RegisterVariableFloat('Average', $this->Translate('Average'));
$this->RegisterVariableFloat('Average', $this->Translate('Average'));
$this->RegisterVariableFloat('Count', $this->Translate('Count'));
break;

Expand Down
34 changes: 17 additions & 17 deletions TestConfigurator/module.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

declare(strict_types=1);
class TestConfigurator extends IPSModule
class TestConfigurator extends IPSModule
{
public function Create()
{
public function Create()
{
//Never delete this line!
parent::Create();
}
//Never delete this line!
parent::Create();
}

public function Destroy()
{
//Never delete this line!
parent::Destroy();
}
public function Destroy()
{
//Never delete this line!
parent::Destroy();
}

public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}
}
public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}
}
38 changes: 19 additions & 19 deletions TestDevice1/module.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php

declare(strict_types=1);
class TestDevice1 extends IPSModule
class TestDevice1 extends IPSModule
{
public function Create()
{
public function Create()
{
//Never delete this line!
parent::Create();
//Never delete this line!
parent::Create();

$this->RegisterPropertyInteger("DeviceID", 0);
$this->RegisterPropertyInteger("SecondaryID", 0);
}
$this->RegisterPropertyInteger('DeviceID', 0);
$this->RegisterPropertyInteger('SecondaryID', 0);
}

public function Destroy()
{
//Never delete this line!
parent::Destroy();
}
public function Destroy()
{
//Never delete this line!
parent::Destroy();
}

public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}
}
public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}
}
42 changes: 21 additions & 21 deletions TestDevice2/module.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?php

declare(strict_types=1);
class TestDevice2 extends IPSModule
class TestDevice2 extends IPSModule
{
public function Create()
{
public function Create()
{
//Never delete this line!
parent::Create();
//Never delete this line!
parent::Create();

$this->RequireParent('{63D1D28F-6901-8BB7-8C8E-1046022EFEB4}');

$this->RegisterPropertyInteger("DeviceID", 0);
$this->RegisterPropertyInteger("SecondaryID", 0);
}
$this->RequireParent('{63D1D28F-6901-8BB7-8C8E-1046022EFEB4}');

public function Destroy()
{
//Never delete this line!
parent::Destroy();
}
$this->RegisterPropertyInteger('DeviceID', 0);
$this->RegisterPropertyInteger('SecondaryID', 0);
}

public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}
}
public function Destroy()
{
//Never delete this line!
parent::Destroy();
}

public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}
}
82 changes: 41 additions & 41 deletions TestSplitter/module.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<?php

declare(strict_types=1);
class TestSplitter extends IPSModule
{
public function Create()
{
//Never delete this line!
parent::Create();

$this->ConnectParent('{6179ED6A-FC31-413C-BB8E-1204150CF376}');
$this->RegisterPropertyString('Address', '');
}

public function Destroy()
{
//Never delete this line!
parent::Destroy();
}

public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}

public function ForwardData($JSONString)
{
$data = json_decode($JSONString);
IPS_LogMessage('Splitter FRWD', utf8_decode($data->Buffer));

$this->SendDataToParent(json_encode(['DataID' => '{79827379-F36E-4ADA-8A95-5F8D1DC92FA9}', 'Buffer' => $data->Buffer]));

return 'String data for device instance!';
}

public function ReceiveData($JSONString)
{
$data = json_decode($JSONString);
IPS_LogMessage('Splitter RECV', utf8_decode($data->Buffer));

$this->SendDataToChildren(json_encode(['DataID' => '{9209FA1D-DF9B-B139-432F-F4D4440D8531}', 'Buffer' => $data->Buffer]));
}
}
class TestSplitter extends IPSModule
{
public function Create()
{
//Never delete this line!
parent::Create();

$this->ConnectParent('{6179ED6A-FC31-413C-BB8E-1204150CF376}');
$this->RegisterPropertyString('Address', '');
}

public function Destroy()
{
//Never delete this line!
parent::Destroy();
}

public function ApplyChanges()
{
//Never delete this line!
parent::ApplyChanges();
}

public function ForwardData($JSONString)
{
$data = json_decode($JSONString);
IPS_LogMessage('Splitter FRWD', utf8_decode($data->Buffer));

$this->SendDataToParent(json_encode(['DataID' => '{79827379-F36E-4ADA-8A95-5F8D1DC92FA9}', 'Buffer' => $data->Buffer]));

return 'String data for device instance!';
}

public function ReceiveData($JSONString)
{
$data = json_decode($JSONString);
IPS_LogMessage('Splitter RECV', utf8_decode($data->Buffer));

$this->SendDataToChildren(json_encode(['DataID' => '{9209FA1D-DF9B-B139-432F-F4D4440D8531}', 'Buffer' => $data->Buffer]));
}
}
4 changes: 3 additions & 1 deletion actions/eventLimit.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"IPS_SetEventLimit($_IPS['TARGET'], $_IPS['LIMIT']);"
],
"restrictions": {
"objectType": [ 4 ]
"objectType": [
4
]
},
"format": "Activate and execute {LIMIT, number} times",
"category": "other"
Expand Down
16 changes: 13 additions & 3 deletions actions/exponentiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@
],
"action": "SetValue($_IPS['TARGET'], pow(GetValue($_IPS['TARGET']), $_IPS['EXPONENT']));",
"restrictions": {
"objectType": [ 2 ],
"variableType": [ 1, 2 ],
"profilesExclude": [ "~HexColor", "~UnixTimestamp", "~UnixTimestampDate", "~UnixTimestampTime" ],
"objectType": [
2
],
"variableType": [
1,
2
],
"profilesExclude": [
"~HexColor",
"~UnixTimestamp",
"~UnixTimestampDate",
"~UnixTimestampTime"
],
"profileIsEnum": false,
"profileIsPercentage": false,
"writable": true
Expand Down

0 comments on commit 53185a7

Please sign in to comment.