mirror of
https://github.com/esphome/esphome.git
synced 2025-11-18 15:55:46 +00:00
duty_time: fix build without binary_sensor. Parented in automations. (#5156)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -6,9 +6,11 @@ namespace duty_time_sensor {
|
||||
|
||||
static const char *const TAG = "duty_time_sensor";
|
||||
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
void DutyTimeSensor::set_sensor(binary_sensor::BinarySensor *const sensor) {
|
||||
sensor->add_on_state_callback([this](bool state) { this->process_state_(state); });
|
||||
}
|
||||
#endif
|
||||
|
||||
void DutyTimeSensor::start() {
|
||||
if (!this->last_state_)
|
||||
|
||||
Reference in New Issue
Block a user