Ignore Lamp time when power off

This commit is contained in:
T
2025-03-20 22:20:45 +01:00
parent 76f27cdfeb
commit 2866b79ff4
2 changed files with 41 additions and 30 deletions

View File

@@ -3,11 +3,11 @@
#include "esphome/core/component.h"
#include "esphome/components/uart/uart.h"
#undef USE_SENSOR
#undef USE_BINARY_SENSOR
#undef USE_TEXT_SENSOR
#undef USE_SELECT
#undef USE_SWITCH
// #undef USE_SENSOR
// #undef USE_BINARY_SENSOR
// #undef USE_TEXT_SENSOR
// #undef USE_SELECT
// #undef USE_SWITCH
#ifdef USE_SENSOR
#include "esphome/components/sensor/sensor.h"
@@ -52,19 +52,19 @@ class OptomaRS232Component : public uart::UARTDevice, public PollingComponent {
// clang-format off
#ifndef USE_SENSOR
#define SUB_SENSOR(name) protected: DummySensor *name## _sensor_{nullptr}; public:
#define SUB_SENSOR(name) protected: DummySensor *name##_sensor_{nullptr}; public:
#endif
#ifndef USE_BINARY_SENSOR
#define SUB_BINARY_SENSOR(name) protected: DummySensor *name## _binary_sensor_{nullptr}; public:
#define SUB_BINARY_SENSOR(name) protected: DummySensor *name##_binary_sensor_{nullptr}; public:
#endif
#ifndef USE_TEXT_SENSOR
#define SUB_TEXT_SENSOR(name) protected: DummySensor *name## _text_sensor_{nullptr}; public:
#define SUB_TEXT_SENSOR(name) protected: DummySensor *name##_text_sensor_{nullptr}; public:
#endif
#ifndef USE_SELECT
#define SUB_SELECT(name) protected: DummySelect *name## _select_{nullptr}; public:
#define SUB_SELECT(name) protected: DummySelect *name##_select_{nullptr}; public:
#endif
#ifndef USE_SWITCH
#define SUB_SWITCH(name) protected: DummySwitch *name## _switch_{nullptr}; public:
#define SUB_SWITCH(name) protected: DummySwitch *name##_switch_{nullptr}; public:
#endif
// clang-format on