diff --git a/MainWindow.xaml b/MainWindow.xaml index 07b8d75..13ee56f 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -59,7 +59,7 @@ - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 8a42165..78d4d8d 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -176,7 +176,7 @@ private void LoadSettingsFromFile() } else { - // Set default values if the file does not exist + this.MqttPort = "1883"; // Default MQTT port } } @@ -294,17 +294,17 @@ public MainWindow() #endregion Public Constructors #region Public Methods - public static List GetEntityNames() - { - // Example: return a list of entity names based on the sensors and switches - return new List - { - "Teams Mute Switch", - "Teams Video Switch", - "Teams Hand Raised Sensor", - // Add more entities as per your application's functionality - }; - } + //public static List GetEntityNames() + //{ + // // Example: return a list of entity names based on the sensors and switches + // return new List + // { + // "Teams Mute Switch", + // "Teams Video Switch", + // "Teams Hand Raised Sensor", + // // Add more entities as per your application's functionality + // }; + //} public async Task InitializeConnections() { await InitializeMQTTConnection(); @@ -903,24 +903,24 @@ private async Task PublishConfigurations(MeetingUpdate meetingUpdate, AppSetting } - private async Task PublishDiscoveryMessages() - { - var muteSwitchConfig = new - { - name = "Teams Mute", - unique_id = "TEAMS2HA_mute", - state_topic = "TEAMS2HA/TEAMS/mute", - command_topic = "TEAMS2HA/TEAMS/mute/set", - payload_on = "true", - payload_off = "false", - device = new { identifiers = new[] { "TEAMS2HA" }, name = "Teams Integration", manufacturer = "Your Company" } - }; - - string muteConfigTopic = "homeassistant/switch/TEAMS2HA/mute/config"; - await mqttClientWrapper.PublishAsync(muteConfigTopic, JsonConvert.SerializeObject(muteSwitchConfig)); - - // Repeat for other entities like video - } + //private async Task PublishDiscoveryMessages() + //{ + // var muteSwitchConfig = new + // { + // name = "Teams Mute", + // unique_id = "TEAMS2HA_mute", + // state_topic = "TEAMS2HA/TEAMS/mute", + // command_topic = "TEAMS2HA/TEAMS/mute/set", + // payload_on = "true", + // payload_off = "false", + // device = new { identifiers = new[] { "TEAMS2HA" }, name = "Teams Integration", manufacturer = "Your Company" } + // }; + + // string muteConfigTopic = "homeassistant/switch/TEAMS2HA/mute/config"; + // await mqttClientWrapper.PublishAsync(muteConfigTopic, JsonConvert.SerializeObject(muteSwitchConfig)); + + // // Repeat for other entities like video + //} private bool SaveSettings() { @@ -991,6 +991,8 @@ private async void SetupMqttSensors() // Call PublishConfigurations with the dummy MeetingUpdate await PublishConfigurations(dummyMeetingUpdate, _settings); + + } private async void TeamsClient_TeamsUpdateReceived(object sender, WebSocketClient.TeamsUpdateEventArgs e)