no message
This commit is contained in:
@@ -5,6 +5,11 @@
|
|||||||
"name": "TopicSuffix",
|
"name": "TopicSuffix",
|
||||||
"caption": "Topic Suffix / x"
|
"caption": "Topic Suffix / x"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "SelectVariable",
|
||||||
|
"name": "FeedbackResponseID",
|
||||||
|
"caption": "Feedback Response Variable"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "SelectVariable",
|
"type": "SelectVariable",
|
||||||
"name": "ReqActionID",
|
"name": "ReqActionID",
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ class MQTTBatterySDL extends IPSModule
|
|||||||
$this->RegisterPropertyInteger('DischargePower', 2500);
|
$this->RegisterPropertyInteger('DischargePower', 2500);
|
||||||
$this->RegisterPropertyInteger('MaxPowerSetpoint', 10000);
|
$this->RegisterPropertyInteger('MaxPowerSetpoint', 10000);
|
||||||
|
|
||||||
|
$this->RegisterPropertyInteger('FeedbackResponseID', 0);
|
||||||
|
|
||||||
// Variablen
|
// Variablen
|
||||||
$this->RegisterVariableBoolean('IsReady', 'Is Ready', '', 10);
|
$this->RegisterVariableBoolean('IsReady', 'Is Ready', '', 10);
|
||||||
$this->RegisterVariableBoolean('IsRunning', 'Is Running', '', 20);
|
$this->RegisterVariableBoolean('IsRunning', 'Is Running', '', 20);
|
||||||
@@ -373,10 +375,7 @@ public function ReceiveData($JSONString)
|
|||||||
if ($topic === 'feedback-request/' . $suffix) {
|
if ($topic === 'feedback-request/' . $suffix) {
|
||||||
$json = $this->BuildReadResponse();
|
$json = $this->BuildReadResponse();
|
||||||
|
|
||||||
$this->QueuePublish(
|
$this->SendFeedbackResponse($json);
|
||||||
'feedback-response/' . $suffix,
|
|
||||||
$json
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -414,6 +413,19 @@ private function PublishMQTT(string $topic, string $payload)
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function SendFeedbackResponse(string $payload)
|
||||||
|
{
|
||||||
|
$id = $this->ReadPropertyInteger('FeedbackResponseID');
|
||||||
|
|
||||||
|
if (!$this->IsValidVariable($id)) {
|
||||||
|
$this->SendDebug('SendFeedbackResponse', 'Keine gültige FeedbackResponseID gewählt', 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestAction($id, $payload);
|
||||||
|
}
|
||||||
|
|
||||||
private function IsValidVariable(int $id)
|
private function IsValidVariable(int $id)
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user