MCPcopy Create free account
hub / github.com/NSPManager/NSPanelManager / turn_on

Method turn_on

docker/MQTTManager/include/switch/switch.cpp:85–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void SwitchEntity::turn_on(bool send_update) {
86 SPDLOG_TRACE("Requested switch {}::{} be turned on.", this->_id, this->_name);
87 this->_requested_state = true;
88 if (send_update) {
89 this->send_state_update_to_controller();
90
91 if (MqttManagerConfig::get_settings().optimistic_mode) {
92 this->_current_state = true;
93 }
94 }
95}
96
97void SwitchEntity::turn_off(bool send_update) {
98 SPDLOG_TRACE("Requested switch {}::{} be turned off.", this->_id, this->_name);

Callers 2

toggleMethod · 0.95
activateMethod · 0.45

Calls 1

Tested by

no test coverage detected