no message

This commit is contained in:
2026-05-26 11:38:12 +02:00
parent faf30d279a
commit 92458ad5b9
+23 -1
View File
@@ -346,12 +346,13 @@ public function ReceiveData($JSONString)
return; return;
} }
$topic = $data['Topic'] ?? ''; $topic = $data['Topic'] ?? '';
$payload = $data['Payload'] ?? ''; $payload = $data['Payload'] ?? '';
$suffix = $this->ReadPropertyString('TopicSuffix'); $suffix = $this->ReadPropertyString('TopicSuffix');
if ($topic === 'feedback-request/' . $suffix) { if ($topic === 'feedback-request/' . $suffix) {
$json = $this->BuildReadResponse(); $json = $this->BuildReadResponse();
$this->PublishMQTT( $this->PublishMQTT(
@@ -363,6 +364,7 @@ public function ReceiveData($JSONString)
} }
if ($topic === 'remote-control-request/' . $suffix) { if ($topic === 'remote-control-request/' . $suffix) {
$json = $this->HandleRemoteControlJSON($payload); $json = $this->HandleRemoteControlJSON($payload);
if ($json !== null) { if ($json !== null) {
@@ -376,6 +378,26 @@ public function ReceiveData($JSONString)
} }
} }
private function PublishMQTT(string $topic, string $payload)
{
$this->SendDebug(
'PublishMQTT',
$topic . ' => ' . $payload,
0
);
$this->SendDataToParent(json_encode([
'DataID' => '{7F7632D9-FA40-4F38-8DEA-C83CD4325A32}',
'PacketType' => 3,
'Payload' => $payload,
'QualityOfService' => 0,
'Retain' => false,
'Topic' => $topic
]));
}
private function IsValidVariable(int $id) private function IsValidVariable(int $id)
{ {
return ( return (