From 97aaa25dabef7a42549cf721bf3365ec0eaafb98 Mon Sep 17 00:00:00 2001 From: Dawid Chyrzynski Date: Fri, 4 Dec 2020 21:31:46 +0100 Subject: [PATCH] publish HASwitch state with "retain" flag --- src/device-types/HASwitch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device-types/HASwitch.cpp b/src/device-types/HASwitch.cpp index 7f369c8..32278a6 100644 --- a/src/device-types/HASwitch.cpp +++ b/src/device-types/HASwitch.cpp @@ -166,7 +166,7 @@ void HASwitch::publishCurrentState() return; } - mqtt()->publish(topic, (_currentState ? StateOn : StateOff)); + mqtt()->publish(topic, (_currentState ? StateOn : StateOff), true); } void HASwitch::subscribeCommandTopic()