Skip to content

Commit

Permalink
[RF] ZgatewatPilight: toggle RawEnabled only if Pilight is active rec…
Browse files Browse the repository at this point in the history
…eiver
  • Loading branch information
peshovec committed Feb 11, 2025
1 parent e2ada76 commit 4039f04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion docs/use/rf.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ Generate your RF signals by pressing a remote button or other and you will see :
#### Enabling RAW packet return support
First, you need to compile a binary with `Pilight_rawEnabled true` uncommented in config_RF.h.

Once the device is online, you can turn on the RAW packet return support with the following MQTT command:
Once the device is online and the active receiver is Pilght, you can toggle raw packet return.
If current active receiver is not Pilight the toggle command will be ignored and harmless error message will be published.

You can turn on the RAW packet return support with the following MQTT command:

`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoPilight/protocols" -m '{"rawEnabled":true}'`

Expand Down
10 changes: 6 additions & 4 deletions main/ZgatewayPilight.ino
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@ void XtoPilight(const char* topicOri, JsonObject& Pilightdata) {
if (Pilightdata.containsKey("rawEnabled")) {
Log.notice(F("Setting PiLight raw output enabled: %T" CR), (bool)Pilightdata["rawEnabled"]);
pilightRawEnabled = (bool)Pilightdata["rawEnabled"];
disablePilightReceive();
delay(1);
enablePilightReceive();
success = true;
if (currentReceiver == ACTIVE_PILIGHT) {
disablePilightReceive();
delay(1);
enablePilightReceive();
success = true;
}
}
# endif

Expand Down

0 comments on commit 4039f04

Please sign in to comment.