diff --git a/VGT_Sub/module.php b/VGT_Sub/module.php index b3947d5..de839c1 100644 --- a/VGT_Sub/module.php +++ b/VGT_Sub/module.php @@ -2,7 +2,7 @@ declare(strict_types=1); -class VGT_Sub extends IPSModule +class EMS_MQTT_Device extends IPSModule { public function Create() { @@ -38,29 +38,28 @@ class VGT_Sub extends IPSModule $this->ConnectParent('{F7A0DD2E-7684-95C0-64C2-D2A9DC47577B}'); } - public function ApplyChanges() - { - parent::ApplyChanges(); + public function ApplyChanges() + { + parent::ApplyChanges(); - $this->ConnectParent('{F7A0DD2E-7684-95C0-64C2-D2A9DC47577B}'); + $this->ConnectParent('{F7A0DD2E-7684-95C0-64C2-D2A9DC47577B}'); - $device = $this->ReadPropertyString("DeviceID"); + $device = $this->ReadPropertyString("DeviceID"); - // Subscribes - $topics = [ - "feedback-request/" . $device, - "remote-control-request/" . $device - ]; + // Subscribes + $topics = [ + "feedback-request/" . $device, + "remote-control-request/" . $device + ]; - foreach ($topics as $t) { - $this->SendDataToParent(json_encode([ - "DataID" => "{043E0F88-B2B0-4DF4-B1A6-64FB1C385D3C}", - "PacketType" => 8, // SUBSCRIBE - "Topic" => $t - ])); - } + foreach ($topics as $t) { + $this->SendDataToParent(json_encode([ + "DataID" => "{043E0F88-B2B0-4DF4-B1A6-64FB1C385D3C}", + "PacketType" => 8, // SUBSCRIBE + "Topic" => $t + ])); } - + } // --------------------------------------------------------------------- // ACTION HANDLER @@ -174,5 +173,4 @@ class VGT_Sub extends IPSModule ]); } } - ?> \ No newline at end of file