Skip to content

Commit

Permalink
v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
demel42 committed Dec 10, 2023
1 parent 246f3ea commit 43f5d07
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
30 changes: 21 additions & 9 deletions AutomowerConnectConfig/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function Create()
{
parent::Create();

$this->RegisterPropertyInteger('ImportCategoryID', 0);
if (IPS_GetKernelVersion() < 7.0) {
$this->RegisterPropertyInteger('ImportCategoryID', 0);
}

$this->RegisterAttributeString('UpdateInfo', json_encode([]));
$this->RegisterAttributeString('ModuleStats', json_encode([]));
Expand All @@ -39,7 +41,10 @@ public function ApplyChanges()
{
parent::ApplyChanges();

$propertyNames = ['ImportCategoryID'];
$propertyNames = [];
if (IPS_GetKernelVersion() < 7.0) {
$propertyNames[] = 'ImportCategoryID';
}
$this->MaintainReferences($propertyNames);

if ($this->CheckPrerequisites() != false) {
Expand Down Expand Up @@ -76,7 +81,12 @@ private function getConfiguratorValues()
return $entries;
}

$catID = $this->ReadPropertyInteger('ImportCategoryID');
if (IPS_GetKernelVersion() < 7.0) {
$catID = $this->ReadPropertyInteger('ImportCategoryID');
$location = $this->GetConfiguratorLocation($catID);
} else {
$location = '';
}

$dataCache = $this->ReadDataCache();
if (isset($dataCache['data']['mowers'])) {
Expand Down Expand Up @@ -147,7 +157,7 @@ private function getConfiguratorValues()
'id' => $id,
'create' => [
'moduleID' => $guid,
'location' => $this->GetConfiguratorLocation($catID),
'location' => $location,
'info' => 'Automower ' . $model,
'configuration' => [
'model' => $model,
Expand Down Expand Up @@ -205,11 +215,13 @@ private function GetFormElements()
return $formElements;
}

$formElements[] = [
'type' => 'SelectCategory',
'name' => 'ImportCategoryID',
'caption' => 'category for mowers to be created'
];
if (IPS_GetKernelVersion() < 7.0) {
$formElements[] = [
'type' => 'SelectCategory',
'name' => 'ImportCategoryID',
'caption' => 'category for mowers to be created'
];
}

$entries = $this->getConfiguratorValues();
$formElements[] = [
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ Quellen:

## 7. Versions-Historie

- 3.4 @ 09.12.2023 16:52
- Neu: ab IPS-Version 7 ist im Konfigurator die Angabe einer Import-Kategorie integriert, daher entfällt die bisher vorhandene separate Einstellmöglichkeit

- 3.3 @ 13.11.2023 11:01
- Fix: bei dem Empfang von Daten per Websocket wird nun die Geräte-ID ausgewertet und somit nur noch vom richtigen Gerät verarbeitet.

Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"compatibility": {
"version": "6.2"
},
"version": "3.3",
"version": "3.4",
"build": 0,
"date": 1699869709
"date": 1702137140
}

0 comments on commit 43f5d07

Please sign in to comment.