mirror of
https://github.com/esphome/esphome.git
synced 2024-12-01 19:24:14 +01:00
Fix use of optional<T> (#5091)
This commit is contained in:
parent
e4a640844c
commit
eb859e83f8
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ void TemplateBinarySensor::setup() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this->f_ != nullptr) {
|
if (this->f_ != nullptr) {
|
||||||
this->publish_initial_state(*this->f_());
|
this->publish_initial_state(this->f_().value_or(false));
|
||||||
} else {
|
} else {
|
||||||
this->publish_initial_state(false);
|
this->publish_initial_state(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue