mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
minor cleanup
This commit is contained in:
@@ -26,16 +26,8 @@ uuid::log::Logger Command::logger_{F_(command), uuid::log::Facility::DAEMON};
|
||||
|
||||
std::vector<Command::CmdFunction> Command::cmdfunctions_;
|
||||
|
||||
/*
|
||||
static emsesp::array<Command::CmdFunction> cmdfunctions_(90, 255, 16); // reserve space for 90 commands
|
||||
|
||||
emsesp::array<Command::CmdFunction> * Command::commands() {
|
||||
return &cmdfunctions_;
|
||||
}
|
||||
*/
|
||||
|
||||
// calls a command
|
||||
// id may be used to represent a heating circuit for example
|
||||
// id may be used to represent a heating circuit for example, it's optional
|
||||
// returns false if error or not found
|
||||
bool Command::call(const uint8_t device_type, const char * cmd, const char * value, const int8_t id) {
|
||||
auto cf = find_command(device_type, cmd);
|
||||
@@ -99,14 +91,6 @@ void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, cm
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
CmdFunction cf;
|
||||
cf.cmd_ = cmd;
|
||||
cf.device_type_ = device_type;
|
||||
cf.cmdfunction_json_ = nullptr; // empty
|
||||
cf.cmdfunction_ = cb;
|
||||
cmdfunctions_.push(cf);
|
||||
*/
|
||||
cmdfunctions_.emplace_back(device_type, cmd, cb, nullptr);
|
||||
|
||||
// see if we need to subscribe
|
||||
@@ -122,15 +106,6 @@ void Command::add_with_json(const uint8_t device_type, const __FlashStringHelper
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
CmdFunction cf;
|
||||
cf.cmd_ = cmd;
|
||||
cf.device_type_ = device_type;
|
||||
cf.cmdfunction_json_ = cb;
|
||||
cf.cmdfunction_ = nullptr; // empty
|
||||
cmdfunctions_.push(cf);
|
||||
*/
|
||||
|
||||
cmdfunctions_.emplace_back(device_type, cmd, nullptr, cb); // add command
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user