mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-09-13 21:54:07 +00:00
fix lint warnings from SonarQube
This commit is contained in:
@@ -102,7 +102,7 @@ void AnalogSensor::start(const bool factory_settings) {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||||
F_(setvalue),
|
F_(setvalue),
|
||||||
[&](const char * value, const int8_t id, JsonObject output) { return command_setvalue(value, id); },
|
[&](const char * value, const int8_t id, JsonObject) { return command_setvalue(value, id); },
|
||||||
FL_(setiovalue_cmd),
|
FL_(setiovalue_cmd),
|
||||||
CommandFlag::ADMIN_ONLY);
|
CommandFlag::ADMIN_ONLY);
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ void AnalogSensor::reload(bool get_nvs) {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||||
sensor.name,
|
sensor.name,
|
||||||
[&](const char * value, const int8_t id, JsonObject output) { return command_setvalue(value, sensor.gpio); },
|
[&](const char * value, const int8_t, JsonObject) { return command_setvalue(value, sensor.gpio); },
|
||||||
sensor.type == AnalogType::COUNTER || (sensor.type >= AnalogType::CNT_0 && sensor.type <= AnalogType::CNT_2) ? FL_(counter)
|
sensor.type == AnalogType::COUNTER || (sensor.type >= AnalogType::CNT_0 && sensor.type <= AnalogType::CNT_2) ? FL_(counter)
|
||||||
: sensor.type == AnalogType::DIGITAL_OUT ? FL_(digital_out)
|
: sensor.type == AnalogType::DIGITAL_OUT ? FL_(digital_out)
|
||||||
: sensor.type == AnalogType::RGB ? FL_(RGB)
|
: sensor.type == AnalogType::RGB ? FL_(RGB)
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
|||||||
shell.printfln("Unknown show command");
|
shell.printfln("Unknown show command");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[](Shell const & shell, const std::vector<std::string> & current_arguments, const std::string & next_argument) -> std::vector<std::string> {
|
[](Shell const &, const std::vector<std::string> &, const std::string &) -> std::vector<std::string> {
|
||||||
return std::vector<std::string>{"system", "users", "devices", "log", "ems", "values", "mqtt", "commands"};
|
return std::vector<std::string>{"system", "users", "devices", "log", "ems", "values", "mqtt", "commands"};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
|||||||
CommandFlags::ADMIN,
|
CommandFlags::ADMIN,
|
||||||
{F_(restart)},
|
{F_(restart)},
|
||||||
{F_(partitionname_optional)},
|
{F_(partitionname_optional)},
|
||||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
[](Shell &, const std::vector<std::string> & arguments) {
|
||||||
if (arguments.size()) {
|
if (arguments.size()) {
|
||||||
EMSESP::system_.system_restart(arguments.front().c_str());
|
EMSESP::system_.system_restart(arguments.front().c_str());
|
||||||
} else {
|
} else {
|
||||||
@@ -202,7 +202,7 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
|||||||
commands->add_command(ShellContext::MAIN,
|
commands->add_command(ShellContext::MAIN,
|
||||||
CommandFlags::ADMIN,
|
CommandFlags::ADMIN,
|
||||||
string_vector{F_(wifi), F_(reconnect)},
|
string_vector{F_(wifi), F_(reconnect)},
|
||||||
[](Shell & shell, const std::vector<std::string> & arguments) { EMSESP::network_.reconnect(); });
|
[](Shell &, const std::vector<std::string> &) { EMSESP::network_.reconnect(); });
|
||||||
|
|
||||||
//
|
//
|
||||||
// SET commands
|
// SET commands
|
||||||
@@ -244,7 +244,7 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
|||||||
commands->add_command(ShellContext::MAIN,
|
commands->add_command(ShellContext::MAIN,
|
||||||
CommandFlags::ADMIN,
|
CommandFlags::ADMIN,
|
||||||
string_vector{F_(set), F_(wifi), F_(password)},
|
string_vector{F_(set), F_(wifi), F_(password)},
|
||||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
[](Shell & shell, const std::vector<std::string> &) {
|
||||||
shell.enter_password(F_(new_password_prompt1), [](Shell & shell, bool completed, const std::string & password1) {
|
shell.enter_password(F_(new_password_prompt1), [](Shell & shell, bool completed, const std::string & password1) {
|
||||||
if (completed) {
|
if (completed) {
|
||||||
shell.enter_password(F_(new_password_prompt2), [password1](Shell & shell, bool completed, const std::string & password2) {
|
shell.enter_password(F_(new_password_prompt2), [password1](Shell & shell, bool completed, const std::string & password2) {
|
||||||
@@ -367,7 +367,7 @@ static void setup_commands(std::shared_ptr<Commands> const & commands) {
|
|||||||
// EMS device commands
|
// EMS device commands
|
||||||
//
|
//
|
||||||
|
|
||||||
commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, {F_(scan)}, [](Shell & shell, const std::vector<std::string> & arguments) {
|
commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, {F_(scan)}, [](Shell &, const std::vector<std::string> &) {
|
||||||
EMSESP::scan_devices();
|
EMSESP::scan_devices();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ void Network::begin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// format the BSSID (MAC address) of the network interface
|
// format the BSSID (MAC address) of the network interface
|
||||||
bool Network::formatBSSID(const String & bssid, uint8_t (&mac)[6]) {
|
bool Network::formatBSSID([[maybe_unused]] const String & bssid, [[maybe_unused]] uint8_t (&mac)[6]) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
uint tmp[6];
|
uint tmp[6];
|
||||||
if (bssid.isEmpty() || sscanf(bssid.c_str(), "%X:%X:%X:%X:%X:%X", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) != 6) {
|
if (bssid.isEmpty() || sscanf(bssid.c_str(), "%X:%X:%X:%X:%X:%X", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) != 6) {
|
||||||
@@ -331,7 +331,7 @@ void Network::checkConnection() {
|
|||||||
// 802.11ac - wifi5
|
// 802.11ac - wifi5
|
||||||
// 802.11ax - wifi6
|
// 802.11ax - wifi6
|
||||||
// tx_power is the Tx power to set, 0 for auto
|
// tx_power is the Tx power to set, 0 for auto
|
||||||
void Network::setWiFiPower(uint8_t tx_power) {
|
void Network::setWiFiPower([[maybe_unused]] uint8_t tx_power) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
if (tx_power != 0) {
|
if (tx_power != 0) {
|
||||||
if (!WiFi.setTxPower(static_cast<wifi_power_t>(tx_power))) {
|
if (!WiFi.setTxPower(static_cast<wifi_power_t>(tx_power))) {
|
||||||
@@ -413,7 +413,7 @@ void Network::startmDNS() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WiFi disconnect reason code to string
|
// WiFi disconnect reason code to string
|
||||||
const char * Network::disconnectReason(uint8_t code) {
|
const char * Network::disconnectReason([[maybe_unused]] uint8_t code) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case WIFI_REASON_UNSPECIFIED: // = 1,
|
case WIFI_REASON_UNSPECIFIED: // = 1,
|
||||||
|
|||||||
+9
-9
@@ -110,7 +110,7 @@ bool System::command_send(const char * value, const int8_t id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// send email via SMTP
|
// send email via SMTP
|
||||||
bool System::command_sendmail(const char * value, const int8_t id) {
|
bool System::command_sendmail(const char * value, const int8_t) {
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
uint8_t security;
|
uint8_t security;
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
@@ -487,7 +487,7 @@ void System::set_partition_install_date() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sets the partition to use on the next restart
|
// sets the partition to use on the next restart
|
||||||
bool System::set_partition(const char * partitionname) {
|
bool System::set_partition([[maybe_unused]] const char * partitionname) {
|
||||||
#ifdef EMSESP_STANDALONE
|
#ifdef EMSESP_STANDALONE
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
@@ -1694,7 +1694,7 @@ static const std::pair<const char *, const char *> SECTION_MAP[] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// convert a single config file into a section of the output json object
|
// convert a single config file into a section of the output json object
|
||||||
void System::exportSettings(const std::string & type, const char * filename, JsonObject output) {
|
void System::exportSettings(const std::string & type, [[maybe_unused]] const char * filename, JsonObject output) {
|
||||||
if (type != "settings") {
|
if (type != "settings") {
|
||||||
output["type"] = type; // add the type to the output, not for settings as it's already added because its grouped
|
output["type"] = type; // add the type to the output, not for settings as it's already added because its grouped
|
||||||
}
|
}
|
||||||
@@ -1849,7 +1849,7 @@ void System::exportSystemBackup(JsonObject output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// write a settings file using input from a json object, called from upload/restore
|
// write a settings file using input from a json object, called from upload/restore
|
||||||
bool System::saveSettings(const char * filename, JsonObject input) {
|
bool System::saveSettings([[maybe_unused]] const char * filename, [[maybe_unused]] JsonObject input) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
const char * section = nullptr;
|
const char * section = nullptr;
|
||||||
for (const auto & [f, label] : SECTION_MAP) {
|
for (const auto & [f, label] : SECTION_MAP) {
|
||||||
@@ -2819,7 +2819,7 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
|
|||||||
// rgb for RGB
|
// rgb for RGB
|
||||||
// For example: /api/system/led?data=red:blink1
|
// For example: /api/system/led?data=red:blink1
|
||||||
// For older non-RGB models, the colour would default to just being on.
|
// For older non-RGB models, the colour would default to just being on.
|
||||||
bool System::command_led(const char * value, const int8_t id) {
|
bool System::command_led(const char * value, const int8_t) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return false; // no argument
|
return false; // no argument
|
||||||
}
|
}
|
||||||
@@ -2842,7 +2842,7 @@ bool System::command_led(const char * value, const int8_t id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// txpause command - temporarily pause the TX, by setting Txmode to 0 (disabled)
|
// txpause command - temporarily pause the TX, by setting Txmode to 0 (disabled)
|
||||||
bool System::command_txpause(const char * value, const int8_t id) {
|
bool System::command_txpause(const char * value, const int8_t) {
|
||||||
bool arg;
|
bool arg;
|
||||||
if (!Helpers::value2bool(value, arg)) {
|
if (!Helpers::value2bool(value, arg)) {
|
||||||
return false; // argument not recognized
|
return false; // argument not recognized
|
||||||
@@ -2985,7 +2985,7 @@ bool System::ntp_connected() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// see if its a BBQKees Gateway by checking the eFuse values
|
// see if its a BBQKees Gateway by checking the eFuse values
|
||||||
String System::getBBQKeesGatewayDetails(uint8_t detail) {
|
String System::getBBQKeesGatewayDetails([[maybe_unused]] uint8_t detail) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
@@ -3401,7 +3401,7 @@ bool System::readCommand(const char * data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// system read command
|
// system read command
|
||||||
bool System::command_read(const char * value, const int8_t id) {
|
bool System::command_read(const char * value, const int8_t) {
|
||||||
return readCommand(value);
|
return readCommand(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3696,7 +3696,7 @@ void System::restore_snapshot_gpios(std::vector<int8_t> & u_gpios, std::vector<i
|
|||||||
}
|
}
|
||||||
|
|
||||||
// show the contents of a directory in the LittleFS filesystem
|
// show the contents of a directory in the LittleFS filesystem
|
||||||
void System::listDir(const char * dirname, uint8_t levels) {
|
void System::listDir([[maybe_unused]] const char * dirname, [[maybe_unused]] uint8_t levels) {
|
||||||
#if defined(EMSESP_DEBUG)
|
#if defined(EMSESP_DEBUG)
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
|
|
||||||
|
|||||||
+13
-13
@@ -1822,7 +1822,7 @@ void Boiler::process_HpPool(const std::shared_ptr<const Telegram> & telegram) {
|
|||||||
// Boiler(0x08) -> All(0x00), ?(0x04A2), data: 02 01 01 00 01 00
|
// Boiler(0x08) -> All(0x00), ?(0x04A2), data: 02 01 01 00 01 00
|
||||||
// Boiler(0x08) -W-> Me(0x0B), HpInput(0x04A2), data: 20 07 06 01 00 (from #802)
|
// Boiler(0x08) -W-> Me(0x0B), HpInput(0x04A2), data: 20 07 06 01 00 (from #802)
|
||||||
// see https://github.com/emsesp/EMS-ESP32/issues/2844#issuecomment-3689049155
|
// see https://github.com/emsesp/EMS-ESP32/issues/2844#issuecomment-3689049155
|
||||||
void Boiler::process_HpInput(const std::shared_ptr<const Telegram> & telegram) {
|
void Boiler::process_HpInput(const std::shared_ptr<const Telegram> &) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Heatpump inputs settings- type 0x486 (https://github.com/emsesp/EMS-ESP32/issues/600)
|
// Heatpump inputs settings- type 0x486 (https://github.com/emsesp/EMS-ESP32/issues/600)
|
||||||
@@ -1923,7 +1923,7 @@ void Boiler::process_UBASetPoints2(const std::shared_ptr<const Telegram> & teleg
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 0x35 - not yet implemented, not readable, only for settings
|
// 0x35 - not yet implemented, not readable, only for settings
|
||||||
void Boiler::process_UBAFlags(const std::shared_ptr<const Telegram> & telegram) {
|
void Boiler::process_UBAFlags(const std::shared_ptr<const Telegram> &) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0x1C
|
// 0x1C
|
||||||
@@ -1942,7 +1942,7 @@ void Boiler::process_UBAMaintenanceStatus(const std::shared_ptr<const Telegram>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 0xBF
|
// 0xBF
|
||||||
void Boiler::process_ErrorMessage(const std::shared_ptr<const Telegram> & telegram) {
|
void Boiler::process_ErrorMessage(const std::shared_ptr<const Telegram> &) {
|
||||||
EMSESP::send_read_request(0xC2, device_id(), 0, 20); // read last errorcode
|
EMSESP::send_read_request(0xC2, device_id(), 0, 20); // read last errorcode
|
||||||
EMSESP::send_read_request(0xC6, device_id(), 0, 21); // read last errorcode
|
EMSESP::send_read_request(0xC6, device_id(), 0, 21); // read last errorcode
|
||||||
}
|
}
|
||||||
@@ -2494,7 +2494,7 @@ bool Boiler::set_ww_disinfect_temp(const char * value, const int8_t id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the dhw priority
|
// Set the dhw priority
|
||||||
bool Boiler::set_ww_prio(const char * value, const int8_t id) {
|
bool Boiler::set_ww_prio(const char * value, const int8_t) {
|
||||||
bool b;
|
bool b;
|
||||||
if (!Helpers::value2bool(value, b)) {
|
if (!Helpers::value2bool(value, b)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -2814,7 +2814,7 @@ bool Boiler::set_pump_delay(const char * value, const int8_t id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set pump logic temperature
|
// set pump logic temperature
|
||||||
bool Boiler::set_pumpOnTemp(const char * value, const int8_t id) {
|
bool Boiler::set_pumpOnTemp(const char * value, const int8_t) {
|
||||||
int v;
|
int v;
|
||||||
if (!Helpers::value2temperature(value, v)) {
|
if (!Helpers::value2temperature(value, v)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -3037,7 +3037,7 @@ bool Boiler::set_reset(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_manDefrost(const char * value, const int8_t id) {
|
bool Boiler::set_manDefrost(const char * value, const int8_t) {
|
||||||
bool b;
|
bool b;
|
||||||
if (!Helpers::value2bool(value, b)) {
|
if (!Helpers::value2bool(value, b)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -3046,7 +3046,7 @@ bool Boiler::set_manDefrost(const char * value, const int8_t id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_chimneysweeper(const char * value, const int8_t id) {
|
bool Boiler::set_chimneysweeper(const char * value, const int8_t) {
|
||||||
bool b;
|
bool b;
|
||||||
if (!Helpers::value2bool(value, b)) {
|
if (!Helpers::value2bool(value, b)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -3325,7 +3325,7 @@ bool Boiler::set_auxLimit(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_auxHeaterSource(const char * value, const int8_t id) {
|
bool Boiler::set_auxHeaterSource(const char * value, const int8_t) {
|
||||||
uint8_t v;
|
uint8_t v;
|
||||||
if (Helpers::value2enum(value, v, FL_(enum_auxHeaterSource))) {
|
if (Helpers::value2enum(value, v, FL_(enum_auxHeaterSource))) {
|
||||||
write_command(0x491, 0, v, 0x491);
|
write_command(0x491, 0, v, 0x491);
|
||||||
@@ -3409,7 +3409,7 @@ bool Boiler::set_hpMaxPower(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_pvMaxComp(const char * value, const int8_t id) {
|
bool Boiler::set_pvMaxComp(const char * value, const int8_t) {
|
||||||
float v;
|
float v;
|
||||||
if (Helpers::value2float(value, v)) {
|
if (Helpers::value2float(value, v)) {
|
||||||
write_command(0x484, 54, (uint8_t)(v * 10), 0x484);
|
write_command(0x484, 54, (uint8_t)(v * 10), 0x484);
|
||||||
@@ -3437,7 +3437,7 @@ bool Boiler::set_hpPowerLimit(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_powerReduction(const char * value, const int8_t id) {
|
bool Boiler::set_powerReduction(const char * value, const int8_t) {
|
||||||
int v;
|
int v;
|
||||||
if (Helpers::value2number(value, v)) {
|
if (Helpers::value2number(value, v)) {
|
||||||
write_command(0x484, 64, v / 10, 0x484);
|
write_command(0x484, 64, v / 10, 0x484);
|
||||||
@@ -3661,7 +3661,7 @@ bool Boiler::set_shutdown(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_pumpKickHour(const char * value, const int8_t id) {
|
bool Boiler::set_pumpKickHour(const char * value, const int8_t) {
|
||||||
int v;
|
int v;
|
||||||
if (Helpers::value2number(value, v, 0, 23)) {
|
if (Helpers::value2number(value, v, 0, 23)) {
|
||||||
write_command(0xEB, 0, v, 0xEB);
|
write_command(0xEB, 0, v, 0xEB);
|
||||||
@@ -3670,7 +3670,7 @@ bool Boiler::set_pumpKickHour(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_pumpKickDay(const char * value, const int8_t id) {
|
bool Boiler::set_pumpKickDay(const char * value, const int8_t) {
|
||||||
uint8_t v;
|
uint8_t v;
|
||||||
if (Helpers::value2enum(value, v, FL_(enum_dayOfWeek))) {
|
if (Helpers::value2enum(value, v, FL_(enum_dayOfWeek))) {
|
||||||
write_command(0xEB, 1, v + 1, 0xEB);
|
write_command(0xEB, 1, v + 1, 0xEB);
|
||||||
@@ -3679,7 +3679,7 @@ bool Boiler::set_pumpKickDay(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Boiler::set_pumpKickDelay(const char * value, const int8_t id) {
|
bool Boiler::set_pumpKickDelay(const char * value, const int8_t) {
|
||||||
int v;
|
int v;
|
||||||
if (Helpers::value2number(value, v, 0, 32767)) {
|
if (Helpers::value2number(value, v, 0, 32767)) {
|
||||||
uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)v};
|
uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)v};
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ bool Mixer::set_flowTempOffset(const char * value, const int8_t id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mixer::set_pressure(const char * value, const int8_t id) {
|
bool Mixer::set_pressure(const char * value, const int8_t) {
|
||||||
int v;
|
int v;
|
||||||
if (!Helpers::value2number(value, v)) {
|
if (!Helpers::value2number(value, v)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -288,7 +288,7 @@ bool Mixer::set_pressure(const char * value, const int8_t id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mixer::set_wwprio(const char * value, const int8_t id) {
|
bool Mixer::set_wwprio(const char * value, const int8_t) {
|
||||||
bool b;
|
bool b;
|
||||||
if (!Helpers::value2bool(value, b)) {
|
if (!Helpers::value2bool(value, b)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1122,7 +1122,7 @@ bool Solar::set_diffControl(const char * value, const int8_t id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Solar::set_solarHeatAssistOn(const char * value, const int8_t id) {
|
bool Solar::set_solarHeatAssistOn(const char * value, const int8_t) {
|
||||||
float t;
|
float t;
|
||||||
if (!Helpers::value2float(value, t)) {
|
if (!Helpers::value2float(value, t)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1131,7 +1131,7 @@ bool Solar::set_solarHeatAssistOn(const char * value, const int8_t id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Solar::set_solarHeatAssistOff(const char * value, const int8_t id) {
|
bool Solar::set_solarHeatAssistOff(const char * value, const int8_t) {
|
||||||
float t;
|
float t;
|
||||||
if (!Helpers::value2float(value, t)) {
|
if (!Helpers::value2float(value, t)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+35
-27
@@ -1663,32 +1663,40 @@ void Thermostat::process_RC35Timer(const std::shared_ptr<const Telegram> & teleg
|
|||||||
has_update(telegram, hc->pause, 85); // time in hours
|
has_update(telegram, hc->pause, 85); // time in hours
|
||||||
has_update(telegram, hc->party, 86); // time in hours
|
has_update(telegram, hc->party, 86); // time in hours
|
||||||
|
|
||||||
if (telegram->message_length + telegram->offset >= 92 && telegram->offset <= 87) {
|
// vacation dates are in positions 87 to 92
|
||||||
char data[sizeof(hc->vacation) + 4]; // avoid compiler warning
|
if (telegram->offset <= 87 && (telegram->offset + telegram->message_length) > 92) {
|
||||||
snprintf(data,
|
const uint8_t pos = 87 - telegram->offset;
|
||||||
sizeof(data),
|
if ((pos + 5) < EMS_MAX_TELEGRAM_MESSAGE_LENGTH) {
|
||||||
"%02d.%02d.%04d-%02d.%02d.%04d",
|
char data[sizeof(hc->vacation) + 4]; // avoid compiler warning
|
||||||
telegram->message_data[87 - telegram->offset],
|
snprintf(data,
|
||||||
telegram->message_data[88 - telegram->offset],
|
sizeof(data),
|
||||||
telegram->message_data[89 - telegram->offset] + 2000,
|
"%02d.%02d.%04d-%02d.%02d.%04d",
|
||||||
telegram->message_data[90 - telegram->offset],
|
telegram->message_data[pos],
|
||||||
telegram->message_data[91 - telegram->offset],
|
telegram->message_data[pos + 1],
|
||||||
telegram->message_data[92 - telegram->offset] + 2000);
|
telegram->message_data[pos + 2] + 2000,
|
||||||
has_update(hc->vacation, data, sizeof(hc->vacation));
|
telegram->message_data[pos + 3],
|
||||||
|
telegram->message_data[pos + 4],
|
||||||
|
telegram->message_data[pos + 5] + 2000);
|
||||||
|
has_update(hc->vacation, data, sizeof(hc->vacation));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (telegram->message_length + telegram->offset >= 98 && telegram->offset <= 93) {
|
// holiday dates are in positions 93 to 98
|
||||||
char data[sizeof(hc->holiday) + 4]; // avoid compiler warning
|
if (telegram->offset <= 93 && (telegram->offset + telegram->message_length) > 98) {
|
||||||
snprintf(data,
|
const uint8_t pos = 93 - telegram->offset;
|
||||||
sizeof(data),
|
if ((pos + 5) < EMS_MAX_TELEGRAM_MESSAGE_LENGTH) {
|
||||||
"%02d.%02d.%04d-%02d.%02d.%04d",
|
char data[sizeof(hc->holiday) + 4]; // avoid compiler warning
|
||||||
telegram->message_data[93 - telegram->offset],
|
snprintf(data,
|
||||||
telegram->message_data[94 - telegram->offset],
|
sizeof(data),
|
||||||
telegram->message_data[95 - telegram->offset] + 2000,
|
"%02d.%02d.%04d-%02d.%02d.%04d",
|
||||||
telegram->message_data[96 - telegram->offset],
|
telegram->message_data[pos],
|
||||||
telegram->message_data[97 - telegram->offset],
|
telegram->message_data[pos + 1],
|
||||||
telegram->message_data[98 - telegram->offset] + 2000);
|
telegram->message_data[pos + 2] + 2000,
|
||||||
has_update(hc->holiday, data, sizeof(hc->holiday));
|
telegram->message_data[pos + 3],
|
||||||
|
telegram->message_data[pos + 4],
|
||||||
|
telegram->message_data[pos + 5] + 2000);
|
||||||
|
has_update(hc->holiday, data, sizeof(hc->holiday));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1862,7 +1870,7 @@ void Thermostat::process_RCErrorMessage(const std::shared_ptr<const Telegram> &
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 0xBF
|
// 0xBF
|
||||||
void Thermostat::process_ErrorMessageBF(const std::shared_ptr<const Telegram> & telegram) {
|
void Thermostat::process_ErrorMessageBF(const std::shared_ptr<const Telegram> &) {
|
||||||
EMSESP::send_read_request(0xC0, device_id(), 0, 20); // read last errorcode
|
EMSESP::send_read_request(0xC0, device_id(), 0, 20); // read last errorcode
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2338,7 +2346,7 @@ bool Thermostat::set_damping(const char * value, const int8_t id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 0x0241- Set solar
|
// 0x0241- Set solar
|
||||||
bool Thermostat::set_solar(const char * value, const int8_t id) {
|
bool Thermostat::set_solar(const char * value, const int8_t) {
|
||||||
bool b;
|
bool b;
|
||||||
if (Helpers::value2bool(value, b)) {
|
if (Helpers::value2bool(value, b)) {
|
||||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
if (model() == EMSdevice::EMS_DEVICE_FLAG_RC100) {
|
||||||
@@ -3034,7 +3042,7 @@ bool Thermostat::set_party(const char * value, const int8_t id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Thermostat::set_absent(const char * value, const int8_t id) {
|
bool Thermostat::set_absent(const char * value, const int8_t) {
|
||||||
bool b;
|
bool b;
|
||||||
if (Helpers::value2bool(value, b)) {
|
if (Helpers::value2bool(value, b)) {
|
||||||
write_command(0x16E, 0, b ? 0xFF : 0, 0x16E);
|
write_command(0x16E, 0, b ? 0xFF : 0, 0x16E);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ void Ventilation::process_ModeMessage(const std::shared_ptr<const Telegram> & te
|
|||||||
}
|
}
|
||||||
|
|
||||||
// message 0x0587, data: 00 00 64 00 64 0A 00 01 54 01 00 01 00 00 00 46 00 00 00 02 00 A3 00 A3
|
// message 0x0587, data: 00 00 64 00 64 0A 00 01 54 01 00 01 00 00 00 46 00 00 00 02 00 A3 00 A3
|
||||||
void Ventilation::process_BypassMessage(const std::shared_ptr<const Telegram> & telegram) {
|
void Ventilation::process_BypassMessage(const std::shared_ptr<const Telegram> &) {
|
||||||
// has_update(telegram, bypass_closing, 0);
|
// has_update(telegram, bypass_closing, 0);
|
||||||
// has_update(telegram, bypass_opening, 1);
|
// has_update(telegram, bypass_opening, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ StateUpdateResult WebCommands::update(JsonObject root, WebCommands & webCommands
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::COMMAND,
|
EMSdevice::DeviceType::COMMAND,
|
||||||
webCommands.commandItems.back().name,
|
webCommands.commandItems.back().name,
|
||||||
[name = std::string(webCommands.commandItems.back().name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(webCommands.commandItems.back().name)](const char * value, const int8_t, JsonObject) {
|
||||||
return EMSESP::webCommandService.dispatchCommand(name.c_str(), value); // value is optional
|
return EMSESP::webCommandService.dispatchCommand(name.c_str(), value); // value is optional
|
||||||
},
|
},
|
||||||
FL_(command_cmd),
|
FL_(command_cmd),
|
||||||
@@ -448,7 +448,7 @@ void WebCommandService::load_test_data() {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::COMMAND,
|
EMSdevice::DeviceType::COMMAND,
|
||||||
item.name,
|
item.name,
|
||||||
[name = std::string(item.name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(item.name)](const char * value, const int8_t, JsonObject) {
|
||||||
return EMSESP::webCommandService.dispatchCommand(name.c_str(), value);
|
return EMSESP::webCommandService.dispatchCommand(name.c_str(), value);
|
||||||
},
|
},
|
||||||
FL_(command_cmd),
|
FL_(command_cmd),
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::CUSTOM,
|
EMSdevice::DeviceType::CUSTOM,
|
||||||
webCustomEntity.customEntityItems.back().name,
|
webCustomEntity.customEntityItems.back().name,
|
||||||
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject) {
|
||||||
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
||||||
},
|
},
|
||||||
FL_(entity_cmd),
|
FL_(entity_cmd),
|
||||||
@@ -798,7 +798,7 @@ void WebCustomEntityService::load_test_data() {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::CUSTOM,
|
EMSdevice::DeviceType::CUSTOM,
|
||||||
webCustomEntity.customEntityItems.back().name,
|
webCustomEntity.customEntityItems.back().name,
|
||||||
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject) {
|
||||||
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
||||||
},
|
},
|
||||||
FL_(entity_cmd),
|
FL_(entity_cmd),
|
||||||
@@ -834,7 +834,7 @@ void WebCustomEntityService::load_test_data() {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::CUSTOM,
|
EMSdevice::DeviceType::CUSTOM,
|
||||||
webCustomEntity.customEntityItems.back().name,
|
webCustomEntity.customEntityItems.back().name,
|
||||||
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject) {
|
||||||
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
||||||
},
|
},
|
||||||
FL_(entity_cmd),
|
FL_(entity_cmd),
|
||||||
@@ -857,7 +857,7 @@ void WebCustomEntityService::load_test_data() {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::CUSTOM,
|
EMSdevice::DeviceType::CUSTOM,
|
||||||
webCustomEntity.customEntityItems.back().name,
|
webCustomEntity.customEntityItems.back().name,
|
||||||
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(webCustomEntity.customEntityItems.back().name)](const char * value, const int8_t id, JsonObject) {
|
||||||
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
return EMSESP::webCustomEntityService.command_setvalue(value, id, name.c_str());
|
||||||
},
|
},
|
||||||
FL_(entity_cmd),
|
FL_(entity_cmd),
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ StateUpdateResult WebScheduler::update(JsonObject root, WebScheduler & webSchedu
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::SCHEDULER,
|
EMSdevice::DeviceType::SCHEDULER,
|
||||||
webScheduler.scheduleItems.back().name,
|
webScheduler.scheduleItems.back().name,
|
||||||
[name = std::string(webScheduler.scheduleItems.back().name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(webScheduler.scheduleItems.back().name)](const char * value, const int8_t id, JsonObject) {
|
||||||
return EMSESP::webSchedulerService.command_setvalue(value, id, name.c_str());
|
return EMSESP::webSchedulerService.command_setvalue(value, id, name.c_str());
|
||||||
},
|
},
|
||||||
FL_(schedule_cmd),
|
FL_(schedule_cmd),
|
||||||
@@ -464,7 +464,7 @@ void WebSchedulerService::load_test_data() {
|
|||||||
Command::add(
|
Command::add(
|
||||||
EMSdevice::DeviceType::SCHEDULER,
|
EMSdevice::DeviceType::SCHEDULER,
|
||||||
item.name,
|
item.name,
|
||||||
[name = std::string(item.name)](const char * value, const int8_t id, JsonObject output) {
|
[name = std::string(item.name)](const char * value, const int8_t id, JsonObject) {
|
||||||
return EMSESP::webSchedulerService.command_setvalue(value, id, name.c_str());
|
return EMSESP::webSchedulerService.command_setvalue(value, id, name.c_str());
|
||||||
},
|
},
|
||||||
FL_(schedule_cmd),
|
FL_(schedule_cmd),
|
||||||
|
|||||||
Reference in New Issue
Block a user