From 6ff107ce1d0cbe8572d2b60ee9e0712d8f309448 Mon Sep 17 00:00:00 2001 From: LAB02 Research Date: Sat, 23 Apr 2022 14:50:57 +0200 Subject: [PATCH] 2022.11.4 --- src/HASS.Agent/Commands/CommandsManager.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HASS.Agent/Commands/CommandsManager.cs b/src/HASS.Agent/Commands/CommandsManager.cs index 0e23cad..49b24c3 100644 --- a/src/HASS.Agent/Commands/CommandsManager.cs +++ b/src/HASS.Agent/Commands/CommandsManager.cs @@ -196,10 +196,10 @@ internal static async Task StoreAsync(List commands, Li // existing, update and re-register var currentCommandIndex = Variables.Commands.FindIndex(x => x.Id == abstractCommand.Id); - if (Variables.Commands[currentCommandIndex].Name != abstractCommand.Name) + if (Variables.Commands[currentCommandIndex].Name != abstractCommand.Name || Variables.Commands[currentCommandIndex].EntityType != abstractCommand.EntityType) { - // name changed, unregister and resubscribe on new mqtt channel - Log.Information("[COMMANDS] Command changed name, re-registering as new entity: {old} to {new}", Variables.Commands[currentCommandIndex].Name, abstractCommand.Name); + // command changed, unregister and resubscribe on new mqtt channel + Log.Information("[COMMANDS] Command changed, re-registering as new entity: {old} to {new}", Variables.Commands[currentCommandIndex].Name, abstractCommand.Name); await Variables.Commands[currentCommandIndex].UnPublishAutoDiscoveryConfigAsync(); await Variables.MqttManager.UnubscribeAsync(Variables.Commands[currentCommandIndex]);