ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
m5stack_8angle_binary_sensor.cpp
Go to the documentation of this file.
2
4
6 int8_t out = this->parent_->read_switch();
7 if (!this->status_comm_result(out != -1, LOG_STR("Could not read binary sensor state from M5Stack 8Angle.")))
8 return;
9 this->publish_state(out != 0);
10}
11
12} // namespace esphome::m5stack_8angle
bool status_comm_result(bool ok)
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
void publish_state(bool new_state)
Publish a new state to the front-end.
std::vector< uint8_t > & out
Definition gif.cpp:49