Skip to content

Commit

Permalink
Release 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Jan 1, 2024
1 parent 40013ed commit 7ff23b5
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .style
Submodule .style updated 2 files
+31 −31 .php-cs-fixer.php
+71 −71 json-check.php
5 changes: 0 additions & 5 deletions ToDo

This file was deleted.

2 changes: 2 additions & 0 deletions Xiaomi MIoT Cloud IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function Create()
$this->Location = '';
$this->ServiceToken = '';
}

public function Destroy()
{
//Never delete this line!
Expand Down Expand Up @@ -423,6 +424,7 @@ private function GenerateSignature(string $Path, string $SignedNonce, array $Par
$exps[] = $SignedNonce;
return base64_encode(sha1(implode('&', $exps), true));
}

private function rc4(string $pwd, string $data): string
{
$key[] = '';
Expand Down
1 change: 1 addition & 0 deletions Xiaomi MIoT Configurator/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Close": "Schließen",
"Please wait, installation in progress.\r\nConfigurator will reload automatically": "Bitte warten, die Installation läuft.\r\nDer Konfigurator wird automatisch neu geladen.",
"Please wait": "Bitte warten",
"Mi Home Devices": "Mi Home Geräte",
"This module is free for non-commercial use,\r\nDonations in support of the author are accepted here:": "Dieses Modul ist für die nicht kommerzielle Nutzung kostenlos,\r\nSchenkungen als Unterstützung für den Autor werden hier akzeptiert:"
}
}
Expand Down
10 changes: 9 additions & 1 deletion Xiaomi MIoT Configurator/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function Create()
$this->RequireParent(\Xiaomi\GUID::CloudIO);
$this->RegisterAttributeBoolean(\Xiaomi\Configurator\Attribute::ShowOffline, true);
}

public function Destroy()
{
//Never delete this line!
Expand All @@ -29,6 +30,7 @@ public function ApplyChanges()
//Never delete this line!
parent::ApplyChanges();
}

public function RequestAction($Ident, $Value)
{
switch ($Ident) {
Expand Down Expand Up @@ -118,7 +120,7 @@ public function GetConfigurationForm()
$IOId = IPS_GetInstance($this->InstanceID)['ConnectionID'];
$AddDevice['create'] = [
'moduleID' => \Xiaomi\Roborock\GUID::Device,
'location' => [$this->Translate('Roborocks')],
'location' => ((float) IPS_GetKernelVersion() < 7) ? [$this->Translate('Roborocks')] : [],
'configuration' => [
\Xiaomi\Roborock\Property::Ip => $Device['localip'],
\Xiaomi\Roborock\Property::Server => IPS_GetProperty($IOId, \Xiaomi\Cloud\Property::Country),
Expand Down Expand Up @@ -183,14 +185,17 @@ public function GetConfigurationForm()
$this->SendDebug('FORM', json_last_error_msg(), 0);
return json_encode($Form);
}

protected function FilterInstances(int $InstanceID): bool
{
return IPS_GetInstance($InstanceID)['ConnectionID'] == $this->ParentID;
}

protected function GetConfigParam(&$item1, int $InstanceID, string $ConfigParam): void
{
$item1 = IPS_GetProperty($InstanceID, $ConfigParam);
}

private function GetDevices(): array
{
$this->SendDebug(__FUNCTION__, \Xiaomi\Cloud\ApiUrl::Device_List, 0);
Expand Down Expand Up @@ -223,15 +228,18 @@ private function GetInstanceList(string $GUID, string $ConfigParam): array
$this->SendDebug('Filter', $InstanceIDList, 0);
return $InstanceIDList;
}

private function isRoborockModuleInstalled(): bool
{
return IPS_LibraryExists(\Xiaomi\Roborock\GUID::Module);
}

private function StoreAvailable(): bool
{
$Id = IPS_GetInstanceListByModuleID(\Xiaomi\Roborock\GUID::Store)[0];
return SC_GetLastConfirmedStoreConditions($Id) == 3;
}

private function InstallRoborockModule()
{
$Id = IPS_GetInstanceListByModuleID(\Xiaomi\Roborock\GUID::Store)[0];
Expand Down
83 changes: 78 additions & 5 deletions Xiaomi MIoT Device/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,91 @@
},
{
"type": "ExpansionPanel",
"name": "TestCenter",
"width": "350px",
"expanded": false,
"caption": "TestCenter",
"name": "VariablePanel",
"caption": "Enabled variables",
"width": "700px",
"onClick": "",
"items": [
{
"type": "TestCenter"
"type": "List",
"name": "Statevariables",
"caption": "Statevariables",
"rowCount": 20,
"add": false,
"delete": false,
"onEdit": "IPS_RequestAction($id, 'ChangeVariableEnabled', json_encode([$Statevariables['ident'], $Statevariables['enabled']]));",
"loadValuesFromConfiguration": false,
"sort": {
"column": "name",
"direction": "ascending"
},
"columns": [
{
"name": "ident",
"caption": "Ident",
"visible": false
},
{
"name": "type",
"caption": "Service type",
"width": "150px"
},
{
"name": "name",
"caption": "Variable name",
"width": "325px"
},
{
"name": "enabled",
"caption": "Enabled",
"width": "75px",
"edit": {
"type": "CheckBox"
}
}
]
}
]
}
]
},
{
"type": "ExpansionPanel",
"name": "TestCenter",
"width": "450px",
"expanded": false,
"caption": "TestCenter",
"items": [
{
"type": "TestCenter"
}
]
},
{
"name": "ErrorPopup",
"type": "PopupAlert",
"visible": false,
"popup": {
"items": [
{
"name": "ErrorTitle",
"type": "Label",
"caption": ""
},
{
"name": "ErrorText",
"type": "Label",
"caption": ""
},
{
"type": "OpenObjectButton",
"caption": "",
"objectID": 1,
"visible": false
}
]
}
},
{
"type": "Label",
"caption": "This module is free for non-commercial use,\r\nDonations in support of the author are accepted here:"
Expand Down
14 changes: 14 additions & 0 deletions Xiaomi MIoT Device/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@
"Request state": "Zustand lesen",
"Reload device information": "Geräteinformationen neu laden",
"Device information": "Geräteinformationen",
"Names: ": "Namen: ",
"Specs: ": "Spezifikationen: ",
"Connection: ": "Verbindung: ",
"Enabled variables": "Aktivierte Variablen",
"Attention!": "Achtung!",
"Deselecting a variable will delete it immediately.": "Abwählen einer Variable wird diese umgehend löschen!",
"Statevariables": "Statusvariablen",
"Service type": "Servicetyp",
"Variable name": "Variablenname",
"Enabled": "Aktiviert",
"Action": "Aktion",
"Action with value": "Aktion mit Wert",
"Value Read": "Wert lesen",
"Value Read/Write": "Wert lesen/schreiben",
"This module is free for non-commercial use,\r\nDonations in support of the author are accepted here:": "Dieses Modul ist für die nicht kommerzielle Nutzung kostenlos,\r\nSchenkungen als Unterstützung für den Autor werden hier akzeptiert:"
}
}
Expand Down
Loading

0 comments on commit 7ff23b5

Please sign in to comment.