From 3b86dd6a3a97f5cbf6d2f8791bbb2c64a0769ddb Mon Sep 17 00:00:00 2001 From: Ryan Wagoner Date: Mon, 4 Apr 2022 18:12:50 -0400 Subject: [PATCH] Update MQTT Home Assistant discovery to use preset mode instead of deprecated hold mode --- OmniLinkBridge/MQTT/Climate.cs | 6 +++--- OmniLinkBridge/MQTT/MappingExtensions.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OmniLinkBridge/MQTT/Climate.cs b/OmniLinkBridge/MQTT/Climate.cs index b3aca71..aa5c070 100644 --- a/OmniLinkBridge/MQTT/Climate.cs +++ b/OmniLinkBridge/MQTT/Climate.cs @@ -24,8 +24,8 @@ namespace OmniLinkBridge.MQTT public string fan_mode_command_topic { get; set; } public List fan_modes { get; set; } = new List(new string[] { "auto", "on", "cycle" }); - public string hold_state_topic { get; set; } - public string hold_command_topic { get; set; } - public List hold_modes { get; set; } = new List(new string[] { "on", "vacation" }); + public string preset_mode_state_topic { get; set; } + public string preset_mode_command_topic { get; set; } + public List preset_modes { get; set; } = new List(new string[] { "off", "on", "vacation" }); } } diff --git a/OmniLinkBridge/MQTT/MappingExtensions.cs b/OmniLinkBridge/MQTT/MappingExtensions.cs index 7691ccf..1d1a2d9 100644 --- a/OmniLinkBridge/MQTT/MappingExtensions.cs +++ b/OmniLinkBridge/MQTT/MappingExtensions.cs @@ -510,8 +510,8 @@ namespace OmniLinkBridge.MQTT ret.fan_mode_state_topic = thermostat.ToTopic(Topic.fan_mode_state); ret.fan_mode_command_topic = thermostat.ToTopic(Topic.fan_mode_command); - ret.hold_state_topic = thermostat.ToTopic(Topic.hold_state); - ret.hold_command_topic = thermostat.ToTopic(Topic.hold_command); + ret.preset_mode_state_topic = thermostat.ToTopic(Topic.hold_state); + ret.preset_mode_command_topic = thermostat.ToTopic(Topic.hold_command); return ret; }