Skip to content

Commit

Permalink
Fix use of optional<T> (#5091)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanov committed Jul 12, 2023
1 parent e4a6408 commit eb859e8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void TemplateBinarySensor::setup() {
return;

if (this->f_ != nullptr) {
this->publish_initial_state(*this->f_());
this->publish_initial_state(this->f_().value_or(false));
} else {
this->publish_initial_state(false);
}
Expand Down

0 comments on commit eb859e8

Please sign in to comment.