Skip to content

Commit

Permalink
ignore empty discovery id
Browse files Browse the repository at this point in the history
fixes #101
  • Loading branch information
zivillian committed Mar 22, 2024
1 parent 3993304 commit 57082dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ism7mqtt/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static async Task Main(string[] args)
return;
}

if (discoveryId != null)
if (!String.IsNullOrEmpty(discoveryId))
{
_retain = true;
_useSeparateTopics = true;
Expand Down Expand Up @@ -129,7 +129,7 @@ static async Task Main(string[] args)
};
mqttClient.UseApplicationMessageReceivedHandler(x => OnMessage(client, x, enableDebug, cts.Token));

if (discoveryId != null)
if (!String.IsNullOrEmpty(discoveryId))
{
await mqttClient.SubscribeAsync("homeassistant/status");
client.OnInitializationFinishedAsync = (config, c) =>
Expand Down

0 comments on commit 57082dc

Please sign in to comment.