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

Method SwitchEntity

docker/MQTTManager/include/switch/switch.cpp:18–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include <unistd.h>
17
18SwitchEntity::SwitchEntity(uint32_t light_id) {
19 this->_id = light_id;
20 this->reload_config();
21
22 // Build MQTT Topics
23 std::string mqtt_base_topic = fmt::format("nspanel/entities/light/{}/", this->_id);
24 this->_current_state = false;
25 this->_requested_state = false;
26 CommandManager::attach_callback(boost::bind(&SwitchEntity::command_callback, this, _1));
27
28 SPDLOG_DEBUG("Switch {}::{} base loaded.", this->_id, this->_name);
29}
30
31uint16_t SwitchEntity::get_room_id() {
32 return this->_room_id;

Callers

nothing calls this directly

Calls 1

reload_configMethod · 0.95

Tested by

no test coverage detected