no message
This commit is contained in:
@@ -13,6 +13,7 @@ class MQTTBatterySDL extends IPSModule
|
|||||||
$this->RegisterPropertyInteger('ReqActionID', 0);
|
$this->RegisterPropertyInteger('ReqActionID', 0);
|
||||||
$this->RegisterPropertyInteger('SoCID', 0);
|
$this->RegisterPropertyInteger('SoCID', 0);
|
||||||
$this->RegisterPropertyInteger('PowerProductionID', 0);
|
$this->RegisterPropertyInteger('PowerProductionID', 0);
|
||||||
|
$this->RegisterPropertyInteger('PublishInstanceID', 0);
|
||||||
|
|
||||||
$this->RegisterPropertyInteger('TargetSoC', 50);
|
$this->RegisterPropertyInteger('TargetSoC', 50);
|
||||||
$this->RegisterPropertyInteger('ChargePower', 2500);
|
$this->RegisterPropertyInteger('ChargePower', 2500);
|
||||||
@@ -380,7 +381,7 @@ class MQTTBatterySDL extends IPSModule
|
|||||||
|
|
||||||
$json = $this->BuildReadResponse();
|
$json = $this->BuildReadResponse();
|
||||||
|
|
||||||
$this->PublishMQTT(
|
$this->PublishViaHelper(
|
||||||
'feedback-response/' . $suffix,
|
'feedback-response/' . $suffix,
|
||||||
$json
|
$json
|
||||||
);
|
);
|
||||||
@@ -398,7 +399,7 @@ class MQTTBatterySDL extends IPSModule
|
|||||||
|
|
||||||
if ($json !== null) {
|
if ($json !== null) {
|
||||||
|
|
||||||
$this->PublishMQTT(
|
$this->PublishViaHelper(
|
||||||
'remote-control-response/' . $suffix,
|
'remote-control-response/' . $suffix,
|
||||||
$json
|
$json
|
||||||
);
|
);
|
||||||
@@ -426,7 +427,17 @@ class MQTTBatterySDL extends IPSModule
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function PublishViaHelper(string $topic, string $payload)
|
||||||
|
{
|
||||||
|
$id = $this->ReadPropertyInteger('PublishInstanceID');
|
||||||
|
|
||||||
|
if ($id <= 0 || !IPS_InstanceExists($id)) {
|
||||||
|
$this->SendDebug('PublishViaHelper', 'Kein gültiges Publish-Modul gewählt', 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MBPUB_Publish($id, $topic, $payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user