From 77ecf730e2e52f3f4b66cbc85a0c4ad3263cb574 Mon Sep 17 00:00:00 2001 From: Till Date: Sat, 10 Feb 2024 21:22:13 +0100 Subject: [PATCH] Increase message repetition count for power on/off messages (#34) --- components/philips_series_2200/switch/power.cpp | 8 ++++---- components/philips_series_2200/switch/power.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/philips_series_2200/switch/power.cpp b/components/philips_series_2200/switch/power.cpp index a1e6133..26a3f54 100644 --- a/components/philips_series_2200/switch/power.cpp +++ b/components/philips_series_2200/switch/power.cpp @@ -40,20 +40,20 @@ namespace esphome if (state) { // Send pre-power on message - for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++) + for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++) mainboard_uart_->write_array(command_pre_power_on); // Send power on message if (cleaning_) { // Send power on command with cleaning - for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++) + for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++) mainboard_uart_->write_array(command_power_with_cleaning); } else { // Send power on command without cleaning - for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++) + for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++) mainboard_uart_->write_array(command_power_without_cleaning); } @@ -66,7 +66,7 @@ namespace esphome else { // Send power off message - for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++) + for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++) mainboard_uart_->write_array(command_power_off); mainboard_uart_->flush(); } diff --git a/components/philips_series_2200/switch/power.h b/components/philips_series_2200/switch/power.h index 78adf55..2610442 100644 --- a/components/philips_series_2200/switch/power.h +++ b/components/philips_series_2200/switch/power.h @@ -5,7 +5,7 @@ #include "esphome/components/uart/uart.h" #include "../commands.h" -#define MESSAGE_REPETITIONS 5 +#define POWER_MESSAGE_REPETITIONS 25 #define POWER_TRIP_RETRY_DELAY 100 #define MAX_POWER_TRIP_COUNT 5