Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Jan 2, 2024
1 parent 82a16f3 commit b32d817
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Xiaomi MIoT Cloud IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function ForwardData($JSONString)
private function KernelReady()
{
$this->UnregisterMessage(0, IPS_KERNELSTARTED);
$this->ApplyChanges();
$this->UpdateServiceToken();
}

private function Request(string $Path, string $ParamsString): ?string
Expand Down
8 changes: 6 additions & 2 deletions Xiaomi MIoT Device/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public function ApplyChanges()
parent::ApplyChanges();
// Anzeige IP in der INFO Spalte
$this->SetSummary($this->ReadPropertyString(\Xiaomi\Device\Property::Host));
// Noch keine Events, somit kein Filter
//$this->SetReceiveDataFilter('.*"ClientIP":"".*');

// Wenn Kernel nicht fertig, dann nix machen und darauf warten
if (IPS_GetKernelRunlevel() != KR_READY) {
$this->RegisterMessage(0, IPS_KERNELSTARTED);
return;
Expand Down Expand Up @@ -180,10 +180,13 @@ public function RequestAction($Ident, $Value)
$this->RequestState();
return;
case \Xiaomi\Device\Timer::Reconnect:
//Reconnect Timer abgelaufen. Verbindungsaufbau versuchen.
$this->ApplyChanges();
return;
case 'ForceReloadModel':
//User hat Geräteinfos neu laden über die Instanz-Konfig ausgeführt.
$this->SetTimerInterval(\Xiaomi\Device\Timer::RefreshState, 0);
$this->SetTimerInterval(\Xiaomi\Device\Timer::Reconnect, 0);
$this->WriteAttributeString(\Xiaomi\Device\Attribute::Token, '');
$this->WriteAttributeArray(\Xiaomi\Device\Attribute::Specs, []);
$this->WriteAttributeString(\Xiaomi\Device\Attribute::ProductName, '');
Expand Down Expand Up @@ -474,6 +477,7 @@ protected function SetStatus($State)
private function KernelReady()
{
$this->UnregisterMessage(0, IPS_KERNELSTARTED);
// Wenn Kernel fertig, dann fangen wir von vorne an.
$this->ApplyChanges();
}

Expand Down

0 comments on commit b32d817

Please sign in to comment.