Skip to content

Commit

Permalink
fixed bin2hex for parent instance
Browse files Browse the repository at this point in the history
  • Loading branch information
ubittner committed Feb 3, 2024
1 parent ec35a20 commit 0b1e55b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SmartLock/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ public function Lock(): void
$Data['QualityOfService'] = 0;
$Data['Retain'] = false;
$Data['Topic'] = $this->ReadPropertyString('MQTTTopic') . '/lock';
$Data['Payload'] = 'true';
$Data['Payload'] = bin2hex('true');
$DataJSON = json_encode($Data, JSON_UNESCAPED_SLASHES);
$this->SendDebug(__FUNCTION__ . ' Topic', $Data['Topic'], 0);
$this->SendDebug(__FUNCTION__ . ' Data', $DataJSON, 0);
Expand All @@ -746,7 +746,7 @@ public function UnLock(): void
$Data['QualityOfService'] = 0;
$Data['Retain'] = false;
$Data['Topic'] = $this->ReadPropertyString('MQTTTopic') . '/unlock';
$Data['Payload'] = 'true';
$Data['Payload'] = bin2hex('true');
$DataJSON = json_encode($Data, JSON_UNESCAPED_SLASHES);
$this->SendDebug(__FUNCTION__ . ' Topic', $Data['Topic'], 0);
$this->SendDebug(__FUNCTION__ . ' Data', $DataJSON, 0);
Expand Down Expand Up @@ -788,7 +788,7 @@ public function SetLockAction(int $Action): void
$Data['QualityOfService'] = 0;
$Data['Retain'] = false;
$Data['Topic'] = $this->ReadPropertyString('MQTTTopic') . '/lockAction';
$Data['Payload'] = strval($Action);
$Data['Payload'] = bin2hex(strval($Action));
$DataJSON = json_encode($Data, JSON_UNESCAPED_SLASHES);
$this->SendDebug(__FUNCTION__ . ' Topic', $Data['Topic'], 0);
$this->SendDebug(__FUNCTION__ . ' Data', $DataJSON, 0);
Expand Down

0 comments on commit 0b1e55b

Please sign in to comment.