From a8a63c0dd60e238bfa3ef9a87347d4a49206ce1c Mon Sep 17 00:00:00 2001 From: Pavlo Dudnytskyi Date: Thu, 22 Aug 2024 18:30:06 +0200 Subject: [PATCH] Switches fix --- components/haier/switch/display.cpp | 3 +++ components/haier/switch/health_mode.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/components/haier/switch/display.cpp b/components/haier/switch/display.cpp index c74e071..5e24843 100644 --- a/components/haier/switch/display.cpp +++ b/components/haier/switch/display.cpp @@ -4,6 +4,9 @@ namespace esphome { namespace haier { void DisplaySwitch::write_state(bool state) { + if (this->parent_->get_display_state() != state) { + this->parent_->set_display_state(state); + } this->publish_state(state); } diff --git a/components/haier/switch/health_mode.cpp b/components/haier/switch/health_mode.cpp index ba91272..3715759 100644 --- a/components/haier/switch/health_mode.cpp +++ b/components/haier/switch/health_mode.cpp @@ -4,6 +4,9 @@ namespace esphome { namespace haier { void HealthModeSwitch::write_state(bool state) { + if (this->parent_->get_health_mode() != state) { + this->parent_->set_health_mode(state); + } this->publish_state(state); }