| 16 | #include <unistd.h> |
| 17 | |
| 18 | SwitchEntity::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 | |
| 31 | uint16_t SwitchEntity::get_room_id() { |
| 32 | return this->_room_id; |
nothing calls this directly
no test coverage detected