MQTT -- add code to deal with empty payloads by adding a dummy payload to empty messages by default.

This commit is contained in:
Mike Brady
2022-02-07 12:36:08 +00:00
parent 8b483c09a1
commit 3d720d65bf
4 changed files with 34 additions and 4 deletions
+9 -1
View File
@@ -224,6 +224,12 @@ metadata =
// How to enable the MQTT-metadata/remote-service
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-mqtt-client
// Note that, for compatability with many MQTT brokers and applications,
// every message that has no extra data is given a
// payload consisting of the string "--".
// You can change this or you can enable empty payloads -- see below.
mqtt =
{
// enabled = "no"; // set this to yes to enable the mqtt-metadata-service
@@ -238,8 +244,10 @@ mqtt =
// topic = NULL; //MQTT topic where this instance of shairport-sync should publish. If not set, the general.name value is used.
// publish_raw = "no"; //whether to publish all available metadata under the codes given in the 'metadata' docs.
// publish_parsed = "no"; //whether to publish a small (but useful) subset of metadata under human-understandable topics
// empty_payload_substitute = "--"; // MQTT messages with empty payloads often are invisible or have special significance to MQTT brokers and readers.
// To avoid empty payload problems, the string here is used instead of any empty payload. Set it to the empty string -- "" -- to leave the payload empty.
// Currently published topics:artist,album,title,genre,format,songalbum,volume,client_ip,
// Additionally, empty messages at the topics play_start,play_end,play_flush,play_resume are published
// Additionally, messages at the topics play_start,play_end,play_flush,play_resume are published
// publish_cover = "no"; //whether to publish the cover over mqtt in binary form. This may lead to a bit of load on the broker
// enable_remote = "no"; //whether to remote control via MQTT. RC is available under `topic`/remote.
// Available commands are "command", "beginff", "beginrew", "mutetoggle", "nextitem", "previtem", "pause", "playpause", "play", "stop", "playresume", "shuffle_songs", "volumedown", "volumeup"