Skip to content

Commit 77ecf73

Browse files
authored
Increase message repetition count for power on/off messages (#34)
1 parent cc5ab2b commit 77ecf73

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/philips_series_2200/switch/power.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ namespace esphome
4040
if (state)
4141
{
4242
// Send pre-power on message
43-
for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++)
43+
for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++)
4444
mainboard_uart_->write_array(command_pre_power_on);
4545

4646
// Send power on message
4747
if (cleaning_)
4848
{
4949
// Send power on command with cleaning
50-
for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++)
50+
for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++)
5151
mainboard_uart_->write_array(command_power_with_cleaning);
5252
}
5353
else
5454
{
5555
// Send power on command without cleaning
56-
for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++)
56+
for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++)
5757
mainboard_uart_->write_array(command_power_without_cleaning);
5858
}
5959

@@ -66,7 +66,7 @@ namespace esphome
6666
else
6767
{
6868
// Send power off message
69-
for (unsigned int i = 0; i <= MESSAGE_REPETITIONS; i++)
69+
for (unsigned int i = 0; i <= POWER_MESSAGE_REPETITIONS; i++)
7070
mainboard_uart_->write_array(command_power_off);
7171
mainboard_uart_->flush();
7272
}

components/philips_series_2200/switch/power.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "esphome/components/uart/uart.h"
66
#include "../commands.h"
77

8-
#define MESSAGE_REPETITIONS 5
8+
#define POWER_MESSAGE_REPETITIONS 25
99
#define POWER_TRIP_RETRY_DELAY 100
1010
#define MAX_POWER_TRIP_COUNT 5
1111

0 commit comments

Comments
 (0)