Skip to content

Commit

Permalink
Increase message repetition count for power on/off messages (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
TillFleisch authored Feb 10, 2024
1 parent cc5ab2b commit 77ecf73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/philips_series_2200/switch/power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion components/philips_series_2200/switch/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 77ecf73

Please sign in to comment.