Skip to content

Commit

Permalink
re-subscribe to topic after sleep in #10
Browse files Browse the repository at this point in the history
jimmyeao committed Feb 19, 2024
1 parent cffd2f8 commit 53ab431
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -438,6 +438,8 @@ private async Task ReconnectToMqttServerAsync()

// Attempt to connect to the MQTT server with new settings
await mqttClientWrapper.ConnectAsync();
//we need to subscribe again (Thanks to @egglestron for pointing this out!)
await mqttClientWrapper.SubscribeAsync("homeassistant/switch/+/set", MqttQualityOfServiceLevel.AtLeastOnce);
}


4 changes: 2 additions & 2 deletions TEAMS2HA.csproj
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.1.0.277</AssemblyVersion>
<FileVersion>1.1.0.277</FileVersion>
<AssemblyVersion>1.1.0.280</AssemblyVersion>
<FileVersion>1.1.0.280</FileVersion>
<ApplicationIcon>Assets\Square150x150Logo.scale-200.ico</ApplicationIcon>
<Title>Teams2HA</Title>
<PackageIcon>Square150x150Logo.scale-200.png</PackageIcon>

0 comments on commit 53ab431

Please sign in to comment.