ESPHome 2026.8.0-dev
Loading...
Searching...
No Matches
power_switch.cpp
Go to the documentation of this file.
1#include "power_switch.h"
2
3namespace esphome::pcm5122 {
4
6 bool ok = (this->mode_ == PCM5122_POWER_SWITCH_MODE_STANDBY) ? this->parent_->set_standby(state)
7 : this->parent_->set_powerdown(state);
8 if (ok)
9 this->publish_state(state);
10}
11
12} // namespace esphome::pcm5122
void write_state(bool state) override
void publish_state(bool state)
Publish a state to the front-end from the back-end.
Definition switch.cpp:56
bool state
Definition fan.h:2
@ PCM5122_POWER_SWITCH_MODE_STANDBY