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 4, 2024
1 parent 1c4aa4f commit 093a1bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .style
Submodule .style updated 2 files
+31 −31 .php-cs-fixer.php
+71 −71 json-check.php
17 changes: 14 additions & 3 deletions Bosch SmartHome IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
eval('declare(strict_types=1);namespace BoschSHCIO {?>' . file_get_contents(dirname(__DIR__) . '/libs/helper/DebugHelper.php') . '}');
require_once dirname(__DIR__) . '/libs/SHCTypes.php';
/**
* @method bool SendDebug(string $Message, mixed $Data, int $Format)
*
* @property string $Host
* @property string $ClientId
* @property string $ClientName
Expand All @@ -14,7 +16,7 @@
* @property string $TempFilecert
* @property string $TempFileprivatekey
* @property int $PollingTimout
* @method bool SendDebug(string $Message, mixed $Data, int $Format)
*
*/
class BoschSmartHomeIO extends IPSModuleStrict
{
Expand Down Expand Up @@ -150,6 +152,7 @@ public function Create(): void
if (IPS_GetKernelRunlevel() != KR_READY) {
$this->RegisterMessage(0, IPS_KERNELSTARTED);
}
$this->RegisterMessage(0, IPS_KERNELSHUTDOWN);
}

public function Destroy(): void
Expand Down Expand Up @@ -205,8 +208,15 @@ public function MessageSink(int $TimeStamp, int $SenderID, int $Message, array $
{
switch ($Message) {
case IPS_KERNELSTARTED:
$this->UnregisterMessage(0, IPS_KERNELSTARTED);
$this->KernelReady();
break;
case IPS_KERNELSHUTDOWN:
if ($this->SHCPollId != '') {
$this->Unsubscribe();
$this->SetStatus(IS_INACTIVE);
}
break;
}
}

Expand Down Expand Up @@ -313,7 +323,6 @@ public function StartPairing(string $Password): string
*/
protected function KernelReady(): void
{
$this->UnregisterMessage(0, IPS_KERNELSTARTED);
$this->ApplyChanges();
}

Expand Down Expand Up @@ -507,7 +516,9 @@ private function PollLong(): void
$this->LogMessage($th->getMessage(), KL_ERROR);
}
$this->SendDebug('END PollLong', $Result, 0);
IPS_RunScriptText('IPS_RequestAction(' . $this->InstanceID . ',"PollLong",true);');
if (IPS_GetKernelRunlevel() == KR_READY) {
IPS_RunScriptText('IPS_RequestAction(' . $this->InstanceID . ',"PollLong",true);');
}
}

private function Unsubscribe(): bool
Expand Down
2 changes: 1 addition & 1 deletion libs/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class SmokeDetectorCheck extends ServiceBasics
]
];
}
//smoke
//smoke
// IDLE_OFF,PRIMARY_ALARM, SECONDARY_ALARM and INTRUSION_ALARM,
class SmokeSensitivity extends ServiceBasics
{
Expand Down

0 comments on commit 093a1bf

Please sign in to comment.