]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix compilation bug in classic mode -- don't look for config.airplay_device_id.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 16 Oct 2024 14:41:30 +0000 (15:41 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 16 Oct 2024 14:41:30 +0000 (15:41 +0100)
mqtt.c

diff --git a/mqtt.c b/mqtt.c
index addf04f60001822bc9410163adcce49dff5f89f7..105928fd0865a6f2cf69349233632b2494c645f1 100644 (file)
--- a/mqtt.c
+++ b/mqtt.c
@@ -100,7 +100,11 @@ void on_connect(struct mosquitto *mosq, __attribute__((unused)) void *userdata,
 // function to send autodiscovery messages for Home Assistant
 void send_autodiscovery_messages(struct mosquitto *mosq) {
     const char *device_name = config.service_name;
+#ifdef CONFIG_AIRPLAY_2
     const char *device_id = config.airplay_device_id ? config.airplay_device_id : config.service_name;
+#else
+    const char *device_id = config.service_name;
+#endif
     const char *device_id_no_colons = str_replace(device_id, ":", "");
     const char *sw_version = get_version_string();
     const char *model = "shairport-sync";