chore: minor refactoring

This commit is contained in:
Philip Stark 2023-06-10 13:59:29 +02:00
parent 8f90d6b1ca
commit 03a012650f
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,4 @@
#include "wordclock.h" #include "wordclock.h"
namespace esphome { namespace esphome {

View file

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "esphome.h" #include "esphome.h"
// #include "esphome/components/sensor/sensor.h"
namespace esphome { namespace esphome {
namespace wordclock { namespace wordclock {
@ -110,6 +112,10 @@ public:
}); });
} }
Color on_color {Color(0xFFFFFF)};
Color off_color {Color(0x000000)};
uint8_t brightness{255};
protected: protected:
// ESPHome Components // ESPHome Components
esphome::time::RealTimeClock *time; esphome::time::RealTimeClock *time;
@ -141,9 +147,7 @@ protected:
Color get_next_color_base_(uint32_t position, uint32_t speed, uint16_t width, const Color &current_color); Color get_next_color_base_(uint32_t position, uint32_t speed, uint16_t width, const Color &current_color);
Color get_next_color(uint32_t position, const Color &current_color); Color get_next_color(uint32_t position, const Color &current_color);
Color on_color {Color(0xFFFFFF)};
Color off_color {Color(0x000000)};
uint8_t brightness{255};
// Utils // Utils
int8_t find_hour(uint8_t target_value); int8_t find_hour(uint8_t target_value);