1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 04:42:21 +01:00

add option to publish initial state of binary sensors (#3636)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
Samuel Sieb
2022-07-24 20:55:32 -07:00
committed by GitHub
parent 04f4dd8a22
commit 6a4e0cf667
4 changed files with 9 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ void BinarySensor::send_state_internal(bool state, bool is_initial) {
}
this->has_state_ = true;
this->state = state;
if (!is_initial) {
if (!is_initial || this->publish_initial_state_) {
this->state_callback_.call(state);
}
}