From 777c9db0f62e40d6e183feddde3cc6db2584e542 Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 28 Sep 2022 15:47:27 +0200 Subject: [PATCH] remove flash --- lib/uuid-common/src/uuid/common.h | 3 +- lib/uuid-console/src/commands.cpp | 61 +- lib/uuid-console/src/shell.cpp | 34 +- lib/uuid-console/src/shell_log.cpp | 4 +- lib/uuid-console/src/uuid/console.h | 30 +- lib/uuid-log/src/format_level_lowercase.cpp | 22 +- lib/uuid-log/src/format_level_uppercase.cpp | 22 +- lib/uuid-log/src/format_timestamp_ms.cpp | 2 +- lib/uuid-log/src/log.cpp | 4 +- lib/uuid-log/src/uuid/log.h | 8 +- lib/uuid-syslog/src/syslog.cpp | 13 +- lib/uuid-telnet/src/telnet.cpp | 14 +- lib_standalone/Arduino.h | 5 +- src/analogsensor.cpp | 32 +- src/command.cpp | 48 +- src/command.h | 38 +- src/common.h | 18 +- src/console.cpp | 194 +-- src/dallassensor.cpp | 40 +- src/devices/boiler.cpp | 108 +- src/devices/controller.cpp | 2 +- src/devices/gateway.cpp | 2 +- src/devices/heatpump.cpp | 4 +- src/devices/mixer.cpp | 32 +- src/devices/solar.cpp | 56 +- src/devices/switch.cpp | 6 +- src/devices/thermostat.cpp | 146 +- src/emsdevice.cpp | 294 ++-- src/emsdevice.h | 146 +- src/emsdevicevalue.cpp | 46 +- src/emsdevicevalue.h | 71 +- src/emsesp.cpp | 141 +- src/helpers.cpp | 49 +- src/helpers.h | 15 +- src/locale_common.h | 84 +- src/locale_translations.h | 1718 ++++++++----------- src/mqtt.cpp | 206 ++- src/mqtt.h | 42 +- src/shower.cpp | 16 +- src/system.cpp | 208 ++- src/telegram.cpp | 46 +- src/test/test.cpp | 126 +- src/web/WebAPIService.cpp | 2 +- src/web/WebDataService.cpp | 4 +- src/web/WebStatusService.cpp | 22 +- 45 files changed, 1919 insertions(+), 2265 deletions(-) diff --git a/lib/uuid-common/src/uuid/common.h b/lib/uuid-common/src/uuid/common.h index 1a1ae18ea..578c3198a 100644 --- a/lib/uuid-common/src/uuid/common.h +++ b/lib/uuid-common/src/uuid/common.h @@ -85,7 +85,8 @@ std::string printable_to_string(const Printable & printable); * * @since 1.0.0 */ -using flash_string_vector = std::vector; + +using string_vector = std::vector; /** * Loop function that must be called regularly to detect a 32-bit diff --git a/lib/uuid-console/src/commands.cpp b/lib/uuid-console/src/commands.cpp index 1bd37b385..b611c1d73 100644 --- a/lib/uuid-console/src/commands.cpp +++ b/lib/uuid-console/src/commands.cpp @@ -42,30 +42,36 @@ namespace uuid { namespace console { -void Commands::add_command(const flash_string_vector & name, command_function function) { - add_command(0, 0, name, flash_string_vector{}, function, nullptr); +void Commands::add_command(const string_vector & name, command_function function) { + add_command(0, 0, name, string_vector{}, function, nullptr); } -void Commands::add_command(const flash_string_vector & name, const flash_string_vector & arguments, command_function function) { +void Commands::add_command(const string_vector & name, const string_vector & arguments, command_function function) { add_command(0, 0, name, arguments, function, nullptr); } -void Commands::add_command(const flash_string_vector & name, const flash_string_vector & arguments, command_function function, argument_completion_function arg_function) { +void Commands::add_command(const string_vector & name, const string_vector & arguments, command_function function, argument_completion_function arg_function) { add_command(0, 0, name, arguments, function, arg_function); } -void Commands::add_command(unsigned int context, unsigned int flags, const flash_string_vector & name, command_function function) { - add_command(context, flags, name, flash_string_vector{}, function, nullptr); +void Commands::add_command(unsigned int context, unsigned int flags, const string_vector & name, command_function function) { + add_command(context, flags, name, string_vector{}, function, nullptr); } -void Commands::add_command(unsigned int context, unsigned int flags, const flash_string_vector & name, const flash_string_vector & arguments, command_function function) { +void Commands::add_command(unsigned int context, unsigned int flags, const string_vector & name, const string_vector & arguments, command_function function) { add_command(context, flags, name, arguments, function, nullptr); } -void Commands::add_command(unsigned int context, unsigned int flags, const flash_string_vector & name, const flash_string_vector & arguments, command_function function, argument_completion_function arg_function) { +void Commands::add_command(unsigned int context, + unsigned int flags, + const string_vector & name, + const string_vector & arguments, + command_function function, + argument_completion_function arg_function) { commands_.emplace(std::piecewise_construct, std::forward_as_tuple(context), std::forward_as_tuple(flags, name, arguments, function, arg_function)); } + // added by proddy // note we should really iterate and free up the lambda code and any flashstrings void Commands::remove_all_commands() { @@ -139,7 +145,7 @@ bool Commands::find_longest_common_prefix(const std::multimapsecond->name_.begin(), length))) { + if ((*std::next(first.begin(), length)) != (*std::next(command_it->second->name_.begin(), length))) { all_match = false; break; } @@ -152,7 +158,7 @@ bool Commands::find_longest_common_prefix(const std::multimap(first) + length) != pgm_read_byte(reinterpret_cast(*std::next(command_it->second->name_.begin(), component_prefix)) + length)) { + if (pgm_read_byte(reinterpret_cast(first) + length) + != pgm_read_byte(reinterpret_cast(*std::next(command_it->second->name_.begin(), component_prefix)) + length)) { all_match = false; break; } @@ -179,7 +186,8 @@ bool Commands::find_longest_common_prefix(const std::multimap 0) { - longest_name.push_back(std::move(read_flash_string(first).substr(0, chars_prefix))); + // TODO fix, no more PGM + longest_name.push_back(std::string(first).substr(0, chars_prefix)); return false; } } @@ -243,7 +251,7 @@ Commands::Completion Commands::complete_command(Shell & shell, const CommandLine } if (!temp_command_name.empty() && command_line.total_size() <= temp_command_name.size()) { - temp_command = std::make_unique(0, flash_string_vector{}, flash_string_vector{}, nullptr, nullptr); + temp_command = std::make_unique(0, string_vector{}, string_vector{}, nullptr, nullptr); count = 1; match = commands.partial.end(); result.replacement.trailing_space = whole_components; @@ -259,10 +267,11 @@ Commands::Completion Commands::complete_command(Shell & shell, const CommandLine auto & matching_command = match->second; for (auto & name : matching_command->name_) { - result.replacement->push_back(std::move(read_flash_string(name))); + result.replacement->push_back(std::move((name))); } - if (command_line.total_size() > result.replacement->size() && command_line.total_size() <= matching_command->name_.size() + matching_command->maximum_arguments()) { + if (command_line.total_size() > result.replacement->size() + && command_line.total_size() <= matching_command->name_.size() + matching_command->maximum_arguments()) { // Try to auto-complete arguments std::vector arguments{std::next(command_line->cbegin(), result.replacement->size()), command_line->cend()}; @@ -332,7 +341,7 @@ Commands::Completion Commands::complete_command(Shell & shell, const CommandLine remaining_help.escape_initial_parameters(); for (auto it = std::next(matching_command->arguments_.cbegin(), current_args_count); it != matching_command->arguments_.cend(); it++) { - remaining_help->push_back(std::move(read_flash_string(*it))); + remaining_help->push_back(std::move((*it))); } } @@ -380,7 +389,7 @@ Commands::Completion Commands::complete_command(Shell & shell, const CommandLine } for (; flash_name_it != command_it->second->name_.cend(); flash_name_it++) { - std::string name = read_flash_string(*flash_name_it); + std::string name = (*flash_name_it); // Skip parts of the command name that match the command line if (line_it != command_line->cend()) { @@ -403,7 +412,7 @@ Commands::Completion Commands::complete_command(Shell & shell, const CommandLine continue; } - help->push_back(std::move(read_flash_string(argument))); + help->push_back(std::move((argument))); } result.help.push_back(std::move(help)); @@ -416,7 +425,7 @@ Commands::Completion Commands::complete_command(Shell & shell, const CommandLine if (commands.exact.count(longest->first) == 1) { for (auto & name : longest->second->name_) { - result.replacement->push_back(std::move(read_flash_string(name))); + result.replacement->push_back(std::move((name))); // TODO remove all moves? } // Add a space because there are sub-commands for a command that has matched exactly @@ -449,7 +458,7 @@ Commands::Match Commands::find_command(Shell & shell, const CommandLine & comman auto line_it = command_line->cbegin(); for (; name_it != command.name_.cend() && line_it != command_line->cend(); name_it++, line_it++) { - std::string name = read_flash_string(*name_it); + std::string name = (*name_it); size_t found = name.rfind(*line_it, 0); if (found == std::string::npos) { @@ -499,12 +508,12 @@ void Commands::for_each_available_command(Shell & shell, apply_function f) const name.reserve(command_it->second.name_.size()); for (auto flash_name : command_it->second.name_) { - name.push_back(std::move(read_flash_string(flash_name))); + name.push_back(std::move((flash_name))); } arguments.reserve(command_it->second.arguments_.size()); for (auto flash_argument : command_it->second.arguments_) { - arguments.push_back(std::move(read_flash_string(flash_argument))); + arguments.push_back(std::move((flash_argument))); } f(name, arguments); @@ -512,7 +521,11 @@ void Commands::for_each_available_command(Shell & shell, apply_function f) const } } -Commands::Command::Command(unsigned int flags, const flash_string_vector name, const flash_string_vector arguments, command_function function, argument_completion_function arg_function) +Commands::Command::Command(unsigned int flags, + const string_vector name, + const string_vector arguments, + command_function function, + argument_completion_function arg_function) : flags_(flags) , name_(name) , arguments_(arguments) @@ -524,7 +537,7 @@ Commands::Command::~Command() { } size_t Commands::Command::minimum_arguments() const { - return std::count_if(arguments_.cbegin(), arguments_.cend(), [](const __FlashStringHelper * argument) { return pgm_read_byte(argument) == '<'; }); + return std::count_if(arguments_.cbegin(), arguments_.cend(), [](const char * argument) { return pgm_read_byte(argument) == '<'; }); } } // namespace console diff --git a/lib/uuid-console/src/shell.cpp b/lib/uuid-console/src/shell.cpp index f5ee26322..54d2f2079 100644 --- a/lib/uuid-console/src/shell.cpp +++ b/lib/uuid-console/src/shell.cpp @@ -135,8 +135,8 @@ void Shell::loop_one() { } } -void Shell::set_command_str(const __FlashStringHelper * str) { - line_buffer_ = read_flash_string(str); +void Shell::set_command_str(const char * str) { + line_buffer_ = (str); erase_current_line(); prompt_displayed_ = false; display_prompt(); @@ -262,30 +262,32 @@ void Shell::loop_normal() { } else if (esc_ == 1) { // pos1 cursor_ = line_buffer_.length(); } else if (esc_ == 11) { // F1 - set_command_str(F("help")); + + // TODO use flash here? + set_command_str(("help")); } else if (esc_ == 12) { // F2 - set_command_str(F("show")); + set_command_str(("show")); } else if (esc_ == 13) { // F3 - set_command_str(F("log notice")); + set_command_str(("log notice")); } else if (esc_ == 14) { // F4 - set_command_str(F("log info")); + set_command_str(("log info")); } else if (esc_ == 15) { // F5 - set_command_str(F("log debug")); + set_command_str(("log debug")); } else if (esc_ == 17) { // F6 - set_command_str(F("watch off")); + set_command_str(("watch off")); } else if (esc_ == 18) { // F7 - set_command_str(F("watch on")); + set_command_str(("watch on")); } else if (esc_ == 19) { // F8 - set_command_str(F("watch raw")); + set_command_str(("watch raw")); } else if (esc_ == 20) { // F9 - set_command_str(F("call system info")); + set_command_str(("call system info")); } else if (esc_ == 21) { // F10 - set_command_str(F("call system settings")); + set_command_str(("call system settings")); } else if (esc_ == 23) { // F11 - line_buffer_ = read_flash_string(F("call send \"0B \"")); + line_buffer_ = (("call send \"0B \"")); cursor_ = 1; } else if (esc_ == 24) { // F12 - set_command_str(F("log debug; watch raw")); + set_command_str(("log debug; watch raw")); } esc_ = 0; } else if (c >= '0' && (c <= '9')) { // numbers @@ -320,7 +322,7 @@ void Shell::loop_normal() { idle_time_ = uuid::get_uptime_ms(); } -Shell::PasswordData::PasswordData(const __FlashStringHelper * password_prompt, password_function && password_function) +Shell::PasswordData::PasswordData(const char * password_prompt, password_function && password_function) : password_prompt_(password_prompt) , password_function_(std::move(password_function)) { } @@ -452,7 +454,7 @@ void Shell::loop_blocking() { } } -void Shell::enter_password(const __FlashStringHelper * prompt, password_function function) { +void Shell::enter_password(const char * prompt, password_function function) { if (mode_ == Mode::NORMAL) { mode_ = Mode::PASSWORD; mode_data_ = std::make_unique(prompt, std::move(function)); diff --git a/lib/uuid-console/src/shell_log.cpp b/lib/uuid-console/src/shell_log.cpp index f9a38400e..3349270c0 100644 --- a/lib/uuid-console/src/shell_log.cpp +++ b/lib/uuid-console/src/shell_log.cpp @@ -30,8 +30,8 @@ namespace uuid { namespace console { -static const char __pstr__logger_name[] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "shell"; -const uuid::log::Logger Shell::logger_{reinterpret_cast(__pstr__logger_name), uuid::log::Facility::LPR}; +static const char __pstr__logger_name[] = "shell"; +const uuid::log::Logger Shell::logger_{(__pstr__logger_name), uuid::log::Facility::LPR}; Shell::QueuedLogMessage::QueuedLogMessage(unsigned long id, std::shared_ptr && content) : id_(id) diff --git a/lib/uuid-console/src/uuid/console.h b/lib/uuid-console/src/uuid/console.h index 85e4a3031..d2c8a3727 100644 --- a/lib/uuid-console/src/uuid/console.h +++ b/lib/uuid-console/src/uuid/console.h @@ -335,7 +335,7 @@ class Shell : public std::enable_shared_from_this, public uuid::log::Hand * execution. * @since 0.1.0 */ - void enter_password(const __FlashStringHelper * prompt, password_function function); + void enter_password(const char * prompt, password_function function); /** * Stop executing anything on this shell for a period of time. @@ -682,10 +682,10 @@ class Shell : public std::enable_shared_from_this, public uuid::log::Hand * execution. * @since 0.1.0 */ - PasswordData(const __FlashStringHelper * password_prompt, password_function && password_function); + PasswordData(const char * password_prompt, password_function && password_function); ~PasswordData() override = default; - const __FlashStringHelper * password_prompt_; /*!< Prompt requesting password input. @since 0.1.0 */ + const char * password_prompt_; /*!< Prompt requesting password input. @since 0.1.0 */ password_function password_function_; /*!< Function to execute after password entry. @since 0.1.0 */ }; @@ -893,7 +893,7 @@ class Shell : public std::enable_shared_from_this, public uuid::log::Hand * @since 0.1.0 */ size_t vprintf(const __FlashStringHelper * format, va_list ap); - void set_command_str(const __FlashStringHelper * str); + void set_command_str(const char * str); static const uuid::log::Logger logger_; /*!< uuid::log::Logger instance for shells. @since 0.1.0 */ static std::set> shells_; /*!< Registered running shells to be executed. @since 0.1.0 */ @@ -1188,7 +1188,7 @@ class Commands { * executed. * @since 0.2.0 */ - void add_command(const flash_string_vector & name, command_function function); + void add_command(const string_vector & name, command_function function); /** * Add a command with arguments to the list of commands in this * container. @@ -1205,7 +1205,7 @@ class Commands { * executed. * @since 0.2.0 */ - void add_command(const flash_string_vector & name, const flash_string_vector & arguments, command_function function); + void add_command(const string_vector & name, const string_vector & arguments, command_function function); /** * Add a command with arguments and automatic argument completion * to the list of commands in this container. @@ -1224,7 +1224,7 @@ class Commands { * completions for this command. * @since 0.2.0 */ - void add_command(const flash_string_vector & name, const flash_string_vector & arguments, command_function function, argument_completion_function arg_function); + void add_command(const string_vector & name, const string_vector & arguments, command_function function, argument_completion_function arg_function); /** * Add a command with no arguments to the list of commands in this * container. @@ -1239,7 +1239,7 @@ class Commands { * executed. * @since 0.1.0 */ - void add_command(unsigned int context, unsigned int flags, const flash_string_vector & name, command_function function); + void add_command(unsigned int context, unsigned int flags, const string_vector & name, command_function function); /** * Add a command with arguments to the list of commands in this * container. @@ -1257,7 +1257,7 @@ class Commands { * executed. * @since 0.1.0 */ - void add_command(unsigned int context, unsigned int flags, const flash_string_vector & name, const flash_string_vector & arguments, command_function function); + void add_command(unsigned int context, unsigned int flags, const string_vector & name, const string_vector & arguments, command_function function); /** * Add a command with arguments and automatic argument completion * to the list of commands in this container. @@ -1279,8 +1279,8 @@ class Commands { */ void add_command(unsigned int context, unsigned int flags, - const flash_string_vector & name, - const flash_string_vector & arguments, + const string_vector & name, + const string_vector & arguments, command_function function, argument_completion_function arg_function); @@ -1345,8 +1345,8 @@ class Commands { * @since 0.1.0 */ Command(unsigned int flags, - const flash_string_vector name, - const flash_string_vector arguments, + const string_vector name, + const string_vector arguments, command_function function, argument_completion_function arg_function); ~Command(); @@ -1372,8 +1372,8 @@ class Commands { } unsigned int flags_; /*!< Shell flags that must be set for this command to be available. @since 0.1.0 */ - const flash_string_vector name_; /*!< Name of the command as a std::vector of flash strings. @since 0.1.0 */ - const flash_string_vector arguments_; /*!< Help text for arguments that the command accepts as a std::vector of flash strings. @since 0.1.0 */ + const string_vector name_; /*!< Name of the command as a std::vector of flash strings. @since 0.1.0 */ + const string_vector arguments_; /*!< Help text for arguments that the command accepts as a std::vector of flash strings. @since 0.1.0 */ command_function function_; /*!< Function to be used when the command is executed. @since 0.1.0 */ argument_completion_function arg_function_; /*!< Function to be used to perform argument completions for this command. @since 0.1.0 */ diff --git a/lib/uuid-log/src/format_level_lowercase.cpp b/lib/uuid-log/src/format_level_lowercase.cpp index 03b386a13..159b24072 100644 --- a/lib/uuid-log/src/format_level_lowercase.cpp +++ b/lib/uuid-log/src/format_level_lowercase.cpp @@ -26,17 +26,17 @@ namespace uuid { namespace log { -static constexpr const char * pstr_level_lowercase_off __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "off"; -static constexpr const char * pstr_level_lowercase_emerg __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "emerg"; -static constexpr const char * pstr_level_lowercase_crit __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "crit"; -static constexpr const char * pstr_level_lowercase_alert __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "alert"; -static constexpr const char * pstr_level_lowercase_err __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "err"; -static constexpr const char * pstr_level_lowercase_warning __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "warning"; -static constexpr const char * pstr_level_lowercase_notice __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "notice"; -static constexpr const char * pstr_level_lowercase_info __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "info"; -static constexpr const char * pstr_level_lowercase_debug __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "debug"; -static constexpr const char * pstr_level_lowercase_trace __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "trace"; -static constexpr const char * pstr_level_lowercase_all __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "all"; +static constexpr const char * pstr_level_lowercase_off = "off"; +static constexpr const char * pstr_level_lowercase_emerg = "emerg"; +static constexpr const char * pstr_level_lowercase_crit = "crit"; +static constexpr const char * pstr_level_lowercase_alert = "alert"; +static constexpr const char * pstr_level_lowercase_err = "err"; +static constexpr const char * pstr_level_lowercase_warning = "warning"; +static constexpr const char * pstr_level_lowercase_notice = "notice"; +static constexpr const char * pstr_level_lowercase_info = "info"; +static constexpr const char * pstr_level_lowercase_debug = "debug"; +static constexpr const char * pstr_level_lowercase_trace = "trace"; +static constexpr const char * pstr_level_lowercase_all = "all"; static const __FlashStringHelper * log_level_lowercase[(int)Level::ALL - (int)Level::OFF + 1] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = {reinterpret_cast(pstr_level_lowercase_off), diff --git a/lib/uuid-log/src/format_level_uppercase.cpp b/lib/uuid-log/src/format_level_uppercase.cpp index ca0d66677..259ea3dc3 100644 --- a/lib/uuid-log/src/format_level_uppercase.cpp +++ b/lib/uuid-log/src/format_level_uppercase.cpp @@ -26,17 +26,17 @@ namespace uuid { namespace log { -static constexpr const char * pstr_level_uppercase_off __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "OFF"; -static constexpr const char * pstr_level_uppercase_emerg __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "EMERG"; -static constexpr const char * pstr_level_uppercase_crit __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "CRIT"; -static constexpr const char * pstr_level_uppercase_alert __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "ALERT"; -static constexpr const char * pstr_level_uppercase_err __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "ERR"; -static constexpr const char * pstr_level_uppercase_warning __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "WARNING"; -static constexpr const char * pstr_level_uppercase_notice __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "NOTICE"; -static constexpr const char * pstr_level_uppercase_info __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "INFO"; -static constexpr const char * pstr_level_uppercase_debug __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "DEBUG"; -static constexpr const char * pstr_level_uppercase_trace __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "TRACE"; -static constexpr const char * pstr_level_uppercase_all __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "ALL"; +static constexpr const char * pstr_level_uppercase_off = "OFF"; +static constexpr const char * pstr_level_uppercase_emerg = "EMERG"; +static constexpr const char * pstr_level_uppercase_crit = "CRIT"; +static constexpr const char * pstr_level_uppercase_alert = "ALERT"; +static constexpr const char * pstr_level_uppercase_err = "ERR"; +static constexpr const char * pstr_level_uppercase_warning = "WARNING"; +static constexpr const char * pstr_level_uppercase_notice = "NOTICE"; +static constexpr const char * pstr_level_uppercase_info = "INFO"; +static constexpr const char * pstr_level_uppercase_debug = "DEBUG"; +static constexpr const char * pstr_level_uppercase_trace = "TRACE"; +static constexpr const char * pstr_level_uppercase_all = "ALL"; static const __FlashStringHelper * log_level_uppercase[(int)Level::ALL - (int)Level::OFF + 1] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = {reinterpret_cast(pstr_level_uppercase_off), diff --git a/lib/uuid-log/src/format_timestamp_ms.cpp b/lib/uuid-log/src/format_timestamp_ms.cpp index 0c59c1ffa..3169980ca 100644 --- a/lib/uuid-log/src/format_timestamp_ms.cpp +++ b/lib/uuid-log/src/format_timestamp_ms.cpp @@ -47,7 +47,7 @@ std::string format_timestamp_ms(uint64_t timestamp_ms, unsigned int days_width) static std::vector text(10 + 1 /* days */ + 2 + 1 /* hours */ + 2 + 1 /* minutes */ + 2 + 1 /* seconds */ + 3 /* milliseconds */ + 1); - snprintf_P(text.data(), text.size(), PSTR("%0*lu+%02u:%02u:%02u.%03u"), std::min(days_width, 10U), days, hours, minutes, seconds, milliseconds); + snprintf(text.data(), text.size(), ("%0*lu+%02u:%02u:%02u.%03u"), std::min(days_width, 10U), days, hours, minutes, seconds, milliseconds); return text.data(); } diff --git a/lib/uuid-log/src/log.cpp b/lib/uuid-log/src/log.cpp index 72ca20e76..3b0fd926a 100644 --- a/lib/uuid-log/src/log.cpp +++ b/lib/uuid-log/src/log.cpp @@ -36,7 +36,7 @@ namespace log { std::map Logger::handlers_; Level Logger::level_ = Level::OFF; -Message::Message(uint64_t uptime_ms, Level level, Facility facility, const __FlashStringHelper * name, const std::string && text) +Message::Message(uint64_t uptime_ms, Level level, Facility facility, const char * name, const std::string && text) : uptime_ms(uptime_ms) , level(level) , facility(facility) @@ -44,7 +44,7 @@ Message::Message(uint64_t uptime_ms, Level level, Facility facility, const __Fla , text(std::move(text)) { } -Logger::Logger(const __FlashStringHelper * name, Facility facility) +Logger::Logger(const char * name, Facility facility) : name_(name) , facility_(facility){ diff --git a/lib/uuid-log/src/uuid/log.h b/lib/uuid-log/src/uuid/log.h index a0dba494d..956e4615f 100644 --- a/lib/uuid-log/src/uuid/log.h +++ b/lib/uuid-log/src/uuid/log.h @@ -231,7 +231,7 @@ struct Message { * @param[in] text Log message text. * @since 1.0.0 */ - Message(uint64_t uptime_ms, Level level, Facility facility, const __FlashStringHelper * name, const std::string && text); + Message(uint64_t uptime_ms, Level level, Facility facility, const char * name, const std::string && text); ~Message() = default; /** @@ -261,7 +261,7 @@ struct Message { * * @since 1.0.0 */ - const __FlashStringHelper * name; + const char * name; /** * Formatted log message text. @@ -331,7 +331,7 @@ class Logger { * * @since 1.0.0 */ - Logger(const __FlashStringHelper * name, Facility facility = Facility::LOCAL0); + Logger(const char * name, Facility facility = Facility::LOCAL0); ~Logger() = default; /** @@ -626,7 +626,7 @@ class Logger { static std::map handlers_; /*!< Registered log handlers. @since 1.0.0 */ static Level level_; /*!< Minimum global log level across all handlers. @since 1.0.0 */ - const __FlashStringHelper * name_; /*!< Logger name (flash string). @since 1.0.0 */ + const char * name_; /*!< Logger name (flash string). @since 1.0.0 */ const Facility facility_; /*!< Default logging facility for messages. @since 1.0.0 */ }; diff --git a/lib/uuid-syslog/src/syslog.cpp b/lib/uuid-syslog/src/syslog.cpp index 7f2c28b5a..2d9bcd4e8 100644 --- a/lib/uuid-syslog/src/syslog.cpp +++ b/lib/uuid-syslog/src/syslog.cpp @@ -82,13 +82,13 @@ #include #include -static const char __pstr__logger_name[] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "syslog"; +static const char __pstr__logger_name[] = "syslog"; namespace uuid { namespace syslog { -uuid::log::Logger SyslogService::logger_{FPSTR(__pstr__logger_name), uuid::log::Facility::SYSLOG}; +uuid::log::Logger SyslogService::logger_{__pstr__logger_name, uuid::log::Facility::SYSLOG}; bool SyslogService::QueuedLogMessage::time_good_ = false; SyslogService::~SyslogService() { @@ -116,7 +116,7 @@ void SyslogService::remove_queued_messages(uuid::log::Level level) { } } - log_message_id_ -= offset; + log_message_id_ -= offset; log_message_fails_ += offset; } @@ -269,8 +269,8 @@ void SyslogService::loop() { operator<<(std::make_shared(uuid::get_uptime_ms(), uuid::log::Level::INFO, uuid::log::Facility::SYSLOG, - reinterpret_cast(__pstr__logger_name), - uuid::read_flash_string(F("-- MARK --")))); + (__pstr__logger_name), + (F("-- MARK --")))); } } } @@ -443,7 +443,8 @@ bool SyslogService::transmit(const QueuedLogMessage & message) { udp_.print('-'); } - udp_.printf_P(PSTR(" %s %s - - - "), hostname_.c_str(), uuid::read_flash_string(message.content_->name).c_str()); + // TODO should use flash? + udp_.printf_P(PSTR(" %s %s - - - "), hostname_.c_str(), (message.content_->name)); char id_c_str[15]; snprintf_P(id_c_str, sizeof(id_c_str), PSTR(" %lu: "), message.id_); diff --git a/lib/uuid-telnet/src/telnet.cpp b/lib/uuid-telnet/src/telnet.cpp index a1fc74a59..e40bc51d9 100644 --- a/lib/uuid-telnet/src/telnet.cpp +++ b/lib/uuid-telnet/src/telnet.cpp @@ -54,22 +54,20 @@ #endif #endif -static const char __pstr__logger_name[] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = "telnet"; - namespace uuid { namespace telnet { -uuid::log::Logger TelnetService::logger_{FPSTR(__pstr__logger_name), uuid::log::Facility::DAEMON}; +uuid::log::Logger TelnetService::logger_{"telnet", uuid::log::Facility::DAEMON}; TelnetService::TelnetService(std::shared_ptr commands, unsigned int context, unsigned int flags) : TelnetService(DEFAULT_PORT, commands, context, flags) { } TelnetService::TelnetService(uint16_t port, std::shared_ptr commands, unsigned int context, unsigned int flags) - : TelnetService(port, [commands, context, flags](Stream & stream, const IPAddress & addr __attribute__((unused)), uint16_t port __attribute__((unused))) -> std::shared_ptr { - return std::make_shared(commands, stream, context, flags); - }) { + : TelnetService(port, + [commands, context, flags](Stream & stream, const IPAddress & addr __attribute__((unused)), uint16_t port __attribute__((unused))) + -> std::shared_ptr { return std::make_shared(commands, stream, context, flags); }) { } TelnetService::TelnetService(shell_factory_function shell_factory) @@ -145,7 +143,9 @@ void TelnetService::loop() { if (client) { if (connections_.size() >= maximum_connections_) { #if UUID_TELNET_HAVE_WIFICLIENT_REMOTE - logger_.info(F("New connection from [%s]:%u rejected (connection limit reached)"), uuid::printable_to_string(client.remoteIP()).c_str(), client.remotePort()); + logger_.info(F("New connection from [%s]:%u rejected (connection limit reached)"), + uuid::printable_to_string(client.remoteIP()).c_str(), + client.remotePort()); #else logger_.info(F("New connection rejected (connection limit reached)")); #endif diff --git a/lib_standalone/Arduino.h b/lib_standalone/Arduino.h index 85a750400..9f12a6f9b 100644 --- a/lib_standalone/Arduino.h +++ b/lib_standalone/Arduino.h @@ -68,11 +68,10 @@ void ledcWrite(uint8_t chan, uint32_t duty); #define PROGMEM #define PGM_P const char * -#define PSTR(s) s class __FlashStringHelper; #define FPSTR(string_literal) (reinterpret_cast(string_literal)) -#define F(string_literal) (FPSTR(PSTR(string_literal))) +#define F(string_literal) (FPSTR((string_literal))) int snprintf_P(char * str, size_t size, const char * format, ...); int vsnprintf_P(char * str, size_t size, const char * format, va_list ap); @@ -97,7 +96,7 @@ class Print { virtual size_t write(uint8_t c) = 0; virtual size_t write(const uint8_t * buffer, size_t size) = 0; size_t print(char c) { - return write((uint8_t)c); + return write((uint8_t)c); } size_t print(const char * data) { return write(reinterpret_cast(data), strlen(data)); diff --git a/src/analogsensor.cpp b/src/analogsensor.cpp index 7d066cc33..531e7a339 100644 --- a/src/analogsensor.cpp +++ b/src/analogsensor.cpp @@ -32,7 +32,7 @@ void AnalogSensor::start() { analogSetAttenuation(ADC_2_5db); // for all channels 1.5V - LOG_INFO(F("Starting Analog sensor service")); + LOG_INFO(("Starting Analog sensor service")); // Add API call for /info Command::add( @@ -44,7 +44,7 @@ void AnalogSensor::start() { EMSdevice::DeviceType::ANALOGSENSOR, F_(setvalue), [&](const char * value, const int8_t id) { return command_setvalue(value, id); }, - F("set io value"), // TODO this needs translating + ("set io value"), // TODO translate this CommandFlag::ADMIN_ONLY); Command::add( EMSdevice::DeviceType::ANALOGSENSOR, @@ -123,12 +123,12 @@ void AnalogSensor::reload() { for (auto & sensor : sensors_) { sensor.ha_registered = false; // force HA configs to be re-created if (sensor.type() == AnalogType::ADC) { - LOG_DEBUG(F("Adding analog ADC sensor on GPIO%d"), sensor.gpio()); + LOG_DEBUG(("Adding analog ADC sensor on GPIO%d"), sensor.gpio()); // analogSetPinAttenuation does not work with analogReadMilliVolts sensor.analog_ = 0; // initialize sensor.last_reading_ = 0; } else if (sensor.type() == AnalogType::COUNTER) { - LOG_DEBUG(F("Adding analog I/O Counter sensor on GPIO%d"), sensor.gpio()); + LOG_DEBUG(("Adding analog I/O Counter sensor on GPIO%d"), sensor.gpio()); pinMode(sensor.gpio(), INPUT_PULLUP); #ifndef ARDUINO_LOLIN_C3_MINI if (sensor.gpio() == 25 || sensor.gpio() == 26) { @@ -139,7 +139,7 @@ void AnalogSensor::reload() { sensor.poll_ = digitalRead(sensor.gpio()); publish_sensor(sensor); } else if (sensor.type() == AnalogType::TIMER || sensor.type() == AnalogType::RATE) { - LOG_DEBUG(F("Adding analog Timer/Rate sensor on GPIO%d"), sensor.gpio()); + LOG_DEBUG(("Adding analog Timer/Rate sensor on GPIO%d"), sensor.gpio()); pinMode(sensor.gpio(), INPUT_PULLUP); sensor.polltime_ = uuid::get_uptime(); sensor.last_polltime_ = uuid::get_uptime(); @@ -148,7 +148,7 @@ void AnalogSensor::reload() { sensor.set_value(0); publish_sensor(sensor); } else if (sensor.type() == AnalogType::DIGITAL_IN) { - LOG_DEBUG(F("Adding analog Read sensor on GPIO%d"), sensor.gpio()); + LOG_DEBUG(("Adding analog Read sensor on GPIO%d"), sensor.gpio()); pinMode(sensor.gpio(), INPUT_PULLUP); sensor.set_value(digitalRead(sensor.gpio())); // initial value sensor.set_uom(0); // no uom, just for safe measures @@ -156,7 +156,7 @@ void AnalogSensor::reload() { sensor.poll_ = digitalRead(sensor.gpio()); publish_sensor(sensor); } else if (sensor.type() == AnalogType::DIGITAL_OUT) { - LOG_DEBUG(F("Adding analog Write sensor on GPIO%d"), sensor.gpio()); + LOG_DEBUG(("Adding analog Write sensor on GPIO%d"), sensor.gpio()); pinMode(sensor.gpio(), OUTPUT); if (sensor.gpio() == 25 || sensor.gpio() == 26) { if (sensor.offset() > 255) { @@ -175,7 +175,7 @@ void AnalogSensor::reload() { sensor.set_uom(0); // no uom, just for safe measures publish_sensor(sensor); } else if (sensor.type() >= AnalogType::PWM_0) { - LOG_DEBUG(F("Adding PWM output sensor on GPIO%d"), sensor.gpio()); + LOG_DEBUG(("Adding PWM output sensor on GPIO%d"), sensor.gpio()); uint channel = sensor.type() - AnalogType::PWM_0; ledcSetup(channel, sensor.factor(), 13); ledcAttachPin(sensor.gpio(), channel); @@ -277,7 +277,7 @@ bool AnalogSensor::update(uint8_t gpio, const std::string & name, float offset, found_sensor = true; // found the record // see if it's marked for deletion if (type == AnalogType::MARK_DELETED) { - LOG_DEBUG(F("Removing analog sensor GPIO %d"), gpio); + LOG_DEBUG(("Removing analog sensor GPIO %d"), gpio); settings.analogCustomizations.remove(AnalogCustomization); } else { // update existing record @@ -286,7 +286,7 @@ bool AnalogSensor::update(uint8_t gpio, const std::string & name, float offset, AnalogCustomization.factor = factor; AnalogCustomization.uom = uom; AnalogCustomization.type = type; - LOG_DEBUG(F("Customizing existing analog GPIO %d"), gpio); + LOG_DEBUG(("Customizing existing analog GPIO %d"), gpio); } return StateUpdateResult::CHANGED; // persist the change } @@ -312,7 +312,7 @@ bool AnalogSensor::update(uint8_t gpio, const std::string & name, float offset, newSensor.uom = uom; newSensor.type = type; settings.analogCustomizations.push_back(newSensor); - LOG_DEBUG(F("Adding new customization for analog sensor GPIO %d"), gpio); + LOG_DEBUG(("Adding new customization for analog sensor GPIO %d"), gpio); return StateUpdateResult::CHANGED; // persist the change }, "local"); @@ -338,9 +338,9 @@ void AnalogSensor::publish_sensor(const Sensor & sensor) const { if (Mqtt::publish_single()) { char topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; if (Mqtt::publish_single2cmd()) { - snprintf(topic, sizeof(topic), "%s/%s", read_flash_string(F_(analogsensor)).c_str(), sensor.name().c_str()); + snprintf(topic, sizeof(topic), "%s/%s", (F_(analogsensor)), sensor.name().c_str()); } else { - snprintf(topic, sizeof(topic), "%s%s/%s", read_flash_string(F_(analogsensor)).c_str(), "_data", sensor.name().c_str()); + snprintf(topic, sizeof(topic), "%s%s/%s", (F_(analogsensor)), "_data", sensor.name().c_str()); } char payload[10]; Mqtt::publish(topic, Helpers::render_value(payload, sensor.value(), 2)); // always publish as floats @@ -353,7 +353,7 @@ void AnalogSensor::remove_ha_topic(const uint8_t gpio) const { return; } #ifdef EMSESP_DEBUG - LOG_DEBUG(F("Removing HA config for analog sensor GPIO %d"), gpio); + LOG_DEBUG(("Removing HA config for analog sensor GPIO %d"), gpio); #endif char topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; snprintf(topic, sizeof(topic), "sensor/%s/analogsensor_%d/config", Mqtt::basename().c_str(), gpio); @@ -403,7 +403,7 @@ void AnalogSensor::publish_values(const bool force) { // create HA config if (Mqtt::ha_enabled() && (!sensor.ha_registered || force)) { - LOG_DEBUG(F("Recreating HA config for analog sensor GPIO %d"), sensor.gpio()); + LOG_DEBUG(("Recreating HA config for analog sensor GPIO %d"), sensor.gpio()); StaticJsonDocument config; @@ -447,7 +447,7 @@ void AnalogSensor::publish_values(const bool force) { } } - Mqtt::publish(F("analogsensor_data"), doc.as()); + Mqtt::publish(("analogsensor_data"), doc.as()); } // called from emsesp.cpp, similar to the emsdevice->get_value_info diff --git a/src/command.cpp b/src/command.cpp index cae119bec..277c6135e 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -82,7 +82,7 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec // validate the device, make sure it exists uint8_t device_type = EMSdevice::device_name_2_device_type(device_s); if (!device_has_commands(device_type)) { - LOG_DEBUG(F("Command failed: unknown device '%s'"), device_s); + LOG_DEBUG(("Command failed: unknown device '%s'"), device_s); return message(CommandRet::ERROR, "unknown device", output); } @@ -170,15 +170,15 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec std::string Command::return_code_string(const uint8_t return_code) { switch (return_code) { case CommandRet::ERROR: - return read_flash_string(F("Error")); + return ("Error"); case CommandRet::OK: - return read_flash_string(F("OK")); + return ("OK"); case CommandRet::NOT_FOUND: - return read_flash_string(F("Not Found")); + return ("Not Found"); case CommandRet::NOT_ALLOWED: - return read_flash_string(F("Not Authorized")); + return ("Not Authorized"); case CommandRet::FAIL: - return read_flash_string(F("Failed")); + return ("Failed"); default: break; } @@ -248,7 +248,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char * if ((device_type > EMSdevice::DeviceType::SYSTEM) && (!value || !strlen(value))) { if (!cf || !cf->cmdfunction_json_) { #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] Calling %s command '%s' to retrieve attributes"), dname.c_str(), cmd); + LOG_DEBUG(("[DEBUG] Calling %s command '%s' to retrieve attributes"), dname.c_str(), cmd); #endif return EMSESP::get_device_value_info(output, cmd, id, device_type) ? CommandRet::OK : CommandRet::ERROR; // entity = cmd } @@ -264,15 +264,15 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char * if ((value == nullptr) || (strlen(value) == 0)) { if (EMSESP::system_.readonly_mode()) { - LOG_INFO(F("[readonly] Calling command '%s/%s' (%s)"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str()); + LOG_INFO(("[readonly] Calling command '%s/%s' (%s)"), dname.c_str(), cmd, cf->description_); } else { - LOG_DEBUG(F("Calling command '%s/%s' (%s)"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str()); + LOG_DEBUG(("Calling command '%s/%s' (%s)"), dname.c_str(), cmd, (cf->description_)); } } else { if (EMSESP::system_.readonly_mode()) { - LOG_INFO(F("[readonly] Calling command '%s/%s' (%s) with value %s"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str(), value); + LOG_INFO(("[readonly] Calling command '%s/%s' (%s) with value %s"), dname.c_str(), cmd, cf->description_, value); } else { - LOG_DEBUG(F("Calling command '%s/%s' (%s) with value %s"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str(), value); + LOG_DEBUG(("Calling command '%s/%s' (%s) with value %s"), dname.c_str(), cmd, (cf->description_), value); } } @@ -294,14 +294,14 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char * } // we didn't find the command and its not an endpoint, report error - LOG_DEBUG(F("Command failed: invalid command '%s'"), cmd); + LOG_DEBUG(("Command failed: invalid command '%s'"), cmd); return message(CommandRet::NOT_FOUND, "invalid command", output); } // add a command to the list, which does not return json -void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, const cmd_function_p cb, const __FlashStringHelper * description, uint8_t flags) { +void Command::add(const uint8_t device_type, const char * cmd, const cmd_function_p cb, const char * description, uint8_t flags) { // if the command already exists for that device type don't add it - if (find_command(device_type, read_flash_string(cmd).c_str()) != nullptr) { + if (find_command(device_type, cmd) != nullptr) { return; } @@ -314,9 +314,9 @@ void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, co } // add a command to the list, which does return a json object as output -void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, const cmd_json_function_p cb, const __FlashStringHelper * description, uint8_t flags) { +void Command::add(const uint8_t device_type, const char * cmd, const cmd_json_function_p cb, const char * description, uint8_t flags) { // if the command already exists for that device type don't add it - if (find_command(device_type, read_flash_string(cmd).c_str()) != nullptr) { + if (find_command(device_type, cmd) != nullptr) { return; } @@ -338,7 +338,7 @@ Command::CmdFunction * Command::find_command(const uint8_t device_type, const ch } for (auto & cf : cmdfunctions_) { - if (!strcmp(lowerCmd, Helpers::toLower(read_flash_string(cf.cmd_)).c_str()) && (cf.device_type_ == device_type)) { + if (!strcmp(lowerCmd, cf.cmd_) && (cf.device_type_ == device_type)) { return &cf; } } @@ -357,14 +357,14 @@ bool Command::list(const uint8_t device_type, JsonObject & output) { std::list sorted_cmds; for (const auto & cf : cmdfunctions_) { if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN)) { - sorted_cmds.push_back(read_flash_string(cf.cmd_)); + sorted_cmds.push_back((cf.cmd_)); } } sorted_cmds.sort(); for (const auto & cl : sorted_cmds) { for (const auto & cf : cmdfunctions_) { - if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == read_flash_string(cf.cmd_))) { + if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == std::string(cf.cmd_))) { output[cl] = cf.description_; } } @@ -376,7 +376,7 @@ bool Command::list(const uint8_t device_type, JsonObject & output) { // output list of all commands to console for a specific DeviceType void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbose) { if (cmdfunctions_.empty()) { - shell.println(F("No commands available")); + shell.println(("No commands available")); return; } @@ -384,7 +384,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo std::list sorted_cmds; for (const auto & cf : cmdfunctions_) { if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN)) { - sorted_cmds.push_back(read_flash_string(cf.cmd_)); + sorted_cmds.push_back((cf.cmd_)); } } sorted_cmds.sort(); @@ -404,7 +404,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo for (const auto & cl : sorted_cmds) { // find and print the description for (const auto & cf : cmdfunctions_) { - if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == read_flash_string(cf.cmd_))) { + if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == std::string(cf.cmd_))) { uint8_t i = cl.length(); shell.print(" "); if (cf.has_flags(MQTT_SUB_FLAG_HC)) { @@ -424,7 +424,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo shell.print(EMSdevice::tag_to_string(DeviceValueTAG::TAG_DEVICE_DATA_WW)); shell.print(' '); } - shell.print(read_flash_string(cf.description_).c_str()); + shell.print((cf.description_)); if (!cf.has_flags(CommandFlag::ADMIN_ONLY)) { shell.print(' '); shell.print(COLOR_BRIGHT_RED); @@ -497,7 +497,7 @@ void Command::show_devices(uuid::console::Shell & shell) { // output list of all commands to console // calls show with verbose mode set void Command::show_all(uuid::console::Shell & shell) { - shell.println(F("Available commands (*=do not need authorization): ")); + shell.println(("Available commands (*=do not need authorization): ")); // show system first shell.print(COLOR_BOLD_ON); diff --git a/src/command.h b/src/command.h index e12eab87a..8fe24a8b8 100644 --- a/src/command.h +++ b/src/command.h @@ -54,19 +54,19 @@ using cmd_json_function_p = std::function; #ifdef FPSTR #undef FPSTR @@ -40,20 +40,14 @@ using uuid::read_flash_string; // clang-format off -#define MAKE_STR(string_name, string_literal) static constexpr const char * __str__##string_name = string_literal; - -#define FPSTR(pstr_pointer) (reinterpret_cast(pstr_pointer)) -#define F_(string_name) FPSTR(__pstr__##string_name) - +#define FPSTR(pstr_pointer) pstr_pointer #define MAKE_PSTR(string_name, string_literal) static const char __pstr__##string_name[] = string_literal; #define MAKE_PSTR_WORD(string_name) MAKE_PSTR(string_name, #string_name) +#define F_(string_name) (__pstr__##string_name) #define FL_(list_name) (__pstr__L_##list_name) -#define MAKE_PSTR_LIST(list_name, ...) static const __FlashStringHelper * const __pstr__L_##list_name[] = {__VA_ARGS__, nullptr}; -#define MAKE_PSTR_ENUM(enum_name, ...) static const __FlashStringHelper * const * __pstr__L_##enum_name[] = {__VA_ARGS__, nullptr}; - -// #define MAKE_PSTR_LIST2(list_name, ...) static const char * const __pstr__L_##list_name2[] = {__VA_ARGS__, nullptr}; - +#define MAKE_PSTR_LIST(list_name, ...) static const char * const __pstr__L_##list_name[] = {__VA_ARGS__, nullptr}; +#define MAKE_PSTR_ENUM(enum_name, ...) static const char * const * __pstr__L_##enum_name[] = {__VA_ARGS__, nullptr}; // clang-format on diff --git a/src/console.cpp b/src/console.cpp index afce647ab..18880809e 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -45,26 +45,26 @@ EMSESPShell::EMSESPShell() } void EMSESPShell::started() { - logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, F("User session opened on console %s"), console_name().c_str()); + logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, ("User session opened on console %s"), console_name().c_str()); } void EMSESPShell::stopped() { if (has_flags(CommandFlags::ADMIN)) { - logger().log(LogLevel::DEBUG, LogFacility::AUTH, F("su session closed on console %s"), console_name().c_str()); + logger().log(LogLevel::DEBUG, LogFacility::AUTH, ("su session closed on console %s"), console_name().c_str()); } - logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, F("User session closed on console %s"), console_name().c_str()); + logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, ("User session closed on console %s"), console_name().c_str()); } // show welcome banner // this is one of the first functions called when the shell is started void EMSESPShell::display_banner() { println(); - printfln(F("┌──────────────────────────────────────┐")); - printfln(F("│ %sEMS-ESP version %-10s%s │"), COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF); - printfln(F("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │"), COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET); - printfln(F("│ │")); - printfln(F("│ type %shelp%s to show available commands │"), COLOR_UNDERLINE, COLOR_RESET); - printfln(F("└──────────────────────────────────────┘")); + printfln(("┌──────────────────────────────────────┐")); + printfln(("│ %sEMS-ESP version %-10s%s │"), COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF); + printfln(("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │"), COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET); + printfln(("│ │")); + printfln(("│ type %shelp%s to show available commands │"), COLOR_UNDERLINE, COLOR_RESET); + printfln(("└──────────────────────────────────────┘")); println(); // set console name @@ -100,9 +100,9 @@ void EMSESPShell::add_console_commands() { commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(show)}, + string_vector{F_(show)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { - shell.printfln(F("%s%sEMS-ESP version %s%s"), COLOR_BRIGHT_GREEN, COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_RESET); + shell.printfln(("%s%sEMS-ESP version %s%s"), COLOR_BRIGHT_GREEN, COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_RESET); shell.println(); EMSESP::show_device_values(shell); EMSESP::show_sensor_values(shell); @@ -110,36 +110,36 @@ void EMSESPShell::add_console_commands() { commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(show), F_(devices)}, + string_vector{F_(show), F_(devices)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { EMSESP::show_devices(shell); }); commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(show), F_(ems)}, + string_vector{F_(show), F_(ems)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { EMSESP::show_ems(shell); }); commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(show), F_(values)}, + string_vector{F_(show), F_(values)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { EMSESP::show_device_values(shell); }); commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(show), F_(mqtt)}, + string_vector{F_(show), F_(mqtt)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { Mqtt::show_mqtt(shell); }); commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(show), F_(commands)}, + string_vector{F_(show), F_(commands)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { Command::show_all(shell); }); commands->add_command( ShellContext::MAIN, CommandFlags::ADMIN, - flash_string_vector{F_(set), F_(bus_id)}, - flash_string_vector{F_(deviceid_mandatory)}, + string_vector{F_(set), F_(bus_id)}, + string_vector{F_(deviceid_mandatory)}, [](Shell & shell, const std::vector & arguments) { uint8_t device_id = Helpers::hextoint(arguments.front().c_str()); if ((device_id == 0x0B) || (device_id == 0x0D) || (device_id == 0x0A) || (device_id == 0x0F) || (device_id == 0x12)) { @@ -151,24 +151,24 @@ void EMSESPShell::add_console_commands() { }, "local"); } else { - shell.println(F("Must be 0B, 0D, 0A, 0F or 12")); + shell.println(("Must be 0B, 0D, 0A, 0F or 12")); } }, [](Shell & shell __attribute__((unused)), const std::vector & arguments __attribute__((unused))) -> const std::vector { return std::vector{ - read_flash_string(F("0B")), - read_flash_string(F("0D")), - read_flash_string(F("0A")), - read_flash_string(F("0F")), - read_flash_string(F("12")), + (("0B")), + (("0D")), + (("0A")), + (("0F")), + (("12")), }; }); commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, - flash_string_vector{F_(set), F_(tx_mode)}, - flash_string_vector{F_(n_mandatory)}, + string_vector{F_(set), F_(tx_mode)}, + string_vector{F_(n_mandatory)}, [](Shell & shell, const std::vector & arguments) { uint8_t tx_mode = std::strtol(arguments[0].c_str(), nullptr, 10); // save the tx_mode @@ -183,13 +183,13 @@ void EMSESPShell::add_console_commands() { commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, - flash_string_vector{F_(scan), F_(devices)}, - flash_string_vector{F_(deep_optional)}, + string_vector{F_(scan), F_(devices)}, + string_vector{F_(deep_optional)}, [](Shell & shell, const std::vector & arguments) { if (arguments.size() == 0) { EMSESP::scan_devices(); } else { - shell.printfln(F("Performing a deep scan...")); + shell.printfln(("Performing a deep scan...")); EMSESP::clear_all_devices(); std::vector Device_Ids; @@ -222,10 +222,10 @@ void EMSESPShell::add_console_commands() { commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(set)}, + string_vector{F_(set)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { EMSESP::webSettingsService.read([&](WebSettings & settings) { - shell.printfln(F("Language: %s"), settings.locale.c_str()); + shell.printfln(("Language: %s"), settings.locale.c_str()); shell.printfln(F_(tx_mode_fmt), settings.tx_mode); shell.printfln(F_(bus_id_fmt), settings.ems_bus_id); shell.printfln(F_(board_profile_fmt), settings.board_profile.c_str()); @@ -234,13 +234,13 @@ void EMSESPShell::add_console_commands() { commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(read)}, - flash_string_vector{F_(deviceid_mandatory), F_(typeid_mandatory), F_(offset_optional), F_(length_optional)}, + string_vector{F_(read)}, + string_vector{F_(deviceid_mandatory), F_(typeid_mandatory), F_(offset_optional), F_(length_optional)}, [=](Shell & shell __attribute__((unused)), const std::vector & arguments) { uint8_t device_id = Helpers::hextoint(arguments.front().c_str()); if (!EMSESP::valid_device(device_id)) { - shell.printfln(F("Invalid deviceID")); + shell.printfln(("Invalid deviceID")); return; } @@ -261,31 +261,31 @@ void EMSESPShell::add_console_commands() { #ifndef EMSESP_STANDALONE commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(set), F_(timeout)}, - flash_string_vector{F_(n_mandatory)}, + string_vector{F_(set), F_(timeout)}, + string_vector{F_(n_mandatory)}, [](Shell & shell, const std::vector & arguments) { uint16_t value = Helpers::atoint(arguments.front().c_str()); telnet_.initial_idle_timeout(value * 60); - shell.printfln(F("Telnet timeout set to %d minutes"), value); + shell.printfln(("Telnet timeout set to %d minutes"), value); }); #endif commands->add_command(ShellContext::MAIN, CommandFlags::USER, - flash_string_vector{F_(watch)}, - flash_string_vector{F_(watch_format_optional), F_(watchid_optional)}, + string_vector{F_(watch)}, + string_vector{F_(watch_format_optional), F_(watchid_optional)}, [](Shell & shell, const std::vector & arguments) { uint16_t watch_id = WATCH_ID_NONE; if (!arguments.empty()) { // get raw/pretty - if (arguments[0] == read_flash_string(F_(raw))) { + if (arguments[0] == (F_(raw))) { EMSESP::watch(EMSESP::WATCH_RAW); // raw - } else if (arguments[0] == Helpers::translated_word(FL_(on), true) || arguments[0] == read_flash_string(FL_(on)[0])) { + } else if (arguments[0] == Helpers::translated_word(FL_(on), true) || arguments[0] == (FL_(on)[0])) { EMSESP::watch(EMSESP::WATCH_ON); // on - } else if (arguments[0] == Helpers::translated_word(FL_(off), true) || arguments[0] == read_flash_string(FL_(off)[0])) { + } else if (arguments[0] == Helpers::translated_word(FL_(off), true) || arguments[0] == (FL_(off)[0])) { EMSESP::watch(EMSESP::WATCH_OFF); // off - } else if (arguments[0] == Helpers::translated_word(FL_(unknown), true) || arguments[0] == read_flash_string(FL_(unknown)[0])) { + } else if (arguments[0] == Helpers::translated_word(FL_(unknown), true) || arguments[0] == (FL_(unknown)[0])) { EMSESP::watch(EMSESP::WATCH_UNKNOWN); // unknown watch_id = WATCH_ID_NONE; } else { @@ -305,43 +305,43 @@ void EMSESPShell::add_console_commands() { EMSESP::watch_id(watch_id); } else { - shell.printfln(F("Invalid: use watch raw|on|off|unknown|id [id]")); + shell.printfln(("Invalid: use watch raw|on|off|unknown|id [id]")); return; } uint8_t watch = EMSESP::watch(); if (watch == EMSESP::WATCH_OFF) { - shell.printfln(F("Watching telegrams is off")); + shell.printfln(("Watching telegrams is off")); return; } // if logging is off, the watch won't show anything, show force it back to NOTICE if (shell.log_level() < Level::NOTICE) { shell.log_level(Level::NOTICE); - shell.printfln(F("Setting log level to Notice")); + shell.printfln(("Setting log level to Notice")); } if (watch == EMSESP::WATCH_ON) { - shell.printfln(F("Watching incoming telegrams, displayed in decoded format")); + shell.printfln(("Watching incoming telegrams, displayed in decoded format")); } else if (watch == EMSESP::WATCH_RAW) { - shell.printfln(F("Watching incoming telegrams, displayed as raw bytes")); // WATCH_RAW + shell.printfln(("Watching incoming telegrams, displayed as raw bytes")); // WATCH_RAW } else { - shell.printfln(F("Watching unknown telegrams")); // WATCH_UNKNOWN + shell.printfln(("Watching unknown telegrams")); // WATCH_UNKNOWN } watch_id = EMSESP::watch_id(); if (watch_id > 0x80) { - shell.printfln(F("Filtering only telegrams that match a telegram type of 0x%02X"), watch_id); + shell.printfln(("Filtering only telegrams that match a telegram type of 0x%02X"), watch_id); } else if (watch_id != WATCH_ID_NONE) { - shell.printfln(F("Filtering only telegrams that match a deviceID or telegram type of 0x%02X"), watch_id); + shell.printfln(("Filtering only telegrams that match a deviceID or telegram type of 0x%02X"), watch_id); } }); commands->add_command( ShellContext::MAIN, CommandFlags::ADMIN, - flash_string_vector{F_(call)}, - flash_string_vector{F_(device_type_optional), F_(cmd_optional), F_(data_optional), F_(id_optional)}, + string_vector{F_(call)}, + string_vector{F_(device_type_optional), F_(cmd_optional), F_(data_optional), F_(id_optional)}, [&](Shell & shell, const std::vector & arguments) { if (arguments.empty()) { Command::show_all(shell); // list options @@ -351,7 +351,7 @@ void EMSESPShell::add_console_commands() { // validate the device_type uint8_t device_type = EMSdevice::device_name_2_device_type(arguments[0].c_str()); if (!Command::device_has_commands(device_type)) { - shell.print(F("Invalid device. Available devices are: ")); + shell.print(("Invalid device. Available devices are: ")); Command::show_devices(shell); return; } @@ -359,7 +359,7 @@ void EMSESPShell::add_console_commands() { // validate that a command is present if (arguments.size() < 2) { - shell.print(F("Missing command. Available commands are: ")); + shell.print(("Missing command. Available commands are: ")); Command::show(shell, device_type, false); // non-verbose mode return; } @@ -399,11 +399,11 @@ void EMSESPShell::add_console_commands() { } if (return_code == CommandRet::NOT_FOUND) { - shell.println(F("Unknown command")); - shell.print(F("Available commands are: ")); + shell.println(("Unknown command")); + shell.print(("Available commands are: ")); Command::show(shell, device_type, false); // non-verbose mode } else if (return_code != CommandRet::OK) { - shell.printfln(F("Bad syntax (error code %d)"), return_code); + shell.printfln(("Bad syntax (error code %d)"), return_code); } }, [&](Shell & shell __attribute__((unused)), const std::vector & arguments) -> std::vector { @@ -424,7 +424,7 @@ void EMSESPShell::add_console_commands() { if (Command::device_has_commands(device_type)) { for (const auto & cf : Command::commands()) { if (cf.device_type_ == device_type) { - command_list.emplace_back(read_flash_string(cf.cmd_)); + command_list.emplace_back((cf.cmd_)); } } return command_list; @@ -448,8 +448,8 @@ void Console::load_standard_commands(unsigned int context) { // create commands test and t EMSESPShell::commands->add_command(context, CommandFlags::USER, - flash_string_vector{F("test")}, - flash_string_vector{F_(name_optional), F_(data_optional)}, + string_vector{("test")}, + string_vector{F_(name_optional), F_(data_optional)}, [](Shell & shell, const std::vector & arguments) { if (arguments.empty()) { Test::run_test(shell, "default"); @@ -460,7 +460,7 @@ void Console::load_standard_commands(unsigned int context) { } }); - EMSESPShell::commands->add_command(context, CommandFlags::USER, flash_string_vector{F("t")}, [](Shell & shell, const std::vector & arguments) { + EMSESPShell::commands->add_command(context, CommandFlags::USER, string_vector{("t")}, [](Shell & shell, const std::vector & arguments) { Test::run_test(shell, "default"); }); #endif @@ -468,8 +468,8 @@ void Console::load_standard_commands(unsigned int context) { #if defined(EMSESP_DEBUG) EMSESPShell::commands->add_command(context, CommandFlags::USER, - flash_string_vector{F_(debug)}, - flash_string_vector{F_(name_optional)}, + string_vector{F_(debug)}, + string_vector{F_(name_optional)}, [](Shell & shell, const std::vector & arguments) { if (arguments.empty()) { Test::debug(shell, "default"); @@ -482,8 +482,8 @@ void Console::load_standard_commands(unsigned int context) { EMSESPShell::commands->add_command( context, CommandFlags::USER, - flash_string_vector{F_(log)}, - flash_string_vector{F_(log_level_optional)}, + string_vector{F_(log)}, + string_vector{F_(log_level_optional)}, [](Shell & shell, const std::vector & arguments) { if (!arguments.empty()) { uuid::log::Level level; @@ -494,7 +494,7 @@ void Console::load_standard_commands(unsigned int context) { return; } } else { - shell.print(F("levels: ")); + shell.print(("levels: ")); std::vector v = uuid::log::levels_lowercase(); size_t i = v.size(); while (i--) { @@ -511,22 +511,22 @@ void Console::load_standard_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::USER, - flash_string_vector{F_(help)}, + string_vector{F_(help)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { shell.print_all_available_commands(); }); EMSESPShell::commands->add_command(context, CommandFlags::USER, - flash_string_vector{F_(exit)}, + string_vector{F_(exit)}, [=](Shell & shell, const std::vector & arguments __attribute__((unused))) { shell.stop(); }); EMSESPShell::commands->add_command(context, CommandFlags::USER, - flash_string_vector{F_(su)}, + string_vector{F_(su)}, [=](Shell & shell, const std::vector & arguments __attribute__((unused))) { auto become_admin = [](Shell & shell) { - shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, F("su session opened on console")); + shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, ("su session opened on console")); shell.add_flags(CommandFlags::ADMIN); }; @@ -542,8 +542,8 @@ void Console::load_standard_commands(unsigned int context) { become_admin(shell); } else { shell.delay_until(now + INVALID_PASSWORD_DELAY_MS, [](Shell & shell) { - shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, F("Invalid su password on console")); - shell.println(F("su: incorrect password")); + shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, ("Invalid su password on console")); + shell.println(("su: incorrect password")); }); } }); @@ -557,21 +557,21 @@ void Console::load_standard_commands(unsigned int context) { void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(restart)}, + string_vector{F_(restart)}, [](Shell & shell __attribute__((unused)), const std::vector & arguments __attribute__((unused))) { EMSESP::system_.system_restart(); }); EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(wifi), F_(reconnect)}, + string_vector{F_(wifi), F_(reconnect)}, [](Shell & shell __attribute__((unused)), const std::vector & arguments __attribute__((unused))) { EMSESP::system_.wifi_reconnect(); }); EMSESPShell::commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, - flash_string_vector{F_(format)}, + string_vector{F_(format)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { shell.enter_password(F_(password_prompt), [=](Shell & shell, bool completed, const std::string & password) { if (completed) { @@ -579,7 +579,7 @@ void Console::load_system_commands(unsigned int context) { if (securitySettings.jwtSecret.equals(password.c_str())) { EMSESP::system_.format(shell); } else { - shell.println(F("incorrect password")); + shell.println(("incorrect password")); } }); } @@ -588,7 +588,7 @@ void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(passwd)}, + string_vector{F_(passwd)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { shell.enter_password(F_(new_password_prompt1), [](Shell & shell, bool completed, const std::string & password1) { if (completed) { @@ -602,9 +602,9 @@ void Console::load_system_commands(unsigned int context) { return StateUpdateResult::CHANGED; }, "local"); - shell.println(F("su password updated")); + shell.println(("su password updated")); } else { - shell.println(F("Passwords do not match")); + shell.println(("Passwords do not match")); } } }); @@ -614,7 +614,7 @@ void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::USER, - flash_string_vector{F_(show), F_(system)}, + string_vector{F_(show), F_(system)}, [=](Shell & shell, const std::vector & arguments __attribute__((unused))) { EMSESP::system_.show_system(shell); shell.println(); @@ -622,8 +622,8 @@ void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(set), F_(hostname)}, - flash_string_vector{F_(name_mandatory)}, + string_vector{F_(set), F_(hostname)}, + string_vector{F_(name_mandatory)}, [](Shell & shell, const std::vector & arguments) { shell.println("The network connection will be reset..."); Shell::loop_all(); @@ -638,8 +638,8 @@ void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(set), F_(wifi), F_(ssid)}, - flash_string_vector{F_(name_mandatory)}, + string_vector{F_(set), F_(wifi), F_(ssid)}, + string_vector{F_(name_mandatory)}, [](Shell & shell, const std::vector & arguments) { EMSESP::esp8266React.getNetworkSettingsService()->updateWithoutPropagation([&](NetworkSettings & networkSettings) { networkSettings.ssid = arguments.front().c_str(); @@ -651,8 +651,8 @@ void Console::load_system_commands(unsigned int context) { // added by mvdp EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F("mqtt"), F("subscribe")}, - flash_string_vector{F("")}, + string_vector{("mqtt"), ("subscribe")}, + string_vector{("")}, [](Shell & shell, const std::vector & arguments) { Mqtt::subscribe(arguments.front()); shell.println("subscribing"); @@ -660,7 +660,7 @@ void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(set), F_(wifi), F_(password)}, + string_vector{F_(set), F_(wifi), F_(password)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { shell.enter_password(F_(new_password_prompt1), [](Shell & shell, bool completed, const std::string & password1) { if (completed) { @@ -675,7 +675,7 @@ void Console::load_system_commands(unsigned int context) { }); shell.println("Use `wifi reconnect` to save and apply the new settings"); } else { - shell.println(F("Passwords do not match")); + shell.println(("Passwords do not match")); } } }); @@ -685,13 +685,13 @@ void Console::load_system_commands(unsigned int context) { EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(set), F_(board_profile)}, - flash_string_vector{F_(name_mandatory)}, + string_vector{F_(set), F_(board_profile)}, + string_vector{F_(name_mandatory)}, [](Shell & shell, const std::vector & arguments) { std::vector data; // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode std::string board_profile = Helpers::toUpper(arguments.front()); if (!EMSESP::system_.load_board_profile(data, board_profile)) { - shell.println(F("Invalid board profile (S32, E32, MH-ET, NODEMCU, OLIMEX, OLIMEXPOE, C3MINI, CUSTOM)")); + shell.println(("Invalid board profile (S32, E32, MH-ET, NODEMCU, OLIMEX, OLIMEXPOE, C3MINI, CUSTOM)")); return; } EMSESP::webSettingsService.update( @@ -714,7 +714,7 @@ void Console::load_system_commands(unsigned int context) { }); EMSESPShell::commands->add_command(context, CommandFlags::ADMIN, - flash_string_vector{F_(show), F_(users)}, + string_vector{F_(show), F_(users)}, [](Shell & shell, const std::vector & arguments __attribute__((unused))) { EMSESP::system_.show_users(shell); }); @@ -730,14 +730,14 @@ std::string EMSESPShell::prompt_suffix() { } void EMSESPShell::end_of_transmission() { - invoke_command(read_flash_string(F_(exit))); + invoke_command((F_(exit))); } EMSESPStreamConsole::EMSESPStreamConsole(Stream & stream, bool local) : uuid::console::Shell(commands, ShellContext::MAIN, local ? (CommandFlags::USER | CommandFlags::LOCAL) : CommandFlags::USER) , uuid::console::StreamConsole(stream) , EMSESPShell() - , name_(read_flash_string(F("Serial"))) + , name_((("Serial"))) , pty_(SIZE_MAX) , addr_() , port_(0) { @@ -763,14 +763,14 @@ EMSESPStreamConsole::EMSESPStreamConsole(Stream & stream, const IPAddress & addr snprintf(text.data(), text.size(), "pty%u", (uint16_t)pty_); name_ = text.data(); #ifndef EMSESP_STANDALONE - logger().info(F("Allocated console %s for connection from [%s]:%u"), name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_); + logger().info(("Allocated console %s for connection from [%s]:%u"), name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_); #endif } EMSESPStreamConsole::~EMSESPStreamConsole() { if (pty_ != SIZE_MAX) { #ifndef EMSESP_STANDALONE - logger().info(F("Shutdown console %s for connection from [%s]:%u"), name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_); + logger().info(("Shutdown console %s for connection from [%s]:%u"), name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_); #endif ptys_[pty_] = false; ptys_.shrink_to_fit(); diff --git a/src/dallassensor.cpp b/src/dallassensor.cpp index d02a8e8d0..32635c748 100644 --- a/src/dallassensor.cpp +++ b/src/dallassensor.cpp @@ -42,7 +42,7 @@ void DallasSensor::start() { #ifndef EMSESP_STANDALONE bus_.begin(dallas_gpio_); - LOG_INFO(F("Starting Dallas sensor service")); + LOG_INFO(("Starting Dallas sensor service")); #endif // Add API calls @@ -84,7 +84,7 @@ void DallasSensor::loop() { if (state_ == State::IDLE) { if (time_now - last_activity_ >= READ_INTERVAL_MS) { #ifdef EMSESP_DEBUG_SENSOR - LOG_DEBUG(F("[DEBUG] Read sensor temperature")); + LOG_DEBUG(("[DEBUG] Read sensor temperature")); #endif if (bus_.reset() || parasite_) { YIELD; @@ -99,7 +99,7 @@ void DallasSensor::loop() { if (++scanretry_ > SCAN_MAX) { // every 30 sec scanretry_ = 0; #ifdef EMSESP_DEBUG_SENSOR - LOG_ERROR(F("Bus reset failed")); + LOG_ERROR(("Bus reset failed")); #endif for (auto & sensor : sensors_) { sensor.temperature_c = EMS_VALUE_SHORT_NOTSET; @@ -112,13 +112,13 @@ void DallasSensor::loop() { } else if (state_ == State::READING) { if (temperature_convert_complete() && (time_now - last_activity_ > CONVERSION_MS)) { #ifdef EMSESP_DEBUG_SENSOR - LOG_DEBUG(F("Scanning for sensors")); + LOG_DEBUG(("Scanning for sensors")); #endif bus_.reset_search(); state_ = State::SCANNING; } else if (time_now - last_activity_ > READ_TIMEOUT_MS) { #ifdef EMSESP_DEBUG_SENSOR - LOG_WARNING(F("Dallas sensor read timeout")); + LOG_WARNING(("Dallas sensor read timeout")); #endif state_ = State::IDLE; sensorfails_++; @@ -126,7 +126,7 @@ void DallasSensor::loop() { } else if (state_ == State::SCANNING) { if (time_now - last_activity_ > SCAN_TIMEOUT_MS) { #ifdef EMSESP_DEBUG_SENSOR - LOG_ERROR(F("Dallas sensor scan timeout")); + LOG_ERROR(("Dallas sensor scan timeout")); #endif state_ = State::IDLE; sensorfails_++; @@ -181,12 +181,12 @@ void DallasSensor::loop() { default: sensorfails_++; - LOG_ERROR(F("Unknown dallas sensor %s"), Sensor(addr).id().c_str()); + LOG_ERROR(("Unknown dallas sensor %s"), Sensor(addr).id().c_str()); break; } } else { sensorfails_++; - LOG_ERROR(F("Invalid dallas sensor %s"), Sensor(addr).id().c_str()); + LOG_ERROR(("Invalid dallas sensor %s"), Sensor(addr).id().c_str()); } } else { if (!parasite_) { @@ -204,7 +204,7 @@ void DallasSensor::loop() { scancnt_ = 0; } else if (scancnt_ == SCAN_START + 1) { // startup firstscan_ = sensors_.size(); - // LOG_DEBUG(F("Adding %d dallas sensor(s) from first scan"), firstscan_); + // LOG_DEBUG(("Adding %d dallas sensor(s) from first scan"), firstscan_); } else if ((scancnt_ <= 0) && (firstscan_ != sensors_.size())) { // check 2 times for no change of sensor # scancnt_ = SCAN_START; sensors_.clear(); // restart scaning and clear to get correct numbering @@ -230,7 +230,7 @@ bool DallasSensor::temperature_convert_complete() { int16_t DallasSensor::get_temperature_c(const uint8_t addr[]) { #ifndef EMSESP_STANDALONE if (!bus_.reset()) { - LOG_ERROR(F("Bus reset failed before reading scratchpad from %s"), Sensor(addr).id().c_str()); + LOG_ERROR(("Bus reset failed before reading scratchpad from %s"), Sensor(addr).id().c_str()); return EMS_VALUE_SHORT_NOTSET; } YIELD; @@ -242,13 +242,13 @@ int16_t DallasSensor::get_temperature_c(const uint8_t addr[]) { YIELD; if (!bus_.reset()) { - LOG_ERROR(F("Bus reset failed after reading scratchpad from %s"), Sensor(addr).id().c_str()); + LOG_ERROR(("Bus reset failed after reading scratchpad from %s"), Sensor(addr).id().c_str()); return EMS_VALUE_SHORT_NOTSET; } YIELD; if (bus_.crc8(scratchpad, SCRATCHPAD_LEN - 1) != scratchpad[SCRATCHPAD_LEN - 1]) { - LOG_WARNING(F("Invalid scratchpad CRC: %02X%02X%02X%02X%02X%02X%02X%02X%02X from sensor %s"), + LOG_WARNING(("Invalid scratchpad CRC: %02X%02X%02X%02X%02X%02X%02X%02X%02X from sensor %s"), scratchpad[0], scratchpad[1], scratchpad[2], @@ -315,7 +315,7 @@ bool DallasSensor::update(const std::string & id, const std::string & name, int1 SensorCustomization.name = name; SensorCustomization.offset = offset; found = true; - LOG_DEBUG(F("Customizing existing sensor ID %s"), id.c_str()); + LOG_DEBUG(("Customizing existing sensor ID %s"), id.c_str()); break; } } @@ -325,7 +325,7 @@ bool DallasSensor::update(const std::string & id, const std::string & name, int1 newSensor.name = name; newSensor.offset = offset; settings.sensorCustomizations.push_back(newSensor); - LOG_DEBUG(F("Adding new customization for sensor ID %s"), id.c_str()); + LOG_DEBUG(("Adding new customization for sensor ID %s"), id.c_str()); } sensor.ha_registered = false; // it's changed so we may need to recreate the HA config return StateUpdateResult::CHANGED; @@ -426,9 +426,9 @@ void DallasSensor::publish_sensor(const Sensor & sensor) { if (Mqtt::publish_single()) { char topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; if (Mqtt::publish_single2cmd()) { - snprintf(topic, sizeof(topic), "%s/%s", read_flash_string(F_(dallassensor)).c_str(), sensor.name().c_str()); + snprintf(topic, sizeof(topic), "%s/%s", (F_(dallassensor)), sensor.name().c_str()); } else { - snprintf(topic, sizeof(topic), "%s%s/%s", read_flash_string(F_(dallassensor)).c_str(), "_data", sensor.name().c_str()); + snprintf(topic, sizeof(topic), "%s%s/%s", (F_(dallassensor)), "_data", sensor.name().c_str()); } char payload[10]; Mqtt::publish(topic, Helpers::render_value(payload, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0)); @@ -441,7 +441,7 @@ void DallasSensor::remove_ha_topic(const std::string & id) { return; } #ifdef EMSESP_DEBUG - LOG_DEBUG(F("Removing HA config for temperature sensor ID %s"), id.c_str()); + LOG_DEBUG(("Removing HA config for temperature sensor ID %s"), id.c_str()); #endif // use '_' as HA doesn't like '-' in the topic name std::string sensorid = id; @@ -483,7 +483,7 @@ void DallasSensor::publish_values(const bool force) { // to e.g. homeassistant/sensor/ems-esp/dallassensor_28-233D-9497-0C03/config if (Mqtt::ha_enabled()) { if (!sensor.ha_registered || force) { - LOG_DEBUG(F("Recreating HA config for sensor ID %s"), sensor.id().c_str()); + LOG_DEBUG(("Recreating HA config for sensor ID %s"), sensor.id().c_str()); StaticJsonDocument config; config["dev_cla"] = "temperature"; @@ -530,7 +530,7 @@ void DallasSensor::publish_values(const bool force) { } } - Mqtt::publish(F("dallassensor_data"), doc.as()); + Mqtt::publish(("dallassensor_data"), doc.as()); } @@ -574,7 +574,7 @@ bool DallasSensor::Sensor::apply_customization() { if (!sensors.empty()) { for (const auto & sensor : sensors) { #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("Loading customization for dallas sensor %s"), sensor.id.c_str()); + LOG_DEBUG(("Loading customization for dallas sensor %s"), sensor.id.c_str()); #endif if (id_ == sensor.id) { set_name(sensor.name); diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 6b1b2cb93..def57f8c4 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -29,11 +29,11 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const // alternative heatsource special messages if (device_id == EMSdevice::EMS_DEVICE_ID_AM200) { - register_telegram_type(0x54D, F("AmTemperatures"), false, MAKE_PF_CB(process_amTempMessage)); - register_telegram_type(0x54E, F("AmStatus"), false, MAKE_PF_CB(process_amStatusMessage)); - register_telegram_type(0x54F, F("AmCommand"), false, MAKE_PF_CB(process_amCommandMessage)); // not broadcasted, but actually not used - register_telegram_type(0x550, F("AmExtra"), false, MAKE_PF_CB(process_amExtraMessage)); - register_telegram_type(0x54C, F("AmSettings"), true, MAKE_PF_CB(process_amSettingMessage)); // not broadcasted + register_telegram_type(0x54D, ("AmTemperatures"), false, MAKE_PF_CB(process_amTempMessage)); + register_telegram_type(0x54E, ("AmStatus"), false, MAKE_PF_CB(process_amStatusMessage)); + register_telegram_type(0x54F, ("AmCommand"), false, MAKE_PF_CB(process_amCommandMessage)); // not broadcasted, but actually not used + register_telegram_type(0x550, ("AmExtra"), false, MAKE_PF_CB(process_amExtraMessage)); + register_telegram_type(0x54C, ("AmSettings"), true, MAKE_PF_CB(process_amSettingMessage)); // not broadcasted register_device_value(DeviceValueTAG::TAG_AHS, &curFlowTemp_, @@ -113,12 +113,12 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const if (device_id >= EMSdevice::EMS_DEVICE_ID_BOILER_1) { uint8_t hs = device_id - EMSdevice::EMS_DEVICE_ID_BOILER_1; // heating source id, count from 0 // Runtime of each heatingsource in 0x06DC, ff - register_telegram_type(0x6DC + hs, F("CascadeMessage"), false, MAKE_PF_CB(process_CascadeMessage)); + register_telegram_type(0x6DC + hs, ("CascadeMessage"), false, MAKE_PF_CB(process_CascadeMessage)); register_device_value(DeviceValueTAG::TAG_HS1 + hs, &burnWorkMin_, DeviceValueType::TIME, FL_(burnWorkMin), DeviceValueUOM::MINUTES); // selBurnpower in D2 and E4 - // register_telegram_type(0xD2, F("CascadePowerMessage"), false, MAKE_PF_CB(process_CascadePowerMessage)); + // register_telegram_type(0xD2, ("CascadePowerMessage"), false, MAKE_PF_CB(process_CascadePowerMessage)); // individual Flowtemps and powervalues for each heatingsource in E4 - register_telegram_type(0xE4, F("UBAMonitorFastPlus"), false, MAKE_PF_CB(process_UBAMonitorFastPlus)); + register_telegram_type(0xE4, ("UBAMonitorFastPlus"), false, MAKE_PF_CB(process_UBAMonitorFastPlus)); register_device_value(DeviceValueTAG::TAG_HS1 + hs, &selFlowTemp_, DeviceValueType::UINT, FL_(selFlowTemp), DeviceValueUOM::DEGREES); register_device_value(DeviceValueTAG::TAG_HS1 + hs, &selBurnPow_, DeviceValueType::UINT, FL_(selBurnPow), DeviceValueUOM::PERCENT); register_device_value(DeviceValueTAG::TAG_HS1 + hs, @@ -136,48 +136,48 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const // the telegram handlers... // common for all boilers - register_telegram_type(0xBF, F("ErrorMessage"), false, MAKE_PF_CB(process_ErrorMessage)); - register_telegram_type(0x10, F("UBAErrorMessage1"), false, MAKE_PF_CB(process_UBAErrorMessage)); - register_telegram_type(0x11, F("UBAErrorMessage2"), false, MAKE_PF_CB(process_UBAErrorMessage)); - register_telegram_type(0xC2, F("UBAErrorMessage3"), false, MAKE_PF_CB(process_UBAErrorMessage2)); - register_telegram_type(0x14, F("UBATotalUptime"), true, MAKE_PF_CB(process_UBATotalUptime)); - register_telegram_type(0x15, F("UBAMaintenanceData"), false, MAKE_PF_CB(process_UBAMaintenanceData)); - register_telegram_type(0x1C, F("UBAMaintenanceStatus"), false, MAKE_PF_CB(process_UBAMaintenanceStatus)); + register_telegram_type(0xBF, ("ErrorMessage"), false, MAKE_PF_CB(process_ErrorMessage)); + register_telegram_type(0x10, ("UBAErrorMessage1"), false, MAKE_PF_CB(process_UBAErrorMessage)); + register_telegram_type(0x11, ("UBAErrorMessage2"), false, MAKE_PF_CB(process_UBAErrorMessage)); + register_telegram_type(0xC2, ("UBAErrorMessage3"), false, MAKE_PF_CB(process_UBAErrorMessage2)); + register_telegram_type(0x14, ("UBATotalUptime"), true, MAKE_PF_CB(process_UBATotalUptime)); + register_telegram_type(0x15, ("UBAMaintenanceData"), false, MAKE_PF_CB(process_UBAMaintenanceData)); + register_telegram_type(0x1C, ("UBAMaintenanceStatus"), false, MAKE_PF_CB(process_UBAMaintenanceStatus)); // EMS1.0 and maybe EMS+? - register_telegram_type(0x18, F("UBAMonitorFast"), false, MAKE_PF_CB(process_UBAMonitorFast)); - register_telegram_type(0x19, F("UBAMonitorSlow"), false, MAKE_PF_CB(process_UBAMonitorSlow)); - register_telegram_type(0x1A, F("UBASetPoints"), false, MAKE_PF_CB(process_UBASetPoints)); - register_telegram_type(0x35, F("UBAFlags"), false, MAKE_PF_CB(process_UBAFlags)); + register_telegram_type(0x18, ("UBAMonitorFast"), false, MAKE_PF_CB(process_UBAMonitorFast)); + register_telegram_type(0x19, ("UBAMonitorSlow"), false, MAKE_PF_CB(process_UBAMonitorSlow)); + register_telegram_type(0x1A, ("UBASetPoints"), false, MAKE_PF_CB(process_UBASetPoints)); + register_telegram_type(0x35, ("UBAFlags"), false, MAKE_PF_CB(process_UBAFlags)); // only EMS 1.0 - register_telegram_type(0x16, F("UBAParameters"), true, MAKE_PF_CB(process_UBAParameters)); - register_telegram_type(0x33, F("UBAParameterWW"), true, MAKE_PF_CB(process_UBAParameterWW)); - register_telegram_type(0x34, F("UBAMonitorWW"), false, MAKE_PF_CB(process_UBAMonitorWW)); + register_telegram_type(0x16, ("UBAParameters"), true, MAKE_PF_CB(process_UBAParameters)); + register_telegram_type(0x33, ("UBAParameterWW"), true, MAKE_PF_CB(process_UBAParameterWW)); + register_telegram_type(0x34, ("UBAMonitorWW"), false, MAKE_PF_CB(process_UBAMonitorWW)); // not ems1.0, but HT3 if (model() != EMSdevice::EMS_DEVICE_FLAG_EMS) { - register_telegram_type(0x26, F("UBASettingsWW"), true, MAKE_PF_CB(process_UBASettingsWW)); - register_telegram_type(0x2A, F("MC110Status"), false, MAKE_PF_CB(process_MC110Status)); + register_telegram_type(0x26, ("UBASettingsWW"), true, MAKE_PF_CB(process_UBASettingsWW)); + register_telegram_type(0x2A, ("MC110Status"), false, MAKE_PF_CB(process_MC110Status)); } // only EMS+ if (model() != EMSdevice::EMS_DEVICE_FLAG_EMS && model() != EMSdevice::EMS_DEVICE_FLAG_HT3 && model() != EMSdevice::EMS_DEVICE_FLAG_HYBRID) { - register_telegram_type(0xD1, F("UBAOutdoorTemp"), false, MAKE_PF_CB(process_UBAOutdoorTemp)); - register_telegram_type(0xE3, F("UBAMonitorSlowPlus2"), false, MAKE_PF_CB(process_UBAMonitorSlowPlus2)); - register_telegram_type(0xE4, F("UBAMonitorFastPlus"), false, MAKE_PF_CB(process_UBAMonitorFastPlus)); - register_telegram_type(0xE5, F("UBAMonitorSlowPlus"), false, MAKE_PF_CB(process_UBAMonitorSlowPlus)); - register_telegram_type(0xE6, F("UBAParametersPlus"), true, MAKE_PF_CB(process_UBAParametersPlus)); - register_telegram_type(0xE9, F("UBAMonitorWWPlus"), false, MAKE_PF_CB(process_UBAMonitorWWPlus)); - register_telegram_type(0xEA, F("UBAParameterWWPlus"), true, MAKE_PF_CB(process_UBAParameterWWPlus)); + register_telegram_type(0xD1, ("UBAOutdoorTemp"), false, MAKE_PF_CB(process_UBAOutdoorTemp)); + register_telegram_type(0xE3, ("UBAMonitorSlowPlus2"), false, MAKE_PF_CB(process_UBAMonitorSlowPlus2)); + register_telegram_type(0xE4, ("UBAMonitorFastPlus"), false, MAKE_PF_CB(process_UBAMonitorFastPlus)); + register_telegram_type(0xE5, ("UBAMonitorSlowPlus"), false, MAKE_PF_CB(process_UBAMonitorSlowPlus)); + register_telegram_type(0xE6, ("UBAParametersPlus"), true, MAKE_PF_CB(process_UBAParametersPlus)); + register_telegram_type(0xE9, ("UBAMonitorWWPlus"), false, MAKE_PF_CB(process_UBAMonitorWWPlus)); + register_telegram_type(0xEA, ("UBAParameterWWPlus"), true, MAKE_PF_CB(process_UBAParameterWWPlus)); } if (model() == EMSdevice::EMS_DEVICE_FLAG_HEATPUMP) { - register_telegram_type(0x494, F("UBAEnergySupplied"), false, MAKE_PF_CB(process_UBAEnergySupplied)); - register_telegram_type(0x495, F("UBAInformation"), false, MAKE_PF_CB(process_UBAInformation)); - register_telegram_type(0x48D, F("HpPower"), true, MAKE_PF_CB(process_HpPower)); - register_telegram_type(0x48F, F("HpOutdoor"), false, MAKE_PF_CB(process_HpOutdoor)); - register_telegram_type(0x48A, F("HpPool"), true, MAKE_PF_CB(process_HpPool)); + register_telegram_type(0x494, ("UBAEnergySupplied"), false, MAKE_PF_CB(process_UBAEnergySupplied)); + register_telegram_type(0x495, ("UBAInformation"), false, MAKE_PF_CB(process_UBAInformation)); + register_telegram_type(0x48D, ("HpPower"), true, MAKE_PF_CB(process_HpPower)); + register_telegram_type(0x48F, ("HpOutdoor"), false, MAKE_PF_CB(process_HpOutdoor)); + register_telegram_type(0x48A, ("HpPool"), true, MAKE_PF_CB(process_HpPool)); } /* @@ -186,7 +186,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const * enable settings here if no thermostat is used in system * if (model() == EMSdevice::EMS_DEVICE_FLAG_HYBRID) { - register_telegram_type(0xBB, F("HybridHp"), true, MAKE_PF_CB(process_HybridHp)); + register_telegram_type(0xBB, ("HybridHp"), true, MAKE_PF_CB(process_HybridHp)); } */ @@ -2081,11 +2081,11 @@ bool Boiler::set_ww_circulation_mode(const char * value, const int8_t id) { } if (v < 7) { - // LOG_INFO(F("Setting dhw circulation mode %dx3min"), v); + // LOG_INFO(("Setting dhw circulation mode %dx3min"), v); } else if (v == 7) { - // LOG_INFO(F("Setting dhw circulation mode continuous")); + // LOG_INFO(("Setting dhw circulation mode continuous")); } else { - // LOG_WARNING(F("Set dhw circulation mode: Invalid value")); + // LOG_WARNING(("Set dhw circulation mode: Invalid value")); return false; } @@ -2109,12 +2109,12 @@ bool Boiler::set_reset(const char * value, const int8_t id) { } if (num == 1) { - // LOG_INFO(F("Reset boiler maintenance message")); + // LOG_INFO(("Reset boiler maintenance message")); write_command(0x05, 0x08, 0xFF, 0x1C); has_update(&reset_); return true; } else if (num == 2) { - // LOG_INFO(F("Reset boiler error message")); + // LOG_INFO(("Reset boiler error message")); write_command(0x05, 0x00, 0x5A); // error reset has_update(&reset_); return true; @@ -2131,7 +2131,7 @@ bool Boiler::set_maintenance(const char * value, const int8_t id) { std::string s; if (Helpers::value2string(value, s)) { if (s == Helpers::translated_word(FL_(reset))) { - // LOG_INFO(F("Reset boiler maintenance message")); + // LOG_INFO(("Reset boiler maintenance message")); write_command(0x05, 0x08, 0xFF, 0x1C); return true; } @@ -2142,11 +2142,11 @@ bool Boiler::set_maintenance(const char * value, const int8_t id) { uint8_t month = (value[3] - '0') * 10 + (value[4] - '0'); uint8_t year = (uint8_t)(Helpers::atoint(&value[6]) - 2000); if (day > 0 && day < 32 && month > 0 && month < 13) { - LOG_INFO(F("Setting maintenance date to %02d.%02d.%04d"), day, month, year + 2000); + LOG_INFO(("Setting maintenance date to %02d.%02d.%04d"), day, month, year + 2000); uint8_t data[5] = {2, (uint8_t)(maintenanceTime_ / 100), day, month, year}; write_command(0x15, 0, data, 5, 0x15); } else { - LOG_WARNING(F("Setting maintenance: wrong format %d.%d.%d"), day, month, year + 2000); + LOG_WARNING(("Setting maintenance: wrong format %d.%d.%d"), day, month, year + 2000); return false; } return true; @@ -2155,7 +2155,7 @@ bool Boiler::set_maintenance(const char * value, const int8_t id) { int hrs; if (Helpers::value2number(value, hrs)) { if (hrs > 99 && hrs < 25600) { - LOG_INFO(F("Setting maintenance time %d hours"), hrs); + LOG_INFO(("Setting maintenance time %d hours"), hrs); uint8_t data[2] = {1, (uint8_t)(hrs / 100)}; write_command(0x15, 0, data, 2, 0x15); return true; @@ -2164,12 +2164,12 @@ bool Boiler::set_maintenance(const char * value, const int8_t id) { uint8_t num; if (Helpers::value2enum(value, num, FL_(enum_off_time_date_manual))) { - LOG_INFO(F("Setting maintenance type to %s"), value); + LOG_INFO(("Setting maintenance type to %s"), value); write_command(0x15, 0, num, 0x15); return true; } - LOG_WARNING(F("Setting maintenance: wrong format")); + LOG_WARNING(("Setting maintenance: wrong format")); return false; } //maintenance @@ -2177,13 +2177,13 @@ bool Boiler::set_maintenancetime(const char * value, const int8_t id) { int hrs; if (Helpers::value2number(value, hrs)) { if (hrs > 99 && hrs < 25600) { - LOG_INFO(F("Setting maintenance time %d hours"), hrs); + LOG_INFO(("Setting maintenance time %d hours"), hrs); uint8_t data[2] = {1, (uint8_t)(hrs / 100)}; write_command(0x15, 0, data, 2, 0x15); return true; } } - LOG_WARNING(F("Setting maintenance: wrong format")); + LOG_WARNING(("Setting maintenance: wrong format")); return false; } @@ -2194,17 +2194,17 @@ bool Boiler::set_maintenancedate(const char * value, const int8_t id) { uint8_t month = (value[3] - '0') * 10 + (value[4] - '0'); uint8_t year = (uint8_t)(Helpers::atoint(&value[6]) - 2000); if (day > 0 && day < 32 && month > 0 && month < 13) { - LOG_INFO(F("Setting maintenance date to %02d.%02d.%04d"), day, month, year + 2000); + LOG_INFO(("Setting maintenance date to %02d.%02d.%04d"), day, month, year + 2000); uint8_t data[5] = {2, (uint8_t)(maintenanceTime_ / 100), day, month, year}; write_command(0x15, 0, data, 5, 0x15); } else { - LOG_WARNING(F("Setting maintenance: wrong format %d.%d.%d"), day, month, year + 2000); + LOG_WARNING(("Setting maintenance: wrong format %d.%d.%d"), day, month, year + 2000); return false; } return true; } - LOG_WARNING(F("Setting maintenance: wrong format")); + LOG_WARNING(("Setting maintenance: wrong format")); return false; } @@ -2215,7 +2215,7 @@ bool Boiler::set_pool_temp(const char * value, const int8_t id) { return false; } uint8_t v2 = ((v * 2) + 0.5); - // LOG_INFO(F("Setting pool temperature to %d.%d C"), v2 >> 1, (v2 & 0x01) * 5); + // LOG_INFO(("Setting pool temperature to %d.%d C"), v2 >> 1, (v2 & 0x01) * 5); write_command(0x48A, 1, v2, 0x48A); return true; diff --git a/src/devices/controller.cpp b/src/devices/controller.cpp index 3dad2e8c1..3e1b74c0c 100644 --- a/src/devices/controller.cpp +++ b/src/devices/controller.cpp @@ -26,7 +26,7 @@ Controller::Controller(uint8_t device_type, uint8_t device_id, uint8_t product_i : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { // IVT broadcasts Thermostat time from controller (0x09) if display is off. if ((flags & 0x0F) == EMS_DEVICE_FLAG_IVT) { - register_telegram_type(0x06, F("RCTime"), false, MAKE_PF_CB(process_dateTime)); + register_telegram_type(0x06, ("RCTime"), false, MAKE_PF_CB(process_dateTime)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); } } diff --git a/src/devices/gateway.cpp b/src/devices/gateway.cpp index b4d5b38e8..74ac1a627 100644 --- a/src/devices/gateway.cpp +++ b/src/devices/gateway.cpp @@ -22,7 +22,7 @@ namespace emsesp { REGISTER_FACTORY(Gateway, EMSdevice::DeviceType::GATEWAY); -Gateway::Gateway(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char *name, uint8_t flags, uint8_t brand) +Gateway::Gateway(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand) : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { } diff --git a/src/devices/heatpump.cpp b/src/devices/heatpump.cpp index 399452a90..de49f3be0 100644 --- a/src/devices/heatpump.cpp +++ b/src/devices/heatpump.cpp @@ -25,8 +25,8 @@ REGISTER_FACTORY(Heatpump, EMSdevice::DeviceType::HEATPUMP); Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand) : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { // telegram handlers - register_telegram_type(0x042B, F("HP1"), false, MAKE_PF_CB(process_HPMonitor1)); - register_telegram_type(0x047B, F("HP2"), false, MAKE_PF_CB(process_HPMonitor2)); + register_telegram_type(0x042B, ("HP1"), false, MAKE_PF_CB(process_HPMonitor1)); + register_telegram_type(0x047B, ("HP2"), false, MAKE_PF_CB(process_HPMonitor2)); // device values register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT, FL_(airHumidity), DeviceValueUOM::PERCENT); diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index fff55c6ad..d68a12d85 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -28,7 +28,7 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { // Pool module if (flags == EMSdevice::EMS_DEVICE_FLAG_MP) { - register_telegram_type(0x5BA, F("HpPoolStatus"), true, MAKE_PF_CB(process_HpPoolStatus)); + register_telegram_type(0x5BA, ("HpPoolStatus"), true, MAKE_PF_CB(process_HpPoolStatus)); type_ = Type::MP; register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolTemp_, @@ -43,8 +43,8 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c // EMS+ if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) { if (device_id >= 0x20 && device_id <= 0x27) { - register_telegram_type(device_id - 0x20 + 0x02D7, F("MMPLUSStatusMessage_HC"), false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC)); - // register_telegram_type(device_id - 0x20 + 0x02E1, F("MMPLUSStetMessage_HC"), true, MAKE_PF_CB(process_MMPLUSSetMessage_HC)); + register_telegram_type(device_id - 0x20 + 0x02D7, ("MMPLUSStatusMessage_HC"), false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC)); + // register_telegram_type(device_id - 0x20 + 0x02E1, ("MMPLUSStetMessage_HC"), true, MAKE_PF_CB(process_MMPLUSSetMessage_HC)); type_ = Type::HC; hc_ = device_id - 0x20 + 1; uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1; @@ -53,9 +53,9 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp)); register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump)); } else if (device_id >= 0x28 && device_id <= 0x29) { - register_telegram_type(device_id - 0x28 + 0x0331, F("MMPLUSStatusMessage_WWC"), false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC)); - register_telegram_type(device_id - 0x28 + 0x0313, F("MMPLUSConfigMessage_WWC"), true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC)); - // register_telegram_type(device_id - 0x28 + 0x033B, F("MMPLUSSetMessage_WWC"), true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC)); + register_telegram_type(device_id - 0x28 + 0x0331, ("MMPLUSStatusMessage_WWC"), false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC)); + register_telegram_type(device_id - 0x28 + 0x0313, ("MMPLUSConfigMessage_WWC"), true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC)); + // register_telegram_type(device_id - 0x28 + 0x033B, ("MMPLUSSetMessage_WWC"), true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC)); type_ = Type::WWC; hc_ = device_id - 0x28 + 1; uint8_t tag = DeviceValueTAG::TAG_WWC1 + hc_ - 1; @@ -85,9 +85,9 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c // EMS 1.0 if (flags == EMSdevice::EMS_DEVICE_FLAG_MM10) { - register_telegram_type(0x00AA, F("MMConfigMessage"), true, MAKE_PF_CB(process_MMConfigMessage)); - register_telegram_type(0x00AB, F("MMStatusMessage"), false, MAKE_PF_CB(process_MMStatusMessage)); - register_telegram_type(0x00AC, F("MMSetMessage"), false, MAKE_PF_CB(process_MMSetMessage)); + register_telegram_type(0x00AA, ("MMConfigMessage"), true, MAKE_PF_CB(process_MMConfigMessage)); + register_telegram_type(0x00AB, ("MMStatusMessage"), false, MAKE_PF_CB(process_MMStatusMessage)); + register_telegram_type(0x00AC, ("MMSetMessage"), false, MAKE_PF_CB(process_MMSetMessage)); type_ = Type::HC; hc_ = device_id - 0x20 + 1; uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1; @@ -110,10 +110,10 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c // HT3 if (flags == EMSdevice::EMS_DEVICE_FLAG_IPM) { if (device_id >= 0x40) { // special DHW pos 10 - register_telegram_type(0x34, F("UBAMonitorWW"), false, MAKE_PF_CB(process_IPMMonitorWW)); - register_telegram_type(0x1E, F("HydrTemp"), false, MAKE_PF_CB(process_IPMHydrTemp)); - register_telegram_type(0x33, F("UBAParameterWW"), true, MAKE_PF_CB(process_IPMParameterWW)); - // register_telegram_type(0x10D, F("wwNTCStatus"), false, MAKE_PF_CB(process_wwNTCStatus)); + register_telegram_type(0x34, ("UBAMonitorWW"), false, MAKE_PF_CB(process_IPMMonitorWW)); + register_telegram_type(0x1E, ("HydrTemp"), false, MAKE_PF_CB(process_IPMHydrTemp)); + register_telegram_type(0x33, ("UBAParameterWW"), true, MAKE_PF_CB(process_IPMParameterWW)); + // register_telegram_type(0x10D, ("wwNTCStatus"), false, MAKE_PF_CB(process_wwNTCStatus)); type_ = Type::WWC; hc_ = device_id - 0x40 + 1; uint8_t tag = DeviceValueTAG::TAG_WWC9 + hc_ - 1; @@ -139,9 +139,9 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c MAKE_CF_CB(set_wwCircPump)); register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode)); } else { - register_telegram_type(0x010C, F("IPMStatusMessage"), false, MAKE_PF_CB(process_IPMStatusMessage)); - register_telegram_type(0x011E, F("IPMTempMessage"), false, MAKE_PF_CB(process_IPMTempMessage)); - // register_telegram_type(0x0123, F("IPMSetMessage"), false, MAKE_PF_CB(process_IPMSetMessage)); + register_telegram_type(0x010C, ("IPMStatusMessage"), false, MAKE_PF_CB(process_IPMStatusMessage)); + register_telegram_type(0x011E, ("IPMTempMessage"), false, MAKE_PF_CB(process_IPMTempMessage)); + // register_telegram_type(0x0123, ("IPMSetMessage"), false, MAKE_PF_CB(process_IPMSetMessage)); type_ = Type::HC; hc_ = device_id - 0x20 + 1; uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1; diff --git a/src/devices/solar.cpp b/src/devices/solar.cpp index af1b8096c..f4ab5b704 100644 --- a/src/devices/solar.cpp +++ b/src/devices/solar.cpp @@ -28,44 +28,44 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { // telegram handlers if (flags == EMSdevice::EMS_DEVICE_FLAG_SM10) { - register_telegram_type(0x97, F("SM10Monitor"), false, MAKE_PF_CB(process_SM10Monitor)); - register_telegram_type(0x96, F("SM10Config"), true, MAKE_PF_CB(process_SM10Config)); + register_telegram_type(0x97, ("SM10Monitor"), false, MAKE_PF_CB(process_SM10Monitor)); + register_telegram_type(0x96, ("SM10Config"), true, MAKE_PF_CB(process_SM10Config)); EMSESP::send_read_request(0x97, device_id); } if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) { if (device_id == 0x2A) { // SM100 DHW - register_telegram_type(0x07D6, F("SM100wwTemperature"), false, MAKE_PF_CB(process_SM100wwTemperature)); - register_telegram_type(0x07AA, F("SM100wwStatus"), false, MAKE_PF_CB(process_SM100wwStatus)); - register_telegram_type(0x07AB, F("SM100wwCommand"), false, MAKE_PF_CB(process_SM100wwCommand)); - register_telegram_type(0x07A5, F("SM100wwCirc"), true, MAKE_PF_CB(process_SM100wwCirc)); - register_telegram_type(0x07A6, F("SM100wwParam"), true, MAKE_PF_CB(process_SM100wwParam)); - register_telegram_type(0x07AE, F("SM100wwKeepWarm"), true, MAKE_PF_CB(process_SM100wwKeepWarm)); - register_telegram_type(0x07E0, F("SM100wwStatus2"), true, MAKE_PF_CB(process_SM100wwStatus2)); + register_telegram_type(0x07D6, ("SM100wwTemperature"), false, MAKE_PF_CB(process_SM100wwTemperature)); + register_telegram_type(0x07AA, ("SM100wwStatus"), false, MAKE_PF_CB(process_SM100wwStatus)); + register_telegram_type(0x07AB, ("SM100wwCommand"), false, MAKE_PF_CB(process_SM100wwCommand)); + register_telegram_type(0x07A5, ("SM100wwCirc"), true, MAKE_PF_CB(process_SM100wwCirc)); + register_telegram_type(0x07A6, ("SM100wwParam"), true, MAKE_PF_CB(process_SM100wwParam)); + register_telegram_type(0x07AE, ("SM100wwKeepWarm"), true, MAKE_PF_CB(process_SM100wwKeepWarm)); + register_telegram_type(0x07E0, ("SM100wwStatus2"), true, MAKE_PF_CB(process_SM100wwStatus2)); } else { // F9 is not a telegram type, it's a flag for configure - // register_telegram_type(0xF9, F("ParamCfg"), false, MAKE_PF_CB(process_SM100ParamCfg)); - register_telegram_type(0x0358, F("SM100SystemConfig"), true, MAKE_PF_CB(process_SM100SystemConfig)); - register_telegram_type(0x035A, F("SM100CircuitConfig"), true, MAKE_PF_CB(process_SM100CircuitConfig)); - register_telegram_type(0x035D, F("SM100Circuit2Config"), true, MAKE_PF_CB(process_SM100Circuit2Config)); - register_telegram_type(0x0362, F("SM100Monitor"), false, MAKE_PF_CB(process_SM100Monitor)); - register_telegram_type(0x0363, F("SM100Monitor2"), false, MAKE_PF_CB(process_SM100Monitor2)); - register_telegram_type(0x0366, F("SM100Config"), false, MAKE_PF_CB(process_SM100Config)); - register_telegram_type(0x0364, F("SM100Status"), false, MAKE_PF_CB(process_SM100Status)); - register_telegram_type(0x036A, F("SM100Status2"), false, MAKE_PF_CB(process_SM100Status2)); - register_telegram_type(0x0380, F("SM100CollectorConfig"), true, MAKE_PF_CB(process_SM100CollectorConfig)); - register_telegram_type(0x038E, F("SM100Energy"), true, MAKE_PF_CB(process_SM100Energy)); - register_telegram_type(0x0391, F("SM100Time"), true, MAKE_PF_CB(process_SM100Time)); - register_telegram_type(0x035F, F("SM100Config1"), true, MAKE_PF_CB(process_SM100Config1)); - register_telegram_type(0x035C, F("SM100HeatAssist"), true, MAKE_PF_CB(process_SM100HeatAssist)); - register_telegram_type(0x0361, F("SM100Differential"), true, MAKE_PF_CB(process_SM100Differential)); + // register_telegram_type(0xF9, ("ParamCfg"), false, MAKE_PF_CB(process_SM100ParamCfg)); + register_telegram_type(0x0358, ("SM100SystemConfig"), true, MAKE_PF_CB(process_SM100SystemConfig)); + register_telegram_type(0x035A, ("SM100CircuitConfig"), true, MAKE_PF_CB(process_SM100CircuitConfig)); + register_telegram_type(0x035D, ("SM100Circuit2Config"), true, MAKE_PF_CB(process_SM100Circuit2Config)); + register_telegram_type(0x0362, ("SM100Monitor"), false, MAKE_PF_CB(process_SM100Monitor)); + register_telegram_type(0x0363, ("SM100Monitor2"), false, MAKE_PF_CB(process_SM100Monitor2)); + register_telegram_type(0x0366, ("SM100Config"), false, MAKE_PF_CB(process_SM100Config)); + register_telegram_type(0x0364, ("SM100Status"), false, MAKE_PF_CB(process_SM100Status)); + register_telegram_type(0x036A, ("SM100Status2"), false, MAKE_PF_CB(process_SM100Status2)); + register_telegram_type(0x0380, ("SM100CollectorConfig"), true, MAKE_PF_CB(process_SM100CollectorConfig)); + register_telegram_type(0x038E, ("SM100Energy"), true, MAKE_PF_CB(process_SM100Energy)); + register_telegram_type(0x0391, ("SM100Time"), true, MAKE_PF_CB(process_SM100Time)); + register_telegram_type(0x035F, ("SM100Config1"), true, MAKE_PF_CB(process_SM100Config1)); + register_telegram_type(0x035C, ("SM100HeatAssist"), true, MAKE_PF_CB(process_SM100HeatAssist)); + register_telegram_type(0x0361, ("SM100Differential"), true, MAKE_PF_CB(process_SM100Differential)); } } if (flags == EMSdevice::EMS_DEVICE_FLAG_ISM) { - register_telegram_type(0x0103, F("ISM1StatusMessage"), true, MAKE_PF_CB(process_ISM1StatusMessage)); - register_telegram_type(0x0101, F("ISM1Set"), true, MAKE_PF_CB(process_ISM1Set)); - register_telegram_type(0x0104, F("ISM2StatusMessage"), false, MAKE_PF_CB(process_ISM2StatusMessage)); + register_telegram_type(0x0103, ("ISM1StatusMessage"), true, MAKE_PF_CB(process_ISM1StatusMessage)); + register_telegram_type(0x0101, ("ISM1Set"), true, MAKE_PF_CB(process_ISM1Set)); + register_telegram_type(0x0104, ("ISM2StatusMessage"), false, MAKE_PF_CB(process_ISM2StatusMessage)); } // device values... @@ -664,7 +664,7 @@ void Solar::process_SM100ParamCfg(std::shared_ptr telegram) { telegram->read_value(max, 13); telegram->read_value(cur, 17); - // LOG_DEBUG(F("SM100ParamCfg param=0x%04X, offset=%d, min=%d, default=%d, max=%d, current=%d"), t_id, of, min, def, max, cur)); + // LOG_DEBUG(("SM100ParamCfg param=0x%04X, offset=%d, min=%d, default=%d, max=%d, current=%d"), t_id, of, min, def, max, cur)); } /* diff --git a/src/devices/switch.cpp b/src/devices/switch.cpp index 0309b0fcd..4f2edd589 100644 --- a/src/devices/switch.cpp +++ b/src/devices/switch.cpp @@ -25,9 +25,9 @@ REGISTER_FACTORY(Switch, EMSdevice::DeviceType::SWITCH); Switch::Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand) : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { // WM10 module, device_id 0x11 - register_telegram_type(0x9C, F("WM10MonitorMessage"), false, MAKE_PF_CB(process_WM10MonitorMessage)); - register_telegram_type(0x9D, F("WM10SetMessage"), false, MAKE_PF_CB(process_WM10SetMessage)); - register_telegram_type(0x1E, F("WM10TempMessage"), false, MAKE_PF_CB(process_WM10TempMessage)); + register_telegram_type(0x9C, ("WM10MonitorMessage"), false, MAKE_PF_CB(process_WM10MonitorMessage)); + register_telegram_type(0x9D, ("WM10SetMessage"), false, MAKE_PF_CB(process_WM10SetMessage)); + register_telegram_type(0x1E, ("WM10TempMessage"), false, MAKE_PF_CB(process_WM10TempMessage)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &activated_, DeviceValueType::BOOL, FL_(activated), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 064194977..b67926910 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -30,31 +30,31 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i // RF remote sensor seen at 0x40, maybe this is also for different hc with id 0x40 - 0x47? emsesp.cpp maps only 0x40 if (device_id >= 0x40 && device_id <= 0x47) { - register_telegram_type(0x0435, F("RFTemp"), false, MAKE_PF_CB(process_RemoteTemp)); + register_telegram_type(0x0435, ("RFTemp"), false, MAKE_PF_CB(process_RemoteTemp)); return; } // remote thermostats with humidity: RC100H remote if (device_id >= 0x38 && device_id <= 0x3F) { - register_telegram_type(0x042B, F("RemoteTemp"), false, MAKE_PF_CB(process_RemoteTemp)); - register_telegram_type(0x047B, F("RemoteHumidity"), false, MAKE_PF_CB(process_RemoteHumidity)); - register_telegram_type(0x0273, F("RemoteCorrection"), true, MAKE_PF_CB(process_RemoteCorrection)); + register_telegram_type(0x042B, ("RemoteTemp"), false, MAKE_PF_CB(process_RemoteTemp)); + register_telegram_type(0x047B, ("RemoteHumidity"), false, MAKE_PF_CB(process_RemoteHumidity)); + register_telegram_type(0x0273, ("RemoteCorrection"), true, MAKE_PF_CB(process_RemoteCorrection)); register_device_values(); // register device values for common values (not heating circuit) return; // no values to add } // common telegram handlers - register_telegram_type(EMS_TYPE_RCOutdoorTemp, F("RCOutdoorTemp"), false, MAKE_PF_CB(process_RCOutdoorTemp)); - register_telegram_type(EMS_TYPE_RCTime, F("RCTime"), false, MAKE_PF_CB(process_RCTime)); - register_telegram_type(0xA2, F("RCError"), false, MAKE_PF_CB(process_RCError)); - register_telegram_type(0x12, F("RCErrorMessage"), false, MAKE_PF_CB(process_RCErrorMessage)); - register_telegram_type(0x13, F("RCErrorMessage2"), false, MAKE_PF_CB(process_RCErrorMessage)); + register_telegram_type(EMS_TYPE_RCOutdoorTemp, ("RCOutdoorTemp"), false, MAKE_PF_CB(process_RCOutdoorTemp)); + register_telegram_type(EMS_TYPE_RCTime, ("RCTime"), false, MAKE_PF_CB(process_RCTime)); + register_telegram_type(0xA2, ("RCError"), false, MAKE_PF_CB(process_RCError)); + register_telegram_type(0x12, ("RCErrorMessage"), false, MAKE_PF_CB(process_RCErrorMessage)); + register_telegram_type(0x13, ("RCErrorMessage2"), false, MAKE_PF_CB(process_RCErrorMessage)); // RC10 if (model == EMSdevice::EMS_DEVICE_FLAG_RC10) { monitor_typeids = {0xB1}; set_typeids = {0xB0}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("RC10Monitor"), false, MAKE_PF_CB(process_RC10Monitor)); - register_telegram_type(set_typeids[i], F("RC10Set"), false, MAKE_PF_CB(process_RC10Set)); + register_telegram_type(monitor_typeids[i], ("RC10Monitor"), false, MAKE_PF_CB(process_RC10Monitor)); + register_telegram_type(set_typeids[i], ("RC10Set"), false, MAKE_PF_CB(process_RC10Set)); } // RC35 @@ -64,15 +64,15 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i timer_typeids = {0x3F, 0x49, 0x53, 0x5D}; timer2_typeids = {0x42, 0x4C, 0x56, 0x60}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("RC35Monitor"), false, MAKE_PF_CB(process_RC35Monitor)); - register_telegram_type(set_typeids[i], F("RC35Set"), false, MAKE_PF_CB(process_RC35Set)); - register_telegram_type(timer_typeids[i], F("RC35Timer"), false, MAKE_PF_CB(process_RC35Timer)); - register_telegram_type(timer2_typeids[i], F("RC35Timer2"), false, MAKE_PF_CB(process_RC35Timer)); + register_telegram_type(monitor_typeids[i], ("RC35Monitor"), false, MAKE_PF_CB(process_RC35Monitor)); + register_telegram_type(set_typeids[i], ("RC35Set"), false, MAKE_PF_CB(process_RC35Set)); + register_telegram_type(timer_typeids[i], ("RC35Timer"), false, MAKE_PF_CB(process_RC35Timer)); + register_telegram_type(timer2_typeids[i], ("RC35Timer2"), false, MAKE_PF_CB(process_RC35Timer)); } - register_telegram_type(EMS_TYPE_IBASettings, F("IBASettings"), true, MAKE_PF_CB(process_IBASettings)); - register_telegram_type(EMS_TYPE_wwSettings, F("WWSettings"), true, MAKE_PF_CB(process_RC35wwSettings)); - register_telegram_type(0x38, F("WWTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); - register_telegram_type(0x39, F("WWCircTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); + register_telegram_type(EMS_TYPE_IBASettings, ("IBASettings"), true, MAKE_PF_CB(process_IBASettings)); + register_telegram_type(EMS_TYPE_wwSettings, ("WWSettings"), true, MAKE_PF_CB(process_RC35wwSettings)); + register_telegram_type(0x38, ("WWTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); + register_telegram_type(0x39, ("WWCircTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); // RC20 } else if (model == EMSdevice::EMS_DEVICE_FLAG_RC20) { @@ -81,22 +81,22 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i curve_typeids = {0x90}; timer_typeids = {0x8F}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("RC20Monitor"), false, MAKE_PF_CB(process_RC20Monitor)); - register_telegram_type(set_typeids[i], F("RC20Set"), false, MAKE_PF_CB(process_RC20Set)); - register_telegram_type(curve_typeids[i], F("RC20Temp"), false, MAKE_PF_CB(process_RC20Temp)); - register_telegram_type(timer_typeids[i], F("RC20Timer"), false, MAKE_PF_CB(process_RC20Timer)); + register_telegram_type(monitor_typeids[i], ("RC20Monitor"), false, MAKE_PF_CB(process_RC20Monitor)); + register_telegram_type(set_typeids[i], ("RC20Set"), false, MAKE_PF_CB(process_RC20Set)); + register_telegram_type(curve_typeids[i], ("RC20Temp"), false, MAKE_PF_CB(process_RC20Temp)); + register_telegram_type(timer_typeids[i], ("RC20Timer"), false, MAKE_PF_CB(process_RC20Timer)); } // remote thermostat uses only 0xAF - register_telegram_type(0xAF, F("RC20Remote"), false, MAKE_PF_CB(process_RC20Remote)); + register_telegram_type(0xAF, ("RC20Remote"), false, MAKE_PF_CB(process_RC20Remote)); // RC20 newer } else if ((model == EMSdevice::EMS_DEVICE_FLAG_RC20_N) || (model == EMSdevice::EMS_DEVICE_FLAG_RC25)) { monitor_typeids = {0xAE}; set_typeids = {0xAD}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("RC20Monitor"), false, MAKE_PF_CB(process_RC20Monitor_2)); - register_telegram_type(set_typeids[i], F("RC20Set"), false, MAKE_PF_CB(process_RC20Set_2)); + register_telegram_type(monitor_typeids[i], ("RC20Monitor"), false, MAKE_PF_CB(process_RC20Monitor_2)); + register_telegram_type(set_typeids[i], ("RC20Set"), false, MAKE_PF_CB(process_RC20Set_2)); } - register_telegram_type(0xAF, F("RC20Remote"), false, MAKE_PF_CB(process_RC20Remote)); + register_telegram_type(0xAF, ("RC20Remote"), false, MAKE_PF_CB(process_RC20Remote)); // RC30 } else if (model == EMSdevice::EMS_DEVICE_FLAG_RC30) { monitor_typeids = {0x41}; @@ -104,27 +104,27 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i curve_typeids = {0x40}; timer_typeids = {0x3F}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("RC30Monitor"), false, MAKE_PF_CB(process_RC30Monitor)); - register_telegram_type(set_typeids[i], F("RC30Set"), false, MAKE_PF_CB(process_RC30Set)); - register_telegram_type(curve_typeids[i], F("RC30Temp"), false, MAKE_PF_CB(process_RC30Temp)); - register_telegram_type(timer_typeids[i], F("RC30Timer"), false, MAKE_PF_CB(process_RC35Timer)); + register_telegram_type(monitor_typeids[i], ("RC30Monitor"), false, MAKE_PF_CB(process_RC30Monitor)); + register_telegram_type(set_typeids[i], ("RC30Set"), false, MAKE_PF_CB(process_RC30Set)); + register_telegram_type(curve_typeids[i], ("RC30Temp"), false, MAKE_PF_CB(process_RC30Temp)); + register_telegram_type(timer_typeids[i], ("RC30Timer"), false, MAKE_PF_CB(process_RC35Timer)); } - register_telegram_type(EMS_TYPE_RC30wwSettings, F("RC30WWSettings"), true, MAKE_PF_CB(process_RC30wwSettings)); - register_telegram_type(0x38, F("WWTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); - register_telegram_type(0x39, F("WWCircTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); + register_telegram_type(EMS_TYPE_RC30wwSettings, ("RC30WWSettings"), true, MAKE_PF_CB(process_RC30wwSettings)); + register_telegram_type(0x38, ("WWTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); + register_telegram_type(0x39, ("WWCircTimer"), true, MAKE_PF_CB(process_RC35wwTimer)); // EASY } else if (model == EMSdevice::EMS_DEVICE_FLAG_EASY) { monitor_typeids = {0x0A}; set_typeids = {}; - register_telegram_type(monitor_typeids[0], F("EasyMonitor"), true, MAKE_PF_CB(process_EasyMonitor)); + register_telegram_type(monitor_typeids[0], ("EasyMonitor"), true, MAKE_PF_CB(process_EasyMonitor)); // CRF } else if (model == EMSdevice::EMS_DEVICE_FLAG_CRF) { monitor_typeids = {0x02A5, 0x02A6, 0x02A7, 0x02A8}; set_typeids = {}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("CRFMonitor"), false, MAKE_PF_CB(process_CRFMonitor)); + register_telegram_type(monitor_typeids[i], ("CRFMonitor"), false, MAKE_PF_CB(process_CRFMonitor)); } // RC300/RC100 @@ -136,46 +136,46 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i curve_typeids = {0x029B, 0x029C, 0x029D, 0x029E, 0x029F, 0x02A0, 0x02A1, 0x02A2}; summer2_typeids = {0x0471, 0x0472, 0x0473, 0x0474, 0x0475, 0x0476, 0x0477, 0x0478}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("RC300Monitor"), false, MAKE_PF_CB(process_RC300Monitor)); - register_telegram_type(set_typeids[i], F("RC300Set"), false, MAKE_PF_CB(process_RC300Set)); - register_telegram_type(summer_typeids[i], F("RC300Summer"), false, MAKE_PF_CB(process_RC300Summer)); - register_telegram_type(curve_typeids[i], F("RC300Curves"), false, MAKE_PF_CB(process_RC300Curve)); - register_telegram_type(summer2_typeids[i], F("RC300Summer2"), false, MAKE_PF_CB(process_RC300Summer2)); + register_telegram_type(monitor_typeids[i], ("RC300Monitor"), false, MAKE_PF_CB(process_RC300Monitor)); + register_telegram_type(set_typeids[i], ("RC300Set"), false, MAKE_PF_CB(process_RC300Set)); + register_telegram_type(summer_typeids[i], ("RC300Summer"), false, MAKE_PF_CB(process_RC300Summer)); + register_telegram_type(curve_typeids[i], ("RC300Curves"), false, MAKE_PF_CB(process_RC300Curve)); + register_telegram_type(summer2_typeids[i], ("RC300Summer2"), false, MAKE_PF_CB(process_RC300Summer2)); } for (uint8_t i = 0; i < set2_typeids.size(); i++) { - register_telegram_type(set2_typeids[i], F("RC300Set2"), false, MAKE_PF_CB(process_RC300Set2)); + register_telegram_type(set2_typeids[i], ("RC300Set2"), false, MAKE_PF_CB(process_RC300Set2)); } - register_telegram_type(0x2F5, F("RC300WWmode"), true, MAKE_PF_CB(process_RC300WWmode)); - register_telegram_type(0x31B, F("RC300WWtemp"), true, MAKE_PF_CB(process_RC300WWtemp)); - register_telegram_type(0x31D, F("RC300WWmode2"), false, MAKE_PF_CB(process_RC300WWmode2)); - register_telegram_type(0x31E, F("RC300WWmode2"), false, MAKE_PF_CB(process_RC300WWmode2)); - register_telegram_type(0x23A, F("RC300OutdoorTemp"), true, MAKE_PF_CB(process_RC300OutdoorTemp)); - register_telegram_type(0x267, F("RC300Floordry"), false, MAKE_PF_CB(process_RC300Floordry)); - register_telegram_type(0x240, F("RC300Settings"), true, MAKE_PF_CB(process_RC300Settings)); + register_telegram_type(0x2F5, ("RC300WWmode"), true, MAKE_PF_CB(process_RC300WWmode)); + register_telegram_type(0x31B, ("RC300WWtemp"), true, MAKE_PF_CB(process_RC300WWtemp)); + register_telegram_type(0x31D, ("RC300WWmode2"), false, MAKE_PF_CB(process_RC300WWmode2)); + register_telegram_type(0x31E, ("RC300WWmode2"), false, MAKE_PF_CB(process_RC300WWmode2)); + register_telegram_type(0x23A, ("RC300OutdoorTemp"), true, MAKE_PF_CB(process_RC300OutdoorTemp)); + register_telegram_type(0x267, ("RC300Floordry"), false, MAKE_PF_CB(process_RC300Floordry)); + register_telegram_type(0x240, ("RC300Settings"), true, MAKE_PF_CB(process_RC300Settings)); // JUNKERS/HT3 } else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { monitor_typeids = {0x016F, 0x0170, 0x0171, 0x0172}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(monitor_typeids[i], F("JunkersMonitor"), false, MAKE_PF_CB(process_JunkersMonitor)); + register_telegram_type(monitor_typeids[i], ("JunkersMonitor"), false, MAKE_PF_CB(process_JunkersMonitor)); } if (has_flags(EMS_DEVICE_FLAG_JUNKERS_OLD)) { // FR120, FR100 set_typeids = {0x0179, 0x017A, 0x017B, 0x017C}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(set_typeids[i], F("JunkersSet"), false, MAKE_PF_CB(process_JunkersSet2)); + register_telegram_type(set_typeids[i], ("JunkersSet"), false, MAKE_PF_CB(process_JunkersSet2)); } } else { set_typeids = {0x0165, 0x0166, 0x0167, 0x0168}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { - register_telegram_type(set_typeids[i], F("JunkersSet"), false, MAKE_PF_CB(process_JunkersSet)); + register_telegram_type(set_typeids[i], ("JunkersSet"), false, MAKE_PF_CB(process_JunkersSet)); } } - register_telegram_type(0xBB, F("HybridSettings"), true, MAKE_PF_CB(process_JunkersHybridSettings)); - register_telegram_type(0x23, F("JunkersSetMixer"), true, MAKE_PF_CB(process_JunkersSetMixer)); - register_telegram_type(0x123, F("JunkersRemote"), false, MAKE_PF_CB(process_JunkersRemoteMonitor)); - register_telegram_type(0x1D3, F("JunkersDhw"), true, MAKE_PF_CB(process_JunkersWW)); + register_telegram_type(0xBB, ("HybridSettings"), true, MAKE_PF_CB(process_JunkersHybridSettings)); + register_telegram_type(0x23, ("JunkersSetMixer"), true, MAKE_PF_CB(process_JunkersSetMixer)); + register_telegram_type(0x123, ("JunkersRemote"), false, MAKE_PF_CB(process_JunkersRemoteMonitor)); + register_telegram_type(0x1D3, ("JunkersDhw"), true, MAKE_PF_CB(process_JunkersWW)); } // register device values for common values (not heating circuit) @@ -593,7 +593,7 @@ void Thermostat::process_RC20Timer(std::shared_ptr telegram) { uint8_t time = telegram->message_data[1]; // we use EN settings for the day abbreviation - std::string sday = read_flash_string(FL_(enum_dayOfWeek)[day][0]); + std::string sday = (FL_(enum_dayOfWeek)[day][0]); // std::string sday = Helpers::translated_word(FL_(enum_dayOfWeek)[day]); if (day == 7) { @@ -794,7 +794,7 @@ void Thermostat::process_RC35wwTimer(std::shared_ptr telegram) { char data[sizeof(wwSwitchTime_)]; // we use EN settings for the day abbreviation - std::string sday = read_flash_string(FL_(enum_dayOfWeek)[day][0]); + std::string sday = (FL_(enum_dayOfWeek)[day][0]); // std::string sday = Helpers::translated_word(FL_(enum_dayOfWeek)[day]); if (day == 7) { snprintf(data, sizeof(data), "%02d not_set", no); @@ -1272,7 +1272,7 @@ void Thermostat::process_RC35Timer(std::shared_ptr telegram) { uint8_t time = telegram->message_data[1]; // we use EN settings for the day abbreviation - std::string sday = read_flash_string(FL_(enum_dayOfWeek)[day][0]); + std::string sday = (FL_(enum_dayOfWeek)[day][0]); // std::string sday = Helpers::translated_word(FL_(enum_dayOfWeek)[day]); if (day == 7) { snprintf(data, sizeof(data), "%02d not_set", no); @@ -1369,7 +1369,7 @@ void Thermostat::process_RCTime(std::shared_ptr telegram) { double difference = difftime(now, ttime); if (difference > 15 || difference < -15) { set_datetime("ntp", -1); // set from NTP - LOG_INFO(F("thermostat time correction from ntp")); + LOG_INFO(("thermostat time correction from ntp")); } } #ifndef EMSESP_STANDALONE @@ -1380,7 +1380,7 @@ void Thermostat::process_RCTime(std::shared_ptr telegram) { } struct timeval newnow = {.tv_sec = ttime}; settimeofday(&newnow, nullptr); - LOG_INFO(F("ems-esp time set from thermostat")); + LOG_INFO(("ems-esp time set from thermostat")); } #endif } @@ -1548,7 +1548,7 @@ bool Thermostat::set_calinttemp(const char * value, const int8_t id) { } auto t = (int8_t)(ct * 10); - LOG_DEBUG(F("Calibrating internal temperature to %d.%d C"), t / 10, t < 0 ? -t % 10 : t % 10); + LOG_DEBUG(("Calibrating internal temperature to %d.%d C"), t / 10, t < 0 ? -t % 10 : t % 10); if (model() == EMS_DEVICE_FLAG_RC10) { write_command(0xB0, 0, t, 0xB0); @@ -2132,7 +2132,7 @@ bool Thermostat::set_datetime(const char * value, const int8_t id) { return false; } if (!EMSESP::system_.ntp_connected()) { - LOG_WARNING(F("Set date: no valid NTP data, setting from ESP Clock")); + LOG_WARNING(("Set date: no valid NTP data, setting from ESP Clock")); } data[0] = tm_->tm_year - 100; // Bosch counts from 2000 @@ -2153,15 +2153,15 @@ bool Thermostat::set_datetime(const char * value, const int8_t id) { data[6] = (dt[20] - '0'); // day of week, Mo:0 data[7] = (dt[22] - '0') + 2; // DST and flag } else { - LOG_WARNING(F("Set date: invalid data, wrong length")); + LOG_WARNING(("Set date: invalid data, wrong length")); return false; } if (data[1] == 0 || data[1] > 12 || data[2] > 23 || data[3] == 0 || data[3] > 31 || data[4] > 59 || data[5] > 59 || data[6] > 6 || data[7] > 3) { - LOG_WARNING(F("Invalid date/time: %02d.%02d.2%03d-%02d:%02d:%02d-%d-%d"), data[3], data[1], data[0], data[2], data[4], data[5], data[6], data[7]); + LOG_WARNING(("Invalid date/time: %02d.%02d.2%03d-%02d:%02d:%02d-%d-%d"), data[3], data[1], data[0], data[2], data[4], data[5], data[6], data[7]); return false; } - // LOG_INFO(F("Setting date and time: %02d.%02d.2%03d-%02d:%02d:%02d-%d-%d"), data[3], data[1], data[0], data[2], data[4], data[5], data[6], data[7]); + // LOG_INFO(("Setting date and time: %02d.%02d.2%03d-%02d:%02d:%02d-%d-%d"), data[3], data[1], data[0], data[2], data[4], data[5], data[6], data[7]); write_command(EMS_TYPE_time, 0, data, 8, EMS_TYPE_time); return true; @@ -2634,7 +2634,7 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char day = 7; on = 7; time = 0x90; - // LOG_INFO(F("switchtime %02d cleared"), no); + // LOG_INFO(("switchtime %02d cleared"), no); } } else { if (strlen(value) > 1) { @@ -2651,7 +2651,7 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char if (strlen(value) > 4) { for (uint8_t i = 0; i < 7; i++) { // we use EN settings for the day abbreviation - if (!strncmp(&value[3], read_flash_string(FL_(enum_dayOfWeek)[i][0]).c_str(), 2)) { + if (!strncmp(&value[3], (FL_(enum_dayOfWeek)[i][0]), 2)) { day = i; } @@ -2675,7 +2675,7 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char day = 7; on = 7; time = 0x90; - // LOG_INFO(F("switchtime %02d cleared"), no); + // LOG_INFO(("switchtime %02d cleared"), no); } } uint8_t data[2] = {0xE7, 0x90}; // unset switchtime @@ -2691,20 +2691,20 @@ bool Thermostat::set_switchtime(const char * value, const uint16_t type_id, char max_on = 1; } if (no > 41 || time > 0x90 || ((on < min_on || on > max_on) && on != 7)) { - // LOG_WARNING(F("Setting switchtime: Invalid data: %s"), value); - // LOG_WARNING(F("Setting switchtime: Invalid data: %02d.%1d.0x%02X.%1d"), no, day, time, on); + // LOG_WARNING(("Setting switchtime: Invalid data: %s"), value); + // LOG_WARNING(("Setting switchtime: Invalid data: %02d.%1d.0x%02X.%1d"), no, day, time, on); return false; } if (data[0] != 0xE7) { // we use EN settings for the day abbreviation - std::string sday = read_flash_string(FL_(enum_dayOfWeek)[day][0]); + std::string sday = (FL_(enum_dayOfWeek)[day][0]); // std::string sday = Helpers::translated_word(FL_(enum_dayOfWeek)[day]); if (model() == EMS_DEVICE_FLAG_RC35 || model() == EMS_DEVICE_FLAG_RC30_N) { snprintf(out, len, "%02d %s %02d:%02d %s", no, sday.c_str(), time / 6, 10 * (time % 6), on ? "on" : "off"); } else if ((model() == EMS_DEVICE_FLAG_RC20) || (model() == EMS_DEVICE_FLAG_RC30)) { snprintf(out, len, "%02d %s %02d:%02d T%d", no, sday.c_str(), time / 6, 10 * (time % 6), on); } else { - std::string son = read_flash_string(FL_(enum_switchmode)[on][0]); + std::string son = (FL_(enum_switchmode)[on][0]); // std::string son = Helpers::translated_word(FL_(enum_switchmode)[on]); snprintf(out, len, "%02d %s %02d:%02d %s", no, sday.c_str(), time / 6, 10 * (time % 6), son.c_str()); } diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 2a8a8321d..d0f259d8d 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -44,39 +44,39 @@ bool EMSdevice::has_entities() const { } std::string EMSdevice::tag_to_string(uint8_t tag) { - return read_flash_string(DeviceValue::DeviceValueTAG_s[tag]); + return (DeviceValue::DeviceValueTAG_s[tag]); } std::string EMSdevice::tag_to_mqtt(uint8_t tag) { - return read_flash_string(DeviceValue::DeviceValueTAG_mqtt[tag]); + return (DeviceValue::DeviceValueTAG_mqtt[tag]); } // convert UOM to a string - these don't need translating std::string EMSdevice::uom_to_string(uint8_t uom) { if (EMSESP::system_.fahrenheit() && (uom == DeviceValueUOM::DEGREES || uom == DeviceValueUOM::DEGREES_R)) { - return read_flash_string(DeviceValue::DeviceValueUOM_s[DeviceValueUOM::FAHRENHEIT]); + return (DeviceValue::DeviceValueUOM_s[DeviceValueUOM::FAHRENHEIT]); } - return read_flash_string(DeviceValue::DeviceValueUOM_s[uom]); + return (DeviceValue::DeviceValueUOM_s[uom]); } std::string EMSdevice::brand_to_string() const { switch (brand_) { case EMSdevice::Brand::BOSCH: - return read_flash_string(F("Bosch")); + return (("Bosch")); case EMSdevice::Brand::JUNKERS: - return read_flash_string(F("Junkers")); + return (("Junkers")); case EMSdevice::Brand::BUDERUS: - return read_flash_string(F("Buderus")); + return (("Buderus")); case EMSdevice::Brand::NEFIT: - return read_flash_string(F("Nefit")); + return (("Nefit")); case EMSdevice::Brand::SIEGER: - return read_flash_string(F("Sieger")); + return (("Sieger")); case EMSdevice::Brand::WORCESTER: - return read_flash_string(F("Worcester")); + return (("Worcester")); case EMSdevice::Brand::IVT: - return read_flash_string(F("IVT")); + return (("IVT")); default: - return read_flash_string(F("")); + return (("")); } } @@ -84,29 +84,29 @@ std::string EMSdevice::brand_to_string() const { std::string EMSdevice::device_type_2_device_name(const uint8_t device_type) { switch (device_type) { case DeviceType::SYSTEM: - return read_flash_string(F_(system)); + return (F_(system)); case DeviceType::BOILER: - return read_flash_string(F_(boiler)); + return (F_(boiler)); case DeviceType::THERMOSTAT: - return read_flash_string(F_(thermostat)); + return (F_(thermostat)); case DeviceType::HEATPUMP: - return read_flash_string(F_(heatpump)); + return (F_(heatpump)); case DeviceType::SOLAR: - return read_flash_string(F_(solar)); + return (F_(solar)); case DeviceType::CONNECT: - return read_flash_string(F_(connect)); + return (F_(connect)); case DeviceType::MIXER: - return read_flash_string(F_(mixer)); + return (F_(mixer)); case DeviceType::DALLASSENSOR: - return read_flash_string(F_(dallassensor)); + return (F_(dallassensor)); case DeviceType::ANALOGSENSOR: - return read_flash_string(F_(analogsensor)); + return (F_(analogsensor)); case DeviceType::CONTROLLER: - return read_flash_string(F_(controller)); + return (F_(controller)); case DeviceType::SWITCH: - return read_flash_string(F_(switch)); + return (F_(switch)); case DeviceType::GATEWAY: - return read_flash_string(F_(gateway)); + return (F_(gateway)); default: return Helpers::translated_word(FL_(unknown)); } @@ -215,7 +215,7 @@ std::string EMSdevice::to_string_short() const { // for each telegram that has the fetch value set (true) do a read request void EMSdevice::fetch_values() { - EMSESP::logger().debug(F("Fetching values for deviceID 0x%02X"), device_id()); + EMSESP::logger().debug(("Fetching values for deviceID 0x%02X"), device_id()); for (const auto & tf : telegram_functions_) { if (tf.fetch_) { @@ -226,7 +226,7 @@ void EMSdevice::fetch_values() { // toggle on/off automatic fetch for a telegramID void EMSdevice::toggle_fetch(uint16_t telegram_id, bool toggle) { - EMSESP::logger().debug(F("Toggling fetch for deviceID 0x%02X, telegramID 0x%02X to %d"), device_id(), telegram_id, toggle); + EMSESP::logger().debug(("Toggling fetch for deviceID 0x%02X, telegramID 0x%02X to %d"), device_id(), telegram_id, toggle); for (auto & tf : telegram_functions_) { if (tf.telegram_type_id_ == telegram_id) { @@ -264,9 +264,9 @@ void EMSdevice::list_device_entries(JsonObject & output) const { // if we have a tag prefix it char key[50]; if (!EMSdevice::tag_to_mqtt(dv.tag).empty()) { - snprintf(key, sizeof(key), "%s.%s", EMSdevice::tag_to_mqtt(dv.tag).c_str(), read_flash_string(dv.short_name).c_str()); + snprintf(key, sizeof(key), "%s.%s", EMSdevice::tag_to_mqtt(dv.tag).c_str(), (dv.short_name)); } else { - snprintf(key, sizeof(key), "%s", read_flash_string(dv.short_name).c_str()); + snprintf(key, sizeof(key), "%s", (dv.short_name)); } JsonArray details = output.createNestedArray(key); @@ -289,7 +289,7 @@ void EMSdevice::show_telegram_handlers(uuid::console::Shell & shell) const { } /* // colored list of type-ids - shell.printf(F(" This %s will listen to telegram type IDs: "), device_type_name().c_str()); + shell.printf((" This %s will listen to telegram type IDs: "), device_type_name().c_str()); for (const auto & tf : telegram_functions_) { if (tf.received_ && !tf.fetch_) { shell.printf(COLOR_BRIGHT_GREEN); @@ -298,34 +298,34 @@ void EMSdevice::show_telegram_handlers(uuid::console::Shell & shell) const { } else { shell.printf(COLOR_BRIGHT_RED); } - shell.printf(F("0x%02X "), tf.telegram_type_id_); + shell.printf(("0x%02X "), tf.telegram_type_id_); } shell.printf(COLOR_RESET); */ - shell.printf(F(" Received telegram type IDs: ")); + shell.printf((" Received telegram type IDs: ")); for (const auto & tf : telegram_functions_) { if (tf.received_ && !tf.fetch_) { - shell.printf(F("0x%02X "), tf.telegram_type_id_); + shell.printf(("0x%02X "), tf.telegram_type_id_); } } shell.println(); - shell.printf(F(" Fetched telegram type IDs: ")); + shell.printf((" Fetched telegram type IDs: ")); for (const auto & tf : telegram_functions_) { if (tf.fetch_) { - shell.printf(F("0x%02X "), tf.telegram_type_id_); + shell.printf(("0x%02X "), tf.telegram_type_id_); } } shell.println(); - shell.printf(F(" Pending telegram type IDs: ")); + shell.printf((" Pending telegram type IDs: ")); for (const auto & tf : telegram_functions_) { if (!tf.received_ && !tf.fetch_) { - shell.printf(F("0x%02X "), tf.telegram_type_id_); + shell.printf(("0x%02X "), tf.telegram_type_id_); } } shell.println(); - shell.printf(F(" Ignored telegram type IDs: ")); + shell.printf((" Ignored telegram type IDs: ")); for (auto handlers : handlers_ignored_) { - shell.printf(F("0x%02X "), handlers); + shell.printf(("0x%02X "), handlers); } shell.println(); } @@ -379,7 +379,7 @@ void EMSdevice::show_mqtt_handlers(uuid::console::Shell & shell) const { } // register a callback function for a specific telegram type -void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, const process_function_p f) { +void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p f) { telegram_functions_.emplace_back(telegram_type_id, telegram_type_name, fetch, false, f); } @@ -397,21 +397,21 @@ void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const __ // has_cmd: true if this is an associated command // min: min allowed value // max: max allowed value -void EMSdevice::add_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * options_single, - int8_t numeric_operator, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max) { +void EMSdevice::add_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * options_single, + int8_t numeric_operator, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max) { bool has_cmd = (f != nullptr); - auto short_name = name[0]; - const class __FlashStringHelper * const * fullname = &name[1]; // translations start at index 1 + auto short_name = name[0]; + auto fullname = &name[1]; // translations start at index 1 // initialize the device value depending on it's type if (type == DeviceValueType::STRING) { @@ -440,7 +440,7 @@ void EMSdevice::add_device_value(uint8_t tag, EMSESP::webCustomizationService.read([&](WebCustomization & settings) { for (EntityCustomization entityCustomization : settings.entityCustomizations) { if ((entityCustomization.product_id == product_id()) && (entityCustomization.device_id == device_id())) { - std::string entity = tag < DeviceValueTAG::TAG_HC1 ? read_flash_string(short_name) : tag_to_string(tag) + "/" + read_flash_string(short_name); + std::string entity = tag < DeviceValueTAG::TAG_HC1 ? (short_name) : tag_to_string(tag) + "/" + (short_name); for (std::string entity_id : entityCustomization.entity_ids) { // if there is an appended custom name, strip it to get the true entity name // and extract the new custom name @@ -490,107 +490,102 @@ void EMSdevice::add_device_value(uint8_t tag, // add the command to our library // cmd is the short_name and the description is the fullname (not the custom fullname) - Command::add(device_type_, short_name, f, Helpers::translated_fword(fullname), flags); + Command::add(device_type_, short_name, f, Helpers::translated_word(fullname).c_str(), flags); } // single list of options -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * options_single, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const * options_single, + const char * const * name, + uint8_t uom, + const cmd_function_p f) { // create a multi-list from the options add_device_value(tag, value_p, type, nullptr, options_single, 0, name, uom, f, 0, 0); }; // single list of options, with no translations, with min and max -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * options_single, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const * options_single, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max) { // create a multi-list from the options add_device_value(tag, value_p, type, nullptr, options_single, 0, name, uom, f, min, max); }; -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - int8_t numeric_operator, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + int8_t numeric_operator, + const char * const * name, + uint8_t uom, + const cmd_function_p f) { add_device_value(tag, value_p, type, nullptr, nullptr, numeric_operator, name, uom, f, 0, 0); } -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - int8_t numeric_operator, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + int8_t numeric_operator, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max) { add_device_value(tag, value_p, type, nullptr, nullptr, numeric_operator, name, uom, f, min, max); } // no options, no function -void EMSdevice::register_device_value(uint8_t tag, void * value_p, uint8_t type, const __FlashStringHelper * const * name, uint8_t uom, const cmd_function_p f) { +void EMSdevice::register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const * name, uint8_t uom, const cmd_function_p f) { add_device_value(tag, value_p, type, nullptr, nullptr, 0, name, uom, f, 0, 0); }; // no options, with min/max -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max) { add_device_value(tag, value_p, type, nullptr, nullptr, 0, name, uom, f, min, max); }; // function with min and max values // adds a new command to the command list // in this function we separate out the short and long names and take any translations -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max) { add_device_value(tag, value_p, type, options, nullptr, 0, name, uom, f, min, max); } // function with no min and max values (set to 0) -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f) { +void EMSdevice::register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * name, + uint8_t uom, + const cmd_function_p f) { add_device_value(tag, value_p, type, options, nullptr, 0, name, uom, f, 0, 0); } // no associated command function, or min/max values -void EMSdevice::register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * name, - uint8_t uom) { +void EMSdevice::register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const ** options, const char * const * name, uint8_t uom) { add_device_value(tag, value_p, type, options, nullptr, 0, name, uom, nullptr, 0, 0); } @@ -609,7 +604,7 @@ bool EMSdevice::is_readonly(const std::string & cmd, const int8_t id) const { uint8_t tag = id > 0 ? DeviceValueTAG::TAG_HC1 + id - 1 : DeviceValueTAG::TAG_NONE; for (const auto & dv : devicevalues_) { // check command name and tag, id -1 is default hc and only checks name - if (dv.has_cmd && read_flash_string(dv.short_name) == cmd && (dv.tag < DeviceValueTAG::TAG_HC1 || dv.tag == tag || id == -1)) { + if (dv.has_cmd && std::string(dv.short_name) == cmd && (dv.tag < DeviceValueTAG::TAG_HC1 || dv.tag == tag || id == -1)) { return dv.has_state(DeviceValueState::DV_READONLY); } } @@ -637,24 +632,14 @@ void EMSdevice::publish_value(void * value_p) const { char topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; if (Mqtt::publish_single2cmd()) { if (dv.tag >= DeviceValueTAG::TAG_HC1) { - snprintf(topic, - sizeof(topic), - "%s/%s/%s", - device_type_2_device_name(device_type_).c_str(), - tag_to_mqtt(dv.tag).c_str(), - read_flash_string(dv.short_name).c_str()); + snprintf(topic, sizeof(topic), "%s/%s/%s", device_type_2_device_name(device_type_).c_str(), tag_to_mqtt(dv.tag).c_str(), (dv.short_name)); } else { - snprintf(topic, sizeof(topic), "%s/%s", device_type_2_device_name(device_type_).c_str(), read_flash_string(dv.short_name).c_str()); + snprintf(topic, sizeof(topic), "%s/%s", device_type_2_device_name(device_type_).c_str(), (dv.short_name)); } } else if (Mqtt::is_nested() && dv.tag >= DeviceValueTAG::TAG_HC1) { - snprintf(topic, - sizeof(topic), - "%s/%s/%s", - Mqtt::tag_to_topic(device_type_, dv.tag).c_str(), - tag_to_mqtt(dv.tag).c_str(), - read_flash_string(dv.short_name).c_str()); + snprintf(topic, sizeof(topic), "%s/%s/%s", Mqtt::tag_to_topic(device_type_, dv.tag).c_str(), tag_to_mqtt(dv.tag).c_str(), (dv.short_name)); } else { - snprintf(topic, sizeof(topic), "%s/%s", Mqtt::tag_to_topic(device_type_, dv.tag).c_str(), read_flash_string(dv.short_name).c_str()); + snprintf(topic, sizeof(topic), "%s/%s", Mqtt::tag_to_topic(device_type_, dv.tag).c_str(), (dv.short_name)); } int8_t num_op = dv.numeric_operator; @@ -724,11 +709,12 @@ std::string EMSdevice::get_value_uom(const char * key) const { char * key_p = new_key; for (uint8_t i = 0; i < DeviceValue::tag_count; i++) { - auto tag = read_flash_string(DeviceValue::DeviceValueTAG_s[i]); - if (!tag.empty()) { - std::string key2 = key; // copy char to a std::string - if ((key2.find(tag) != std::string::npos) && (key[tag.length()] == ' ')) { - key_p += tag.length() + 1; // remove the tag + auto tag = (DeviceValue::DeviceValueTAG_s[i]); + if (tag) { + std::string key2 = key; // copy char to a std::string + auto length = strlen(tag); // TODO check if this still works + if ((key2.find(tag) != std::string::npos) && (key[length] == ' ')) { + key_p += length + 1; // remove the tag break; } } @@ -823,7 +809,7 @@ void EMSdevice::generate_values_web(JsonObject & output) { if (dv.has_cmd && !dv.has_state(DeviceValueState::DV_READONLY)) { // add the name of the Command function if (dv.tag >= DeviceValueTAG::TAG_HC1) { - obj["c"] = tag_to_mqtt(dv.tag) + "/" + read_flash_string(dv.short_name); + obj["c"] = tag_to_mqtt(dv.tag) + "/" + (dv.short_name); } else { obj["c"] = dv.short_name; } @@ -938,9 +924,9 @@ void EMSdevice::generate_values_web_customization(JsonArray & output) { // id holds the shortname and must always have a value for the WebUI table to work if (dv.tag >= DeviceValueTAG::TAG_HC1) { - obj["id"] = tag_to_string(dv.tag) + "/" + read_flash_string(dv.short_name); + obj["id"] = tag_to_string(dv.tag) + "/" + (dv.short_name); } else { - obj["id"] = read_flash_string(dv.short_name); + obj["id"] = (dv.short_name); } // n is the fullname, and can be optional @@ -974,8 +960,7 @@ void EMSdevice::generate_values_web_customization(JsonArray & output) { // returns true if the entity has a mask set (not 0 the default) void EMSdevice::setCustomEntity(const std::string & entity_id) { for (auto & dv : devicevalues_) { - std::string entity_name = - dv.tag < DeviceValueTAG::TAG_HC1 ? read_flash_string(dv.short_name) : tag_to_string(dv.tag) + "/" + read_flash_string(dv.short_name); + std::string entity_name = dv.tag < DeviceValueTAG::TAG_HC1 ? (dv.short_name) : tag_to_string(dv.tag) + "/" + (dv.short_name); // extra shortname std::string shortname; @@ -1017,9 +1002,8 @@ void EMSdevice::setCustomEntity(const std::string & entity_id) { // populate a string vector with entities that have masks set or have a custom name void EMSdevice::getCustomEntities(std::vector & entity_ids) { for (const auto & dv : devicevalues_) { - std::string entity_name = - dv.tag < DeviceValueTAG::TAG_HC1 ? read_flash_string(dv.short_name) : tag_to_string(dv.tag) + "/" + read_flash_string(dv.short_name); - uint8_t mask = dv.state >> 4; + std::string entity_name = dv.tag < DeviceValueTAG::TAG_HC1 ? (dv.short_name) : tag_to_string(dv.tag) + "/" + (dv.short_name); + uint8_t mask = dv.state >> 4; if (mask || !dv.custom_fullname.empty()) { if (dv.custom_fullname.empty()) { @@ -1057,7 +1041,7 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8 // search device value with this tag for (auto & dv : devicevalues_) { - if (strcmp(command_s, Helpers::toLower(read_flash_string(dv.short_name)).c_str()) == 0 && (tag <= 0 || tag == dv.tag)) { + if (!strcmp(command_s, dv.short_name) && (tag <= 0 || tag == dv.tag)) { int8_t num_op = dv.numeric_operator; uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (dv.uom == DeviceValueUOM::DEGREES) ? 2 : (dv.uom == DeviceValueUOM::DEGREES_R) ? 1 : 0; @@ -1144,7 +1128,7 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8 json[value] = Helpers::render_boolean(s, value_b); } } - json[type] = F("boolean"); + json[type] = ("boolean"); break; case DeviceValueType::TIME: @@ -1158,7 +1142,7 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8 if (Helpers::hasValue((char *)(dv.value_p))) { json[value] = (char *)(dv.value_p); } - json[type] = F("string"); + json[type] = ("string"); break; case DeviceValueType::CMD: @@ -1200,7 +1184,7 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8 // if we're filtering on an attribute, go find it if (attribute_s) { #if defined(EMSESP_DEBUG) - EMSESP::logger().debug(F("[DEBUG] Attribute '%s'"), attribute_s); + EMSESP::logger().debug(("[DEBUG] Attribute '%s'"), attribute_s); #endif if (json.containsKey(attribute_s)) { JsonVariant data = json[attribute_s]; @@ -1275,7 +1259,7 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c strlcpy(name, fullname.c_str(), sizeof(name)); // use full name } } else { - strlcpy(name, read_flash_string(dv.short_name).c_str(), sizeof(name)); // use short name + strlcpy(name, (dv.short_name), sizeof(name)); // use short name // if we have a tag, and its different to the last one create a nested object. only for hc, wwc and hs if (dv.tag != old_tag) { @@ -1418,7 +1402,7 @@ void EMSdevice::mqtt_ha_entity_config_remove() { if (dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED) && ((dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE)) || (!dv.has_state(DeviceValueState::DV_ACTIVE)))) { dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); - if (dv.short_name == FL_(climate)[0]) { + if (strcmp(dv.short_name, FL_(climate)[0])) { Mqtt::publish_ha_climate_config(dv.tag, false, true); // delete topic (remove = true) } else { Mqtt::publish_ha_sensor_config(dv, "", "", true); // delete topic (remove = true) @@ -1483,14 +1467,14 @@ bool EMSdevice::has_telegram_id(uint16_t id) const { std::string EMSdevice::telegram_type_name(std::shared_ptr telegram) const { // see if it's one of the common ones, like Version if (telegram->type_id == EMS_TYPE_VERSION) { - return read_flash_string(F("Version")); + return (("Version")); } else if (telegram->type_id == EMS_TYPE_UBADevices) { - return read_flash_string(F("UBADevices")); + return (("UBADevices")); } for (const auto & tf : telegram_functions_) { if ((tf.telegram_type_id_ == telegram->type_id) && (telegram->type_id != 0xFF)) { - return read_flash_string(tf.telegram_type_name_); + return (tf.telegram_type_name_); } } @@ -1505,7 +1489,7 @@ bool EMSdevice::handle_telegram(std::shared_ptr telegram) { // if the data block is empty and we have not received data before, assume that this telegram // is not recognized by the bus master. So remove it from the automatic fetch list if (telegram->message_length == 0 && telegram->offset == 0 && !tf.received_) { - EMSESP::logger().debug(F("This telegram (%s) is not recognized by the EMS bus"), read_flash_string(tf.telegram_type_name_).c_str()); + EMSESP::logger().debug(("This telegram (%s) is not recognized by the EMS bus"), (tf.telegram_type_name_)); tf.fetch_ = false; return false; } diff --git a/src/emsdevice.h b/src/emsdevice.h index 1d21270bf..8a841e14a 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -192,7 +192,7 @@ class EMSdevice { using process_function_p = std::function)>; - void register_telegram_type(const uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, const process_function_p cb); + void register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p cb); bool handle_telegram(std::shared_ptr telegram); std::string get_value_uom(const char * key) const; @@ -204,93 +204,77 @@ class EMSdevice { void generate_values_web(JsonObject & output); void generate_values_web_customization(JsonArray & output); - void add_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * options_single, - int8_t numeric_operator, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max); + void add_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * options_single, + int8_t numeric_operator, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max); - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max); + void register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max); - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f); + void + register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const ** options, const char * const * name, uint8_t uom, const cmd_function_p f); - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * name, - uint8_t uom); + void register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const ** options, const char * const * name, uint8_t uom); - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - int8_t numeric_operator, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f = nullptr); + void register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + int8_t numeric_operator, + const char * const * name, + uint8_t uom, + const cmd_function_p f = nullptr); - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - int8_t numeric_operator, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max); + void register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + int8_t numeric_operator, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max); // single list of options - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * options_single, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f = nullptr); + void register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const * options_single, + const char * const * name, + uint8_t uom, + const cmd_function_p f = nullptr); // single list of options, with no translations, with min and max - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * options_single, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max); + void register_device_value(uint8_t tag, + void * value_p, + uint8_t type, + const char * const * options_single, + const char * const * name, + uint8_t uom, + const cmd_function_p f, + int16_t min, + uint16_t max); // no options, optional function f - void register_device_value(uint8_t tag, void * value_p, uint8_t type, const __FlashStringHelper * const * name, uint8_t uom, const cmd_function_p f = nullptr); + void register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const * name, uint8_t uom, const cmd_function_p f = nullptr); // no options, with min/max - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * name, - uint8_t uom, - const cmd_function_p f, - int16_t min, - uint16_t max); + void + register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const * name, uint8_t uom, const cmd_function_p f, int16_t min, uint16_t max); void write_command(const uint16_t type_id, const uint8_t offset, uint8_t * message_data, const uint8_t message_length, const uint16_t validate_typeid) const; void write_command(const uint16_t type_id, const uint8_t offset, const uint8_t value, const uint16_t validate_typeid) const; @@ -438,13 +422,13 @@ class EMSdevice { bool ha_config_firstrun_ = true; // this means a first setup of HA is needed after a restart struct TelegramFunction { - uint16_t telegram_type_id_; // it's type_id - const __FlashStringHelper * telegram_type_name_; // e.g. RC20Message - bool fetch_; // if this type_id be queried automatically - bool received_; - process_function_p process_function_; + uint16_t telegram_type_id_; // it's type_id + const char * telegram_type_name_; // e.g. RC20Message + bool fetch_; // if this type_id be queried automatically + bool received_; + process_function_p process_function_; - TelegramFunction(uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, bool received, const process_function_p process_function) + TelegramFunction(uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, bool received, const process_function_p process_function) : telegram_type_id_(telegram_type_id) , telegram_type_name_(telegram_type_name) , fetch_(fetch) diff --git a/src/emsdevicevalue.cpp b/src/emsdevicevalue.cpp index 649d4fff8..0e369c6cd 100644 --- a/src/emsdevicevalue.cpp +++ b/src/emsdevicevalue.cpp @@ -23,21 +23,21 @@ namespace emsesp { // constructor -DeviceValue::DeviceValue(uint8_t device_type, - uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * options_single, - int8_t numeric_operator, - const __FlashStringHelper * const short_name, - const __FlashStringHelper * const * fullname, - std::string & custom_fullname, - uint8_t uom, - bool has_cmd, - int16_t min, - uint16_t max, - uint8_t state) +DeviceValue::DeviceValue(uint8_t device_type, + uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * options_single, + int8_t numeric_operator, + const char * const short_name, + const char * const * fullname, + std::string & custom_fullname, + uint8_t uom, + bool has_cmd, + int16_t min, + uint16_t max, + uint8_t state) : device_type(device_type) , tag(tag) , value_p(value_p) @@ -63,7 +63,7 @@ DeviceValue::DeviceValue(uint8_t device_type, #ifdef EMSESP_STANDALONE // only added for debugging Serial.print("registering entity: "); - Serial.print(read_flash_string(short_name).c_str()); + Serial.print((short_name)); Serial.print("/"); if (!custom_fullname.empty()) { Serial.print(COLOR_BRIGHT_CYAN); @@ -83,13 +83,13 @@ DeviceValue::DeviceValue(uint8_t device_type, Serial.print(" option"); Serial.print(i + 1); Serial.print(":"); - auto str = Helpers::translated_fword(options[i]); - Serial.print(read_flash_string(str).c_str()); + auto str = Helpers::translated_word(options[i]); + Serial.print((str.c_str())); i++; } } else if (options_single != nullptr) { Serial.print("option1:!"); - Serial.print(read_flash_string(options_single[0]).c_str()); + Serial.print((options_single[0])); Serial.print("!"); } Serial.println(""); @@ -99,7 +99,7 @@ DeviceValue::DeviceValue(uint8_t device_type, // mapping of UOM, to match order in DeviceValueUOM enum emsdevice.h // also maps to DeviceValueUOM in interface/src/project/types.ts for the Web UI // must be an int of 4 bytes, 32bit aligned -const __FlashStringHelper * DeviceValue::DeviceValueUOM_s[] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = { +const char * DeviceValue::DeviceValueUOM_s[] = { F_(uom_blank), F_(uom_degrees), @@ -125,7 +125,7 @@ const __FlashStringHelper * DeviceValue::DeviceValueUOM_s[] __attribute__((__ali // mapping of TAGs, to match order in DeviceValueTAG enum in emsdevice.h // must be an int of 4 bytes, 32bit aligned -const __FlashStringHelper * const DeviceValue::DeviceValueTAG_s[] PROGMEM = { +const char * const DeviceValue::DeviceValueTAG_s[] = { F_(tag_none), // "" F_(tag_heartbeat), // "" @@ -171,7 +171,7 @@ const __FlashStringHelper * const DeviceValue::DeviceValueTAG_s[] PROGMEM = { }; // MQTT topics derived from tags -const __FlashStringHelper * const DeviceValue::DeviceValueTAG_mqtt[] PROGMEM = { +const char * const DeviceValue::DeviceValueTAG_mqtt[] = { F_(tag_none), // "" F_(heartbeat), // "heartbeat" @@ -217,7 +217,7 @@ const __FlashStringHelper * const DeviceValue::DeviceValueTAG_mqtt[] PROGMEM = { }; // count #tags once at compile time -size_t DeviceValue::tag_count = sizeof(DeviceValue::DeviceValueTAG_s) / sizeof(__FlashStringHelper *); +size_t DeviceValue::tag_count = sizeof(DeviceValue::DeviceValueTAG_s) / sizeof(char *); // checks whether the device value has an actual value // returns true if its valid diff --git a/src/emsdevicevalue.h b/src/emsdevicevalue.h index 6420692fa..2f6722ca8 100644 --- a/src/emsdevicevalue.h +++ b/src/emsdevicevalue.h @@ -25,7 +25,6 @@ #include "helpers.h" // for conversions #include "default_settings.h" // for enum types -#include // for read_flash_string namespace emsesp { @@ -143,38 +142,38 @@ class DeviceValue { DV_NUMOP_MUL15 = -15 }; - uint8_t device_type; // EMSdevice::DeviceType - uint8_t tag; // DeviceValueTAG::* - void * value_p; // pointer to variable of any type - uint8_t type; // DeviceValueType::* - const __FlashStringHelper * const ** options; // options as a flash char array - const __FlashStringHelper * const * options_single; // options are not translated - int8_t numeric_operator; - uint8_t options_size; // number of options in the char array, calculated - const __FlashStringHelper * const short_name; // used in MQTT and API - const __FlashStringHelper * const * fullname; // used in Web and Console, is translated - std::string custom_fullname; // optional, from customization - uint8_t uom; // DeviceValueUOM::* - bool has_cmd; // true if there is a Console/MQTT command which matches the short_name - int16_t min; // min range - uint16_t max; // max range - uint8_t state; // DeviceValueState::* + uint8_t device_type; // EMSdevice::DeviceType + uint8_t tag; // DeviceValueTAG::* + void * value_p; // pointer to variable of any type + uint8_t type; // DeviceValueType::* + const char * const ** options; // options as a flash char array + const char * const * options_single; // options are not translated + int8_t numeric_operator; + uint8_t options_size; // number of options in the char array, calculated + const char * const short_name; // used in MQTT and API + const char * const * fullname; // used in Web and Console, is translated + std::string custom_fullname; // optional, from customization + uint8_t uom; // DeviceValueUOM::* + bool has_cmd; // true if there is a Console/MQTT command which matches the short_name + int16_t min; // min range + uint16_t max; // max range + uint8_t state; // DeviceValueState::* - DeviceValue(uint8_t device_type, - uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const ** options, - const __FlashStringHelper * const * options_single, - int8_t numeric_operator, - const __FlashStringHelper * const short_name, - const __FlashStringHelper * const * fullname, - std::string & custom_fullname, - uint8_t uom, - bool has_cmd, - int16_t min, - uint16_t max, - uint8_t state); + DeviceValue(uint8_t device_type, + uint8_t tag, + void * value_p, + uint8_t type, + const char * const ** options, + const char * const * options_single, + int8_t numeric_operator, + const char * const short_name, + const char * const * fullname, + std::string & custom_fullname, + uint8_t uom, + bool has_cmd, + int16_t min, + uint16_t max, + uint8_t state); bool hasValue() const; bool get_min_max(int16_t & dv_set_min, int16_t & dv_set_max); @@ -195,10 +194,10 @@ class DeviceValue { return state; } - static const __FlashStringHelper * DeviceValueUOM_s[]; - static const __FlashStringHelper * const DeviceValueTAG_s[]; - static const __FlashStringHelper * const DeviceValueTAG_mqtt[]; - static size_t tag_count; // # tags + static const char * DeviceValueUOM_s[]; + static const char * const DeviceValueTAG_s[]; + static const char * const DeviceValueTAG_mqtt[]; + static size_t tag_count; // # tags }; }; // namespace emsesp diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 51f2a6fe9..95b9a1bce 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -190,7 +190,7 @@ void EMSESP::uart_init() { if (System::is_valid_gpio(rx_gpio) && System::is_valid_gpio(tx_gpio)) { EMSuart::start(tx_mode, rx_gpio, tx_gpio); // start UART } else { - LOG_WARNING(F("Invalid UART Rx/Tx GPIOs. Check config.")); + LOG_WARNING(("Invalid UART Rx/Tx GPIOs. Check config.")); } txservice_.start(); // sends out request to EMS bus for all devices @@ -234,42 +234,42 @@ void EMSESP::show_ems(uuid::console::Shell & shell) { // EMS bus information switch (bus_status()) { case BUS_STATUS_OFFLINE: - shell.printfln(F("EMS Bus is disconnected.")); + shell.printfln(("EMS Bus is disconnected.")); break; case BUS_STATUS_TX_ERRORS: - shell.printfln(F("EMS Bus is connected, but Tx is not stable.")); + shell.printfln(("EMS Bus is connected, but Tx is not stable.")); break; default: - shell.printfln(F("EMS Bus is connected.")); + shell.printfln(("EMS Bus is connected.")); break; } shell.println(); if (bus_status() != BUS_STATUS_OFFLINE) { - shell.printfln(F("EMS Bus info:")); - EMSESP::webSettingsService.read([&](WebSettings & settings) { shell.printfln(F(" Tx mode: %d"), settings.tx_mode); }); - shell.printfln(F(" Bus protocol: %s"), EMSbus::is_ht3() ? F("HT3") : F("Buderus")); - shell.printfln(F(" #recognized EMS devices: %d"), EMSESP::emsdevices.size()); - shell.printfln(F(" #telegrams received: %d"), rxservice_.telegram_count()); - shell.printfln(F(" #read requests sent: %d"), txservice_.telegram_read_count()); - shell.printfln(F(" #write requests sent: %d"), txservice_.telegram_write_count()); - shell.printfln(F(" #incomplete telegrams: %d"), rxservice_.telegram_error_count()); - shell.printfln(F(" #read fails (after %d retries): %d"), TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_read_fail_count()); - shell.printfln(F(" #write fails (after %d retries): %d"), TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_write_fail_count()); - shell.printfln(F(" Rx line quality: %d%%"), rxservice_.quality()); - shell.printfln(F(" Tx line quality: %d%%"), (txservice_.read_quality() + txservice_.read_quality()) / 2); + shell.printfln(("EMS Bus info:")); + EMSESP::webSettingsService.read([&](WebSettings & settings) { shell.printfln((" Tx mode: %d"), settings.tx_mode); }); + shell.printfln((" Bus protocol: %s"), EMSbus::is_ht3() ? ("HT3") : ("Buderus")); + shell.printfln((" #recognized EMS devices: %d"), EMSESP::emsdevices.size()); + shell.printfln((" #telegrams received: %d"), rxservice_.telegram_count()); + shell.printfln((" #read requests sent: %d"), txservice_.telegram_read_count()); + shell.printfln((" #write requests sent: %d"), txservice_.telegram_write_count()); + shell.printfln((" #incomplete telegrams: %d"), rxservice_.telegram_error_count()); + shell.printfln((" #read fails (after %d retries): %d"), TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_read_fail_count()); + shell.printfln((" #write fails (after %d retries): %d"), TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_write_fail_count()); + shell.printfln((" Rx line quality: %d%%"), rxservice_.quality()); + shell.printfln((" Tx line quality: %d%%"), (txservice_.read_quality() + txservice_.read_quality()) / 2); shell.println(); } // Rx queue auto rx_telegrams = rxservice_.queue(); if (rx_telegrams.empty()) { - shell.printfln(F("Rx Queue is empty")); + shell.printfln(("Rx Queue is empty")); } else { - shell.printfln(F("Rx Queue (%ld telegram%s):"), rx_telegrams.size(), rx_telegrams.size() == 1 ? "" : "s"); + shell.printfln(("Rx Queue (%ld telegram%s):"), rx_telegrams.size(), rx_telegrams.size() == 1 ? "" : "s"); for (const auto & it : rx_telegrams) { - shell.printfln(F(" [%02d] %s"), it.id_, pretty_telegram(it.telegram_).c_str()); + shell.printfln((" [%02d] %s"), it.id_, pretty_telegram(it.telegram_).c_str()); } } @@ -278,20 +278,20 @@ void EMSESP::show_ems(uuid::console::Shell & shell) { // Tx queue auto tx_telegrams = txservice_.queue(); if (tx_telegrams.empty()) { - shell.printfln(F("Tx Queue is empty")); + shell.printfln(("Tx Queue is empty")); } else { - shell.printfln(F("Tx Queue (%ld telegram%s):"), tx_telegrams.size(), tx_telegrams.size() == 1 ? "" : "s"); + shell.printfln(("Tx Queue (%ld telegram%s):"), tx_telegrams.size(), tx_telegrams.size() == 1 ? "" : "s"); std::string op; for (const auto & it : tx_telegrams) { if ((it.telegram_->operation) == Telegram::Operation::TX_RAW) { - op = read_flash_string(F("RAW ")); + op = "RAW "; } else if ((it.telegram_->operation) == Telegram::Operation::TX_READ) { - op = read_flash_string(F("READ ")); + op = "READ "; } else if ((it.telegram_->operation) == Telegram::Operation::TX_WRITE) { - op = read_flash_string(F("WRITE")); + op = "WRITE"; } - shell.printfln(F(" [%02d%c] %s %s"), it.id_, ((it.retry_) ? '*' : ' '), op.c_str(), pretty_telegram(it.telegram_).c_str()); + shell.printfln((" [%02d%c] %s %s"), it.id_, ((it.retry_) ? '*' : ' '), op.c_str(), pretty_telegram(it.telegram_).c_str()); } } @@ -301,7 +301,7 @@ void EMSESP::show_ems(uuid::console::Shell & shell) { // show EMS device values to the shell console void EMSESP::show_device_values(uuid::console::Shell & shell) { if (emsdevices.empty()) { - shell.printfln(F("No EMS devices detected.")); + shell.printfln(("No EMS devices detected.")); shell.println(); return; } @@ -311,7 +311,7 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) { for (const auto & emsdevice : emsdevices) { if (emsdevice && (emsdevice->device_type() == device_class.first)) { // print header - shell.printfln(F("%s: %s (%d)"), emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str(), emsdevice->count_entities()); + shell.printfln(("%s: %s (%d)"), emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str(), emsdevice->count_entities()); DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN); // use max size JsonObject json = doc.to(); @@ -359,14 +359,14 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) { // show Dallas temperature sensors and Analog sensors void EMSESP::show_sensor_values(uuid::console::Shell & shell) { if (dallassensor_.have_sensors()) { - shell.printfln(F("Temperature sensors:")); + shell.printfln(("Temperature sensors:")); char s[10]; char s2[10]; uint8_t fahrenheit = EMSESP::system_.fahrenheit() ? 2 : 0; for (const auto & sensor : dallassensor_.sensors()) { if (Helpers::hasValue(sensor.temperature_c)) { - shell.printfln(F(" %s: %s%s °%c%s (offset %s, ID: %s)"), + shell.printfln((" %s: %s%s °%c%s (offset %s, ID: %s)"), sensor.name().c_str(), COLOR_BRIGHT_GREEN, Helpers::render_value(s, sensor.temperature_c, 10, fahrenheit), @@ -375,10 +375,7 @@ void EMSESP::show_sensor_values(uuid::console::Shell & shell) { Helpers::render_value(s2, sensor.offset(), 10, fahrenheit), sensor.id().c_str()); } else { - shell.printfln(F(" %s (offset %s, ID: %s)"), - sensor.name().c_str(), - Helpers::render_value(s, sensor.offset(), 10, fahrenheit), - sensor.id().c_str()); + shell.printfln((" %s (offset %s, ID: %s)"), sensor.name().c_str(), Helpers::render_value(s, sensor.offset(), 10, fahrenheit), sensor.id().c_str()); } } shell.println(); @@ -387,11 +384,11 @@ void EMSESP::show_sensor_values(uuid::console::Shell & shell) { if (analogsensor_.have_sensors()) { char s[10]; char s2[10]; - shell.printfln(F("Analog sensors:")); + shell.printfln(("Analog sensors:")); for (const auto & sensor : analogsensor_.sensors()) { switch (sensor.type()) { case AnalogSensor::AnalogType::ADC: - shell.printfln(F(" %s: %s%s %s%s (Type: ADC, Factor: %s, Offset: %d)"), + shell.printfln((" %s: %s%s %s%s (Type: ADC, Factor: %s, Offset: %d)"), sensor.name().c_str(), COLOR_BRIGHT_GREEN, Helpers::render_value(s, sensor.value(), 2), @@ -403,7 +400,7 @@ void EMSESP::show_sensor_values(uuid::console::Shell & shell) { default: // case AnalogSensor::AnalogType::DIGITAL_IN: // case AnalogSensor::AnalogType::COUNTER: - shell.printfln(F(" %s: %s%d%s (Type: %s)"), + shell.printfln((" %s: %s%d%s (Type: %s)"), sensor.name().c_str(), COLOR_BRIGHT_GREEN, (uint16_t)sensor.value(), // as int @@ -540,7 +537,7 @@ void EMSESP::publish_device_values(uint8_t device_type) { } if (need_publish) { if (doc.overflowed()) { - LOG_WARNING(F("MQTT buffer overflow, please use individual topics")); + LOG_WARNING(("MQTT buffer overflow, please use individual topics")); } Mqtt::publish(Mqtt::tag_to_topic(device_type, DeviceValueTAG::TAG_NONE), json); } @@ -625,9 +622,9 @@ bool EMSESP::get_device_value_info(JsonObject & root, const char * cmd, const in // search for recognized device_ids : Me, All, otherwise print hex value std::string EMSESP::device_tostring(const uint8_t device_id) { if ((device_id & 0x7F) == rxservice_.ems_bus_id()) { - return read_flash_string(F("Me")); + return "Me"; } else if (device_id == 0x00) { - return read_flash_string(F("All")); + return "All"; } else { char buffer[5]; return Helpers::hextoa(buffer, device_id); @@ -672,14 +669,14 @@ std::string EMSESP::pretty_telegram(std::shared_ptr telegram) { // check for global/common types like Version & UBADevices if (telegram->type_id == EMSdevice::EMS_TYPE_VERSION) { - type_name = read_flash_string(F("Version")); + type_name = "Version"; } else if (telegram->type_id == EMSdevice::EMS_TYPE_UBADevices) { - type_name = read_flash_string(F("UBADevices")); + type_name = "UBADevices"; } // if we don't know the type show if (type_name.empty()) { - type_name = read_flash_string(F("?")); + type_name = "?"; } std::string str; @@ -728,7 +725,7 @@ void EMSESP::process_UBADevices(std::shared_ptr telegram) { // if we haven't already detected this device, request it's version details, unless its us (EMS-ESP) // when the version info is received, it will automagically add the device if ((device_id != EMSbus::ems_bus_id()) && !(EMSESP::device_exists(device_id))) { - LOG_DEBUG(F("New EMS device detected with ID 0x%02X. Requesting version information."), device_id); + LOG_DEBUG(("New EMS device detected with ID 0x%02X. Requesting version information."), device_id); send_read_request(EMSdevice::EMS_TYPE_VERSION, device_id); } } @@ -788,7 +785,7 @@ void EMSESP::process_version(std::shared_ptr telegram) { bool EMSESP::process_telegram(std::shared_ptr telegram) { // if watching or reading... if ((telegram->type_id == read_id_) && (telegram->dest == txservice_.ems_bus_id())) { - LOG_INFO(F("%s"), pretty_telegram(telegram).c_str()); + LOG_INFO(("%s"), pretty_telegram(telegram).c_str()); if (Mqtt::send_response()) { publish_response(telegram); } @@ -800,18 +797,18 @@ bool EMSESP::process_telegram(std::shared_ptr telegram) { } else if (watch() == WATCH_ON) { if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_) || ((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) { - LOG_NOTICE(F("%s"), pretty_telegram(telegram).c_str()); + LOG_NOTICE(("%s"), pretty_telegram(telegram).c_str()); } else if (!trace_raw_) { - LOG_TRACE(F("%s"), pretty_telegram(telegram).c_str()); + LOG_TRACE(("%s"), pretty_telegram(telegram).c_str()); } } else if (!trace_raw_) { - LOG_TRACE(F("%s"), pretty_telegram(telegram).c_str()); + LOG_TRACE(("%s"), pretty_telegram(telegram).c_str()); } // only process broadcast telegrams or ones sent to us on request // if ((telegram->dest != 0x00) && (telegram->dest != rxservice_.ems_bus_id())) { if (telegram->operation == Telegram::Operation::RX_READ) { - // LOG_DEBUG(F("read telegram received, not processing")); + // LOG_DEBUG(("read telegram received, not processing")); return false; } @@ -861,9 +858,9 @@ bool EMSESP::process_telegram(std::shared_ptr telegram) { } if (!found) { - LOG_DEBUG(F("No telegram type handler found for ID 0x%02X (src 0x%02X)"), telegram->type_id, telegram->src); + LOG_DEBUG(("No telegram type handler found for ID 0x%02X (src 0x%02X)"), telegram->type_id, telegram->src); if (watch() == WATCH_UNKNOWN) { - LOG_NOTICE(F("%s"), pretty_telegram(telegram).c_str()); + LOG_NOTICE(("%s"), pretty_telegram(telegram).c_str()); } if (!wait_km_ && !knowndevice && (telegram->src != EMSbus::ems_bus_id()) && (telegram->message_length > 0)) { send_read_request(EMSdevice::EMS_TYPE_VERSION, telegram->src); @@ -887,12 +884,12 @@ bool EMSESP::device_exists(const uint8_t device_id) { // for each associated EMS device go and get its system information void EMSESP::show_devices(uuid::console::Shell & shell) { if (emsdevices.empty()) { - shell.printfln(F("No EMS devices detected. Try using 'scan devices' from the ems menu.")); + shell.printfln(("No EMS devices detected. Try using 'scan devices' from the ems menu.")); shell.println(); return; } - shell.printfln(F("These EMS devices are currently active:")); + shell.printfln(("These EMS devices are currently active:")); shell.println(); // count the number of thermostats @@ -908,7 +905,7 @@ void EMSESP::show_devices(uuid::console::Shell & shell) { for (const auto & device_class : EMSFactory::device_handlers()) { for (const auto & emsdevice : emsdevices) { if (emsdevice && (emsdevice->device_type() == device_class.first)) { - shell.printf(F("%s: %s"), emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str()); + shell.printf(("%s: %s"), emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str()); shell.println(); emsdevice->show_telegram_handlers(shell); @@ -935,7 +932,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const if (product_id == 0) { // update only with valid product_id return true; } - LOG_DEBUG(F("Updating details for already active deviceID 0x%02X"), device_id); + LOG_DEBUG(("Updating details for already active deviceID 0x%02X"), device_id); emsdevice->product_id(product_id); emsdevice->version(version); // only set brand if it doesn't already exist @@ -976,7 +973,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const // if we don't recognize the productID report it and add as a generic device if (device_p == nullptr) { - LOG_NOTICE(F("Unrecognized EMS device (deviceID 0x%02X, productID %d). Please report on GitHub."), device_id, product_id); + LOG_NOTICE(("Unrecognized EMS device (deviceID 0x%02X, productID %d). Please report on GitHub."), device_id, product_id); emsdevices.push_back( EMSFactory::add(DeviceType::GENERIC, device_id, product_id, version, "unknown", DeviceFlags::EMS_DEVICE_FLAG_NONE, EMSdevice::Brand::NO_BRAND)); return false; // not found @@ -1021,14 +1018,14 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const name = "generic boiler"; device_type = DeviceType::BOILER; flags = DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP; - LOG_WARNING(F("Unknown EMS boiler. Using generic profile. Please report on GitHub.")); + LOG_WARNING(("Unknown EMS boiler. Using generic profile. Please report on GitHub.")); } else { - LOG_WARNING(F("Unrecognized EMS device (device ID 0x%02X, no product ID). Please report on GitHub."), device_id); + LOG_WARNING(("Unrecognized EMS device (device ID 0x%02X, no product ID). Please report on GitHub."), device_id); return false; } } - LOG_DEBUG(F("Adding new device %s (deviceID 0x%02X, productID %d, version %s)"), name, device_id, product_id, version); + LOG_DEBUG(("Adding new device %s (deviceID 0x%02X, productID %d, version %s)"), name, device_id, product_id, version); emsdevices.push_back(EMSFactory::add(device_type, device_id, product_id, version, name, flags, brand)); // assign a unique ID. Note that this is not actual unique after a restart as it's dependent on the order that devices are found @@ -1042,7 +1039,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const fetch_device_values(device_id); // go and fetch its data // Print to LOG showing we've added a new device - LOG_INFO(F("Recognized new %s with deviceID 0x%02X"), EMSdevice::device_type_2_device_name(device_type).c_str(), device_id); + LOG_INFO(("Recognized new %s with deviceID 0x%02X"), EMSdevice::device_type_2_device_name(device_type).c_str(), device_id); // add command commands for all devices, except for connect, controller and gateway if ((device_type == DeviceType::CONNECT) || (device_type == DeviceType::CONTROLLER) || (device_type == DeviceType::GATEWAY)) { @@ -1058,7 +1055,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const F_(info_cmd)); Command::add( device_type, - F("values"), + ("values"), [device_type](const char * value, const int8_t id, JsonObject & output) { return command_info(device_type, output, id, EMSdevice::OUTPUT_TARGET::API_SHORTNAMES); // HIDDEN command showing short names, used in e.g. /api/boiler }, @@ -1177,7 +1174,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { Roomctrl::check((data[1] ^ 0x80 ^ rxservice_.ems_mask()), data); #ifdef EMSESP_UART_DEBUG // get_uptime is only updated once per loop, does not give the right time - LOG_TRACE(F("[UART_DEBUG] Echo after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str()); + LOG_TRACE(("[UART_DEBUG] Echo after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str()); #endif // add to RxQueue for log/watch rxservice_.add(data, length); @@ -1193,14 +1190,14 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { // if we're waiting on a Write operation, we want a single byte 1 or 4 if ((tx_state == Telegram::Operation::TX_WRITE) && (length == 1)) { if (first_value == TxService::TX_WRITE_SUCCESS) { - LOG_DEBUG(F("Last Tx write successful")); + LOG_DEBUG(("Last Tx write successful")); txservice_.increment_telegram_write_count(); // last tx/write was confirmed ok txservice_.send_poll(); // close the bus publish_id_ = txservice_.post_send_query(); // follow up with any post-read if set txservice_.reset_retry_count(); tx_successful = true; } else if (first_value == TxService::TX_WRITE_FAIL) { - LOG_ERROR(F("Last Tx write rejected by host")); + LOG_ERROR(("Last Tx write rejected by host")); txservice_.send_poll(); // close the bus txservice_.reset_retry_count(); } @@ -1209,7 +1206,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { uint8_t src = data[0]; uint8_t dest = data[1]; if (txservice_.is_last_tx(src, dest)) { - LOG_DEBUG(F("Last Tx read successful")); + LOG_DEBUG(("Last Tx read successful")); txservice_.increment_telegram_read_count(); txservice_.send_poll(); // close the bus txservice_.reset_retry_count(); @@ -1251,11 +1248,11 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { #ifdef EMSESP_UART_DEBUG char s[4]; if (first_value & 0x80) { - LOG_TRACE(F("[UART_DEBUG] next Poll %s after %d ms"), Helpers::hextoa(s, first_value), ::millis() - rx_time_); + LOG_TRACE(("[UART_DEBUG] next Poll %s after %d ms"), Helpers::hextoa(s, first_value), ::millis() - rx_time_); // time measurement starts here, use millis because get_uptime is only updated once per loop rx_time_ = ::millis(); } else { - LOG_TRACE(F("[UART_DEBUG] Poll ack %s after %d ms"), Helpers::hextoa(s, first_value), ::millis() - rx_time_); + LOG_TRACE(("[UART_DEBUG] Poll ack %s after %d ms"), Helpers::hextoa(s, first_value), ::millis() - rx_time_); } #endif // check for poll to us, if so send top message from Tx queue immediately and quit @@ -1267,7 +1264,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { return; } else { #ifdef EMSESP_UART_DEBUG - LOG_TRACE(F("[UART_DEBUG] Reply after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str()); + LOG_TRACE(("[UART_DEBUG] Reply after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str()); #endif Roomctrl::check((data[1] ^ 0x80 ^ rxservice_.ems_mask()), data); // check if there is a message for the roomcontroller @@ -1292,14 +1289,14 @@ void EMSESP::start() { webLogService.begin(); // start web log service. now we can start capturing logs to the web log #ifdef EMSESP_DEBUG - LOG_NOTICE(F("System is running in Debug mode")); + LOG_NOTICE(("System is running in Debug mode")); #endif - LOG_INFO(F("Last system reset reason Core0: %s, Core1: %s"), system_.reset_reason(0).c_str(), system_.reset_reason(1).c_str()); + LOG_INFO(("Last system reset reason Core0: %s, Core1: %s"), system_.reset_reason(0).c_str(), system_.reset_reason(1).c_str()); // do any system upgrades if (system_.check_upgrade()) { - LOG_INFO(F("System needs a restart to apply new settings. Please wait.")); + LOG_INFO(("System needs a restart to apply new settings. Please wait.")); system_.system_restart(); }; @@ -1315,7 +1312,7 @@ void EMSESP::start() { // start all the EMS-ESP services mqtt_.start(); // mqtt init system_.start(); // starts commands, led, adc, button, network, syslog & uart - LOG_INFO(F("Starting EMS-ESP version %s (hostname: %s)"), EMSESP_APP_VERSION, system_.hostname().c_str()); // welcome message + LOG_INFO(("Starting EMS-ESP version %s (hostname: %s)"), EMSESP_APP_VERSION, system_.hostname().c_str()); // welcome message shower_.start(); // initialize shower timer and shower alert dallassensor_.start(); // Dallas external sensors @@ -1326,7 +1323,7 @@ void EMSESP::start() { device_library_ = { #include "device_library.h" }; - LOG_INFO(F("Loaded EMS device library (%d records)"), device_library_.size()); + LOG_INFO(("Loaded EMS device library (%d records)"), device_library_.size()); #if defined(EMSESP_STANDALONE) Mqtt::on_connect(); // simulate an MQTT connection diff --git a/src/helpers.cpp b/src/helpers.cpp index c92c08a5f..80e400207 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -608,7 +608,7 @@ bool Helpers::value2bool(const char * value, bool & value_b) { // checks to see if a string is member of a vector and return the index, also allow true/false for on/off // this for a list of lists, when using translated strings -bool Helpers::value2enum(const char * value, uint8_t & value_ui, const __FlashStringHelper * const ** strs) { +bool Helpers::value2enum(const char * value, uint8_t & value_ui, const char * const ** strs) { if ((value == nullptr) || (strlen(value) == 0)) { return false; } @@ -616,7 +616,7 @@ bool Helpers::value2enum(const char * value, uint8_t & value_ui, const __FlashSt for (value_ui = 0; strs[value_ui]; value_ui++) { std::string str1 = toLower(Helpers::translated_word(strs[value_ui])); - std::string str2 = toLower(read_flash_string(strs[value_ui][0])); // also check for default language + std::string str2 = toLower((strs[value_ui][0])); // also check for default language if ((str1 != "") && ((str2 == "off" && str == "false") || (str2 == "on" && str == "true") || (str == str1) || (str == str2) || (value[0] == ('0' + value_ui) && value[1] == '\0'))) { @@ -628,14 +628,14 @@ bool Helpers::value2enum(const char * value, uint8_t & value_ui, const __FlashSt } // checks to see if a string is member of a vector and return the index, also allow true/false for on/off -bool Helpers::value2enum(const char * value, uint8_t & value_ui, const __FlashStringHelper * const * strs) { +bool Helpers::value2enum(const char * value, uint8_t & value_ui, const char * const * strs) { if ((value == nullptr) || (strlen(value) == 0)) { return false; } std::string str = toLower(value); for (value_ui = 0; strs[value_ui]; value_ui++) { - std::string enum_str = toLower(read_flash_string(strs[value_ui])); + std::string enum_str = toLower((strs[value_ui])); if ((enum_str != "") && ((enum_str == "off" && (str == Helpers::translated_word(FL_(off)) || str == "false")) @@ -655,6 +655,23 @@ std::string Helpers::toLower(std::string const & s) { return lc; } + +// TODO fix toLower +std::string Helpers::toLower(const char * s) { + std::string lc = s; + std::transform(lc.begin(), lc.end(), lc.begin(), [](unsigned char c) { return std::tolower(c); }); + return lc; + + /* + + for (; *s; ++s) { + *p = tolower(*s); + p++; + } + + */ +} + std::string Helpers::toUpper(std::string const & s) { std::string lc = s; std::transform(lc.begin(), lc.end(), lc.begin(), [](unsigned char c) { return std::toupper(c); }); @@ -676,7 +693,7 @@ void Helpers::replace_char(char * str, char find, char replace) { // count number of items in a list // the end of a list has a nullptr -uint8_t Helpers::count_items(const __FlashStringHelper * const * list) { +uint8_t Helpers::count_items(const char * const * list) { uint8_t list_size = 0; if (list != nullptr) { while (list[list_size]) { @@ -688,7 +705,7 @@ uint8_t Helpers::count_items(const __FlashStringHelper * const * list) { // count number of items in a list of lists // the end of a list has a nullptr -uint8_t Helpers::count_items(const __FlashStringHelper * const ** list) { +uint8_t Helpers::count_items(const char * const ** list) { uint8_t list_size = 0; if (list != nullptr) { while (list[list_size]) { @@ -699,29 +716,15 @@ uint8_t Helpers::count_items(const __FlashStringHelper * const ** list) { } // return translated string as a std::string, optionally converting to lowercase (for console commands) -// takes a FL(...) -std::string Helpers::translated_word(const __FlashStringHelper * const * strings, bool to_lower) { +std::string Helpers::translated_word(const char * const * strings, bool to_lower) { uint8_t language_index = EMSESP::system_.language_index(); uint8_t index = 0; // see how many translations we have for this entity. if there is no translation for this, revert to EN - if (Helpers::count_items(strings) >= language_index + 1 && !read_flash_string(strings[language_index]).empty()) { + if (Helpers::count_items(strings) >= language_index + 1 && strlen(strings[language_index])) { index = language_index; } - return to_lower ? toLower(read_flash_string(strings[index])) : read_flash_string(strings[index]); -} - -// return translated string -// takes a F(...) -const __FlashStringHelper * Helpers::translated_fword(const __FlashStringHelper * const * strings) { - uint8_t language_index = EMSESP::system_.language_index(); - uint8_t index = 0; - - // see how many translations we have for this entity. if there is no translation for this, revert to EN - if (Helpers::count_items(strings) >= language_index + 1 && !read_flash_string(strings[language_index]).empty()) { - index = language_index; - } - return strings[index]; + return to_lower ? toLower((strings[index])) : (strings[index]); } } // namespace emsesp diff --git a/src/helpers.h b/src/helpers.h index 396baa960..9f7efd9f7 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -54,7 +54,9 @@ class Helpers { static std::string toLower(std::string const & s); static std::string toUpper(std::string const & s); - static void replace_char(char * str, char find, char replace); + static std::string toLower(const char * s); + + static void replace_char(char * str, char find, char replace); static bool hasValue(const uint8_t & value, const uint8_t isBool = 0); static bool hasValue(const int8_t & value); @@ -67,16 +69,15 @@ class Helpers { static bool value2float(const char * value, float & value_f); static bool value2bool(const char * value, bool & value_b); static bool value2string(const char * value, std::string & value_s); - static bool value2enum(const char * value, uint8_t & value_ui, const __FlashStringHelper * const ** strs); - static bool value2enum(const char * value, uint8_t & value_ui, const __FlashStringHelper * const * strs); + static bool value2enum(const char * value, uint8_t & value_ui, const char * const ** strs); + static bool value2enum(const char * value, uint8_t & value_ui, const char * const * strs); static bool value2temperature(const char * value, float & value_f, bool relative = false); static bool value2temperature(const char * value, int & value_i, const bool relative = false, const int min = -2147483648, const int max = 2147483647); - static uint8_t count_items(const __FlashStringHelper * const ** list); - static uint8_t count_items(const __FlashStringHelper * const * list); + static uint8_t count_items(const char * const ** list); + static uint8_t count_items(const char * const * list); - static std::string translated_word(const __FlashStringHelper * const * strings, bool to_lower = false); - static const __FlashStringHelper * translated_fword(const __FlashStringHelper * const * strings); + static std::string translated_word(const char * const * strings, bool to_lower = false); #ifdef EMSESP_STANDALONE static char * ultostr(char * ptr, uint32_t value, const uint8_t base); diff --git a/src/locale_common.h b/src/locale_common.h index b0d32323a..35ea7eaca 100644 --- a/src/locale_common.h +++ b/src/locale_common.h @@ -144,46 +144,46 @@ MAKE_PSTR(password_prompt, "Password: ") MAKE_PSTR(unset, "") // more common names that don't need translations -MAKE_PSTR_LIST(1x3min, F("1x3min")) -MAKE_PSTR_LIST(2x3min, F("2x3min")) -MAKE_PSTR_LIST(3x3min, F("3x3min")) -MAKE_PSTR_LIST(4x3min, F("4x3min")) -MAKE_PSTR_LIST(5x3min, F("5x3min")) -MAKE_PSTR_LIST(6x3min, F("6x3min")) -MAKE_PSTR_LIST(auto, F("auto")) -MAKE_PSTR_LIST(na, F("n/a")) -MAKE_PSTR_LIST(rc3x, F("rc3x")) -MAKE_PSTR_LIST(rc20, F("rc20")) -MAKE_PSTR_LIST(fb10, F("fb10")) -MAKE_PSTR_LIST(fb100, F("fb100")) -MAKE_PSTR_LIST(dash, F("-")) -MAKE_PSTR_LIST(error, F("error")) -MAKE_PSTR_LIST(BLANK, F("")) -MAKE_PSTR_LIST(pwm, F("pwm")) -MAKE_PSTR_LIST(pwm_invers, F("pwm inverse")) -MAKE_PSTR_LIST(mpc, F("mpc")) -MAKE_PSTR_LIST(tempauto, F("temp auto")) -MAKE_PSTR_LIST(bypass, F("bypass")) -MAKE_PSTR_LIST(mixer, F("mixer")) -MAKE_PSTR_LIST(monovalent, F("monovalent")) -MAKE_PSTR_LIST(bivalent, F("bivalent")) -MAKE_PSTR_LIST(n_o, F("n_o")) -MAKE_PSTR_LIST(n_c, F("n_c")) -MAKE_PSTR_LIST(prog1, F("prog 1")) -MAKE_PSTR_LIST(prog2, F("prog 2")) -MAKE_PSTR_LIST(proga, F("prog a")) -MAKE_PSTR_LIST(progb, F("prog b")) -MAKE_PSTR_LIST(progc, F("prog c")) -MAKE_PSTR_LIST(progd, F("prog d")) -MAKE_PSTR_LIST(proge, F("prog e")) -MAKE_PSTR_LIST(progf, F("prog f")) +MAKE_PSTR_LIST(1x3min, "1x3min") +MAKE_PSTR_LIST(2x3min, "2x3min") +MAKE_PSTR_LIST(3x3min, "3x3min") +MAKE_PSTR_LIST(4x3min, "4x3min") +MAKE_PSTR_LIST(5x3min, "5x3min") +MAKE_PSTR_LIST(6x3min, "6x3min") +MAKE_PSTR_LIST(auto, "auto") +MAKE_PSTR_LIST(na, "n/a") +MAKE_PSTR_LIST(rc3x, "rc3x") +MAKE_PSTR_LIST(rc20, "rc20") +MAKE_PSTR_LIST(fb10, "fb10") +MAKE_PSTR_LIST(fb100, "fb100") +MAKE_PSTR_LIST(dash, "-") +MAKE_PSTR_LIST(error, "error") +MAKE_PSTR_LIST(BLANK, "") +MAKE_PSTR_LIST(pwm, "pwm") +MAKE_PSTR_LIST(pwm_invers, "pwm inverse") +MAKE_PSTR_LIST(mpc, "mpc") +MAKE_PSTR_LIST(tempauto, "temp auto") +MAKE_PSTR_LIST(bypass, "bypass") +MAKE_PSTR_LIST(mixer, "mixer") +MAKE_PSTR_LIST(monovalent, "monovalent") +MAKE_PSTR_LIST(bivalent, "bivalent") +MAKE_PSTR_LIST(n_o, "n_o") +MAKE_PSTR_LIST(n_c, "n_c") +MAKE_PSTR_LIST(prog1, "prog 1") +MAKE_PSTR_LIST(prog2, "prog 2") +MAKE_PSTR_LIST(proga, "prog a") +MAKE_PSTR_LIST(progb, "prog b") +MAKE_PSTR_LIST(progc, "prog c") +MAKE_PSTR_LIST(progd, "prog d") +MAKE_PSTR_LIST(proge, "prog e") +MAKE_PSTR_LIST(progf, "prog f") // templates - this are not translated and will be saved under optons_single -MAKE_PSTR_LIST(tpl_datetime, F("Format: < NTP | dd.mm.yyyy-hh:mm:ss-day(0-6)-dst(0/1) >")) -MAKE_PSTR_LIST(tpl_switchtime, F("Format: [ not_set | day hh:mm on|off ]")) -MAKE_PSTR_LIST(tpl_switchtime1, F("Format: [ not_set | day hh:mm Tn ]")) -MAKE_PSTR_LIST(tpl_holidays, F("Format: < dd.mm.yyyy-dd.mm.yyyy >")) -MAKE_PSTR_LIST(tpl_date, F("Format: < dd.mm.yyyy >")) +MAKE_PSTR_LIST(tpl_datetime, "Format: < NTP | dd.mm.yyyy-hh:mm:ss-day(0-6)-dst(0/1) >") +MAKE_PSTR_LIST(tpl_switchtime, "Format: [ not_set | day hh:mm on|off ]") +MAKE_PSTR_LIST(tpl_switchtime1, "Format: [ not_set | day hh:mm Tn ]") +MAKE_PSTR_LIST(tpl_holidays, "Format: < dd.mm.yyyy-dd.mm.yyyy >") +MAKE_PSTR_LIST(tpl_date, "Format: < dd.mm.yyyy >") // Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp // These don't need translating, it will mess up HA and the API @@ -264,16 +264,16 @@ MAKE_PSTR(response, "response") MAKE_PSTR(tag_boiler_data_ww_mqtt, "ww") MAKE_PSTR(tag_device_data_ww_mqtt, "") -MAKE_PSTR_LIST(climate, F("HA climate config creation")) +MAKE_PSTR_LIST(climate, "HA climate config creation") // syslog -MAKE_PSTR_LIST(list_syslog_level, F("off"), F("emerg"), F("alert"), F("crit"), F("error"), F("warn"), F("notice"), F("info"), F("debug"), F("trace"), F("all")) +MAKE_PSTR_LIST(list_syslog_level, "off", "emerg", "alert", "crit", "error", "warn", "notice", "info", "debug", "trace", "all") // sensors -MAKE_PSTR_LIST(list_sensortype, F("none"), F("digital in"), F("counter"), F("adc"), F("timer"), F("rate"), F("digital out"), F("pwm 0"), F("pwm 1"), F("pwm 2")) +MAKE_PSTR_LIST(list_sensortype, "none", "digital in", "counter", "adc", "timer", "rate", "digital out", "pwm 0", "pwm 1", "pwm 2") // watch -MAKE_PSTR_LIST(list_watch, F("off"), F("on"), F("raw"), F("unknown")) +MAKE_PSTR_LIST(list_watch, "off", "on", "raw", "unknown") /* * The rest below are Enums and generated from translations lists diff --git a/src/locale_translations.h b/src/locale_translations.h index 2160e3f7e..28563790f 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -29,1143 +29,831 @@ // translations are in order en, de,nl, se.... // if there is no translation, it will default to en -// MAKE_PSTR_LIST2(on, "on", "an", "aan", "på") // TODO remove - // General -MAKE_PSTR_LIST(on, F("on"), F("an"), F("aan"), F("på")) -MAKE_PSTR_LIST(off, F("off"), F("aus"), F("uit"), F("av")) -MAKE_PSTR_LIST(ON, F("ON"), F("AN"), F("AAN"), F("PÅ")) -MAKE_PSTR_LIST(OFF, F("OFF"), F("AUS"), F("UIT"), F("AV")) +MAKE_PSTR_LIST(on, "on", "an", "aan", "på") +MAKE_PSTR_LIST(off, "off", "aus", "uit", "av") +MAKE_PSTR_LIST(ON, "ON", "AN", "AAN", "PÅ") +MAKE_PSTR_LIST(OFF, "OFF", "AUS", "UIT", "AV") // Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp // uom - also used with HA see https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L384 -MAKE_PSTR_LIST(minutes, F("minutes"), F("Minuten"), F("Minuten"), F("Minuter")) -MAKE_PSTR_LIST(hours, F("hours"), F("Stunden"), F("Uren"), F("Timmar")) -MAKE_PSTR_LIST(days, F("days"), F("Tage"), F("Dagen"), F("Dagar")) -MAKE_PSTR_LIST(seconds, F("seconds"), F("Sekunden"), F("Seconden"), F("Sekunder")) +MAKE_PSTR_LIST(minutes, "minutes", "Minuten", "Minuten", "Minuter") +MAKE_PSTR_LIST(hours, "hours", "Stunden", "Uren", "Timmar") +MAKE_PSTR_LIST(days, "days", "Tage", "Dagen", "Dagar") +MAKE_PSTR_LIST(seconds, "seconds", "Sekunden", "Seconden", "Sekunder") // Enum translations // general -MAKE_PSTR_LIST(day_mo, F("mo"), F("Mo"), F("Mo"), F("Må")) -MAKE_PSTR_LIST(day_tu, F("tu"), F("Di"), F("Di"), F("Ti")) -MAKE_PSTR_LIST(day_we, F("we"), F("Mi"), F("Wo"), F("On")) -MAKE_PSTR_LIST(day_th, F("th"), F("Do"), F("Do"), F("To")) -MAKE_PSTR_LIST(day_fr, F("fr"), F("Fr"), F("Vr"), F("Fr")) -MAKE_PSTR_LIST(day_sa, F("sa"), F("Sa"), F("Za"), F("Lö")) -MAKE_PSTR_LIST(day_su, F("su"), F("So"), F("Zo"), F("Sö")) -MAKE_PSTR_LIST(all, F("all"), F("Alle"), F("Alle"), F("Alla")) -MAKE_PSTR_LIST(own_1, F("own 1"), F("Eigen 1"), F("Eigen 1"), F("Egen 1")) -MAKE_PSTR_LIST(family, F("family"), F("Familie"), F("Familie"), F("Familj")) -MAKE_PSTR_LIST(morning, F("morning"), F("Morgends"), F("'s ochtends"), F("Morgon")) -MAKE_PSTR_LIST(evening, F("evening"), F("Abends"), F("'s avonds"), F("Kväll")) -MAKE_PSTR_LIST(seniors, F("seniors"), F("Senioren"), F("Senioren"), F("Seniorer")) -MAKE_PSTR_LIST(no, F("no"), F("nein"), F("nee"), F("nej")) -MAKE_PSTR_LIST(new, F("new"), F("Neu"), F("Nieuw"), F("Ny")) -MAKE_PSTR_LIST(own_2, F("own 2"), F("Eigen 2"), F("Eigen 2"), F("Egen 2")) -MAKE_PSTR_LIST(singles, F("singles"), F("Singles"), F("Singles"), F("Singlar")) -MAKE_PSTR_LIST(am, F("am"), F("Vormittag"), F("Ochtend"), F("Förmiddag")) -MAKE_PSTR_LIST(pm, F("pm"), F("Nachmittag"), F("Namiddag"), F("Eftermiddag")) -MAKE_PSTR_LIST(midday, F("midday"), F("Mittag"), F("Middag"), F("Middag")) -MAKE_PSTR_LIST(unknown, F("unknown"), F("Unbekannt"), F("Onbekend"), F("Okänt")) -MAKE_PSTR_LIST(flat, F("flat"), F("flach"), F("vlak"), F("Platt")) -MAKE_PSTR_LIST(vacuum, F("vacuum"), F("Vakuum"), F("vacuum"), F("Vakuum")) -MAKE_PSTR_LIST(co2_optimized, F("co2 optimized"), F("CO2 optimiert"), F("CO2 geoptimaliseerd"), F("CO2-optimerad")) -MAKE_PSTR_LIST(cost_optimized, F("cost optimized"), F("kostenoptimiert"), F("kosten geoptimaliseerd"), F("kostnadsoptimerad")) -MAKE_PSTR_LIST(outside_temp_switched, F("outside temp switched"), F("Außentemp. gesteuert"), F("Buitentemp. gestuurd"), F("Utomhustemp korrigerad")) -MAKE_PSTR_LIST(co2_cost_mix, F("co2 cost mix"), F("Kostenmix"), F("Kostenmix"), F("Kostnadsmix")) -MAKE_PSTR_LIST(analog, F("analog"), F("analog"), F("analoog"), F("analog")) -MAKE_PSTR_LIST(normal, F("normal"), F("normal"), F("normaal"), F("normal")) -MAKE_PSTR_LIST(blocking, F("blocking"), F("Blockierung"), F("Blokkering"), F("Blockering")) +MAKE_PSTR_LIST(day_mo, "mo", "Mo", "Mo", "Må") +MAKE_PSTR_LIST(day_tu, "tu", "Di", "Di", "Ti") +MAKE_PSTR_LIST(day_we, "we", "Mi", "Wo", "On") +MAKE_PSTR_LIST(day_th, "th", "Do", "Do", "To") +MAKE_PSTR_LIST(day_fr, "fr", "Fr", "Vr", "Fr") +MAKE_PSTR_LIST(day_sa, "sa", "Sa", "Za", "Lö") +MAKE_PSTR_LIST(day_su, "su", "So", "Zo", "Sö") +MAKE_PSTR_LIST(all, "all", "Alle", "Alle", "Alla") +MAKE_PSTR_LIST(own_1, "own 1", "Eigen 1", "Eigen 1", "Egen 1") +MAKE_PSTR_LIST(family, "family", "Familie", "Familie", "Familj") +MAKE_PSTR_LIST(morning, "morning", "Morgends", "'s ochtends", "Morgon") +MAKE_PSTR_LIST(evening, "evening", "Abends", "'s avonds", "Kväll") +MAKE_PSTR_LIST(seniors, "seniors", "Senioren", "Senioren", "Seniorer") +MAKE_PSTR_LIST(no, "no", "nein", "nee", "nej") +MAKE_PSTR_LIST(new, "new", "Neu", "Nieuw", "Ny") +MAKE_PSTR_LIST(own_2, "own 2", "Eigen 2", "Eigen 2", "Egen 2") +MAKE_PSTR_LIST(singles, "singles", "Singles", "Singles", "Singlar") +MAKE_PSTR_LIST(am, "am", "Vormittag", "Ochtend", "Förmiddag") +MAKE_PSTR_LIST(pm, "pm", "Nachmittag", "Namiddag", "Eftermiddag") +MAKE_PSTR_LIST(midday, "midday", "Mittag", "Middag", "Middag") +MAKE_PSTR_LIST(unknown, "unknown", "Unbekannt", "Onbekend", "Okänt") +MAKE_PSTR_LIST(flat, "flat", "flach", "vlak", "Platt") +MAKE_PSTR_LIST(vacuum, "vacuum", "Vakuum", "vacuum", "Vakuum") +MAKE_PSTR_LIST(co2_optimized, "co2 optimized", "CO2 optimiert", "CO2 geoptimaliseerd", "CO2-optimerad") +MAKE_PSTR_LIST(cost_optimized, "cost optimized", "kostenoptimiert", "kosten geoptimaliseerd", "kostnadsoptimerad") +MAKE_PSTR_LIST(outside_temp_switched, "outside temp switched", "Außentemp. gesteuert", "Buitentemp. gestuurd", "Utomhustemp korrigerad") +MAKE_PSTR_LIST(co2_cost_mix, "co2 cost mix", "Kostenmix", "Kostenmix", "Kostnadsmix") +MAKE_PSTR_LIST(analog, "analog", "analog", "analoog", "analog") +MAKE_PSTR_LIST(normal, "normal", "normal", "normaal", "normal") +MAKE_PSTR_LIST(blocking, "blocking", "Blockierung", "Blokkering", "Blockering") // boiler -MAKE_PSTR_LIST(time, F("time"), F("Zeit"), F("Tijd"), F("Tid")) -MAKE_PSTR_LIST(date, F("date"), F("Datum"), F("Datum"), F("Datum")) -MAKE_PSTR_LIST(continuous, F("continuous"), F("kontinuierlich"), F("continue"), F("kontinuerlig")) -MAKE_PSTR_LIST(3wayvalve, F("3-way valve"), F("3-Wege Ventil"), F("3-weg klep"), F("trevägsventil")) -MAKE_PSTR_LIST(chargepump, F("chargepump"), F("Ladepumpe"), F("laadpomp"), F("laddpump")) -MAKE_PSTR_LIST(hot, F("hot"), F("Heiß"), F("Heet"), F("Het")) -MAKE_PSTR_LIST(high_comfort, F("high comfort"), F("gehobener Komfort"), F("Verhoogd comfort"), F("Förhöjd komfort")) -MAKE_PSTR_LIST(eco, F("eco"), F("Eco"), F("Eco"), F("Eko")) -MAKE_PSTR_LIST(intelligent, F("intelligent"), F("Intelligent"), F("Intelligent"), F("Intelligent")) -MAKE_PSTR_LIST(flow, F("flow"), F("Durchfluss"), F("Volumestroom"), F("Flöde")) -MAKE_PSTR_LIST(manual, F("manual"), F("Manuell"), F("Hamdmatig"), F("Manuell")) -MAKE_PSTR_LIST(buffer, F("buffer"), F("Speicher"), F("Buffer"), F("Buffert")) -MAKE_PSTR_LIST(bufferedflow, F("buffered flow"), F("Durchlaufspeicher"), F("Doorstroombuffer"), F("Buffertflöde")) -MAKE_PSTR_LIST(layeredbuffer, F("layered buffer"), F("Schichtspeicher"), F("Gelaagde buffer"), F("Lagrad buffert")) -MAKE_PSTR_LIST(maintenance, F("maintenance"), F("Wartung"), F("Onderhoud"), F("Underhåll")) -MAKE_PSTR_LIST(heating, F("heating"), F("Heizen"), F("Verwarmen"), F("Uppvärmning")) -MAKE_PSTR_LIST(cooling, F("cooling"), F("Kühlen"), F("Koelen"), F("Kyler")) -MAKE_PSTR_LIST(disinfecting, F("disinfecting"), F("Desinfizieren"), F("Desinfecteren"), F("Desinficerar")) -MAKE_PSTR_LIST(no_heat, F("no heat"), F("keine Wärme"), F("Geen warmte"), F("Ingen värme")) -MAKE_PSTR_LIST(heatrequest, F("heat request"), F("Wärmeanforderung"), F("Verwarmignsverzoek"), F("Värmeförfrågan")) -MAKE_PSTR_LIST(valve, F("valve"), F("Ventil"), F("Klep"), F("Ventil")) +MAKE_PSTR_LIST(time, "time", "Zeit", "Tijd", "Tid") +MAKE_PSTR_LIST(date, "date", "Datum", "Datum", "Datum") +MAKE_PSTR_LIST(continuous, "continuous", "kontinuierlich", "continue", "kontinuerlig") +MAKE_PSTR_LIST(3wayvalve, "3-way valve", "3-Wege Ventil", "3-weg klep", "trevägsventil") +MAKE_PSTR_LIST(chargepump, "chargepump", "Ladepumpe", "laadpomp", "laddpump") +MAKE_PSTR_LIST(hot, "hot", "Heiß", "Heet", "Het") +MAKE_PSTR_LIST(high_comfort, "high comfort", "gehobener Komfort", "Verhoogd comfort", "Förhöjd komfort") +MAKE_PSTR_LIST(eco, "eco", "Eco", "Eco", "Eko") +MAKE_PSTR_LIST(intelligent, "intelligent", "Intelligent", "Intelligent", "Intelligent") +MAKE_PSTR_LIST(flow, "flow", "Durchfluss", "Volumestroom", "Flöde") +MAKE_PSTR_LIST(manual, "manual", "Manuell", "Hamdmatig", "Manuell") +MAKE_PSTR_LIST(buffer, "buffer", "Speicher", "Buffer", "Buffert") +MAKE_PSTR_LIST(bufferedflow, "buffered flow", "Durchlaufspeicher", "Doorstroombuffer", "Buffertflöde") +MAKE_PSTR_LIST(layeredbuffer, "layered buffer", "Schichtspeicher", "Gelaagde buffer", "Lagrad buffert") +MAKE_PSTR_LIST(maintenance, "maintenance", "Wartung", "Onderhoud", "Underhåll") +MAKE_PSTR_LIST(heating, "heating", "Heizen", "Verwarmen", "Uppvärmning") +MAKE_PSTR_LIST(cooling, "cooling", "Kühlen", "Koelen", "Kyler") +MAKE_PSTR_LIST(disinfecting, "disinfecting", "Desinfizieren", "Desinfecteren", "Desinficerar") +MAKE_PSTR_LIST(no_heat, "no heat", "keine Wärme", "Geen warmte", "Ingen värme") +MAKE_PSTR_LIST(heatrequest, "heat request", "Wärmeanforderung", "Verwarmignsverzoek", "Värmeförfrågan") +MAKE_PSTR_LIST(valve, "valve", "Ventil", "Klep", "Ventil") // heatpump -MAKE_PSTR_LIST(none, F("none"), F("keine"), F("geen"), F("ingen")) -MAKE_PSTR_LIST(hot_water, F("hot water"), F("Warmwasser"), F("warm water"), F("varmvatten")) -MAKE_PSTR_LIST(pool, F("pool"), F("Pool"), F("zwembad"), F("pool")) +MAKE_PSTR_LIST(none, "none", "keine", "geen", "ingen") +MAKE_PSTR_LIST(hot_water, "hot water", "Warmwasser", "warm water", "varmvatten") +MAKE_PSTR_LIST(pool, "pool", "Pool", "zwembad", "pool") // thermostat -MAKE_PSTR_LIST(seltemp, F("selTemp"), F("Solltemperatur"), F("Doeltemperatuur"), F("Börtemperatur")) -MAKE_PSTR_LIST(roomtemp, F("roomTemp"), F("Raumtemperatur"), F("Kamertemperatuur"), F("Rumstemperatur")) -MAKE_PSTR_LIST(own_prog, F("own prog"), F("Eigenprog."), F("Eigen prog."), F("Egen prog.")) -MAKE_PSTR_LIST(std_prog, F("std prog"), F("Standardprog."), F("Standaard prog."), F("Standardprog.")) -MAKE_PSTR_LIST(light, F("light"), F("Leicht"), F("Licht"), F("Lätt")) -MAKE_PSTR_LIST(medium, F("medium"), F("Mittel"), F("Middel"), F("Medel")) -MAKE_PSTR_LIST(heavy, F("heavy"), F("Schwer"), F("Zwaar"), F("Tung")) -MAKE_PSTR_LIST(start, F("start"), F("Start"), F("Start"), F("Start")) -MAKE_PSTR_LIST(heat, F("heat"), F("Heizen"), F("Verwarmen"), F("Värme")) -MAKE_PSTR_LIST(hold, F("hold"), F("Halten"), F("Pauzeren"), F("Paus")) -MAKE_PSTR_LIST(cool, F("cool"), F("Kühlen"), F("Koelen"), F("Kyla")) -MAKE_PSTR_LIST(end, F("end"), F("Ende"), F("Einde"), F("Slut")) -MAKE_PSTR_LIST(german, F("german"), F("Deutsch"), F("Duits"), F("Tyska")) -MAKE_PSTR_LIST(dutch, F("dutch"), F("Niederländisch"), F("Nederlands"), F("Nederländska")) -MAKE_PSTR_LIST(french, F("french"), F("Französisch"), F("Frans"), F("Franska")) -MAKE_PSTR_LIST(italian, F("italian"), F("Italienisch"), F("Italiaans"), F("Italienska")) -MAKE_PSTR_LIST(high, F("high"), F("hoch"), F("hoog"), F("Hög")) -MAKE_PSTR_LIST(low, F("low"), F("niedrig"), F("laag"), F("Låg")) -MAKE_PSTR_LIST(radiator, F("radiator"), F("Heizkörper"), F("Radiator"), F("Radiator")) -MAKE_PSTR_LIST(convector, F("convector"), F("Konvektor"), F("Convector"), F("Konvektor")) -MAKE_PSTR_LIST(floor, F("floor"), F("Fussboden"), F("Vloer"), F("Golv")) -MAKE_PSTR_LIST(summer, F("summer"), F("Sommer"), F("Zomer"), F("Sommar")) -MAKE_PSTR_LIST(winter, F("winter"), F("Winter"), F("Winter"), F("Vinter")) -MAKE_PSTR_LIST(outdoor, F("outdoor"), F("Außen"), F("Buiten"), F("Utomhus")) -MAKE_PSTR_LIST(room, F("room"), F("Raum"), F("Kamer"), F("Rum")) -MAKE_PSTR_LIST(room_outdoor, F("room outdoor"), F("Raum+Außen"), F("Kamer+Buiten"), F("Rum+Ute")) -MAKE_PSTR_LIST(power, F("power"), F("Leistung"), F("Vermogen"), F("Effekt")) -MAKE_PSTR_LIST(constant, F("constant"), F("konstant"), F("constant"), F("Konstant")) -MAKE_PSTR_LIST(simple, F("simple"), F("einfach"), F("simpel"), F("enkel")) -MAKE_PSTR_LIST(optimized, F("optimized"), F("optimiert"), F("geoptimaliseerd"), F("optimerad")) -MAKE_PSTR_LIST(nofrost, F("nofrost"), F("Frostschutz"), F("Vorstbescherming"), F("Frostskydd")) -MAKE_PSTR_LIST(comfort, F("comfort"), F("Komfort"), F("Comfort"), F("Komfort")) -MAKE_PSTR_LIST(night, F("night"), F("Nacht"), F("Nacht"), F("Natt")) -MAKE_PSTR_LIST(day, F("day"), F("Tag"), F("Dag"), F("Dag")) -MAKE_PSTR_LIST(holiday, F("holiday"), F("Urlaub"), F("Vakantie"), F("Helgdag")) -MAKE_PSTR_LIST(reduce, F("reduce"), F("reduziert"), F("gereduceerd"), F("Reducera")) -MAKE_PSTR_LIST(noreduce, F("no reduce"), F("unreduziert"), F("niet gerduceerd"), F("oreducerad")) -MAKE_PSTR_LIST(offset, F("offset"), F("Anhebung"), F("offset"), F("Förskutning")) -MAKE_PSTR_LIST(design, F("design"), F("Auslegung"), F("Ontwero"), F("Design")) -MAKE_PSTR_LIST(minflow, F("min flow"), F("min. Durchfluss"), F("Min. Doorstroom"), F("Min flöde")) -MAKE_PSTR_LIST(maxflow, F("max flow"), F("max. Durchfluss"), F("Max. Doorstroom"), F("Max flöde")) -MAKE_PSTR_LIST(fast, F("fast"), F("schnell"), F("snel"), F("snabb")) -MAKE_PSTR_LIST(slow, F("slow"), F("langsam"), F("langzaam"), F("långsam")) -MAKE_PSTR_LIST(internal_temperature, F("internal temperature"), F("Interne Temperatur"), F("Interne Temperatuur"), F("Interntemperatur")) -MAKE_PSTR_LIST(internal_setpoint, F("internal setpoint"), F("Interner Sollwert"), F("Interne Streeftemperatuur"), F("Internt börvärde")) -MAKE_PSTR_LIST(external_temperature, F("external temperature"), F("Externe Temperatur"), F("Externe Temperatuur"), F("Extern temperatur")) -MAKE_PSTR_LIST(burner_temperature, F("burner temperature"), F("Brennertemperatur"), F("Brander Temperuur"), F("Brännartemperatur")) -MAKE_PSTR_LIST(ww_temperature, F("ww temperature"), F("Wassertemperatur"), F("Watertemperatuur"), F("Vattentemperatur")) -MAKE_PSTR_LIST(smoke_temperature, F("smoke temperature"), F("Abgastemperatur"), F("Buitentemperatuur"), F("Rökgastemperatur")) -MAKE_PSTR_LIST(weather_compensated, F("weather compensated"), F("Wetter kompensiert"), F("Weer gecompenseerd"), F("Väderkompenserad")) -MAKE_PSTR_LIST(outside_basepoint, F("outside basepoint"), F("Basispunkt Außentemp."), F("Buiten basispunt"), F("Utomhus baspunkt")) -MAKE_PSTR_LIST(functioning_mode, F("functioning mode"), F("Funktionsweise"), F("Functiemodus"), F("Driftläge")) +MAKE_PSTR_LIST(seltemp, "selTemp", "Solltemperatur", "Doeltemperatuur", "Börtemperatur") +MAKE_PSTR_LIST(roomtemp, "roomTemp", "Raumtemperatur", "Kamertemperatuur", "Rumstemperatur") +MAKE_PSTR_LIST(own_prog, "own prog", "Eigenprog.", "Eigen prog.", "Egen prog.") +MAKE_PSTR_LIST(std_prog, "std prog", "Standardprog.", "Standaard prog.", "Standardprog.") +MAKE_PSTR_LIST(light, "light", "Leicht", "Licht", "Lätt") +MAKE_PSTR_LIST(medium, "medium", "Mittel", "Middel", "Medel") +MAKE_PSTR_LIST(heavy, "heavy", "Schwer", "Zwaar", "Tung") +MAKE_PSTR_LIST(start, "start", "Start", "Start", "Start") +MAKE_PSTR_LIST(heat, "heat", "Heizen", "Verwarmen", "Värme") +MAKE_PSTR_LIST(hold, "hold", "Halten", "Pauzeren", "Paus") +MAKE_PSTR_LIST(cool, "cool", "Kühlen", "Koelen", "Kyla") +MAKE_PSTR_LIST(end, "end", "Ende", "Einde", "Slut") +MAKE_PSTR_LIST(german, "german", "Deutsch", "Duits", "Tyska") +MAKE_PSTR_LIST(dutch, "dutch", "Niederländisch", "Nederlands", "Nederländska") +MAKE_PSTR_LIST(french, "french", "Französisch", "Frans", "Franska") +MAKE_PSTR_LIST(italian, "italian", "Italienisch", "Italiaans", "Italienska") +MAKE_PSTR_LIST(high, "high", "hoch", "hoog", "Hög") +MAKE_PSTR_LIST(low, "low", "niedrig", "laag", "Låg") +MAKE_PSTR_LIST(radiator, "radiator", "Heizkörper", "Radiator", "Radiator") +MAKE_PSTR_LIST(convector, "convector", "Konvektor", "Convector", "Konvektor") +MAKE_PSTR_LIST(floor, "floor", "Fussboden", "Vloer", "Golv") +MAKE_PSTR_LIST(summer, "summer", "Sommer", "Zomer", "Sommar") +MAKE_PSTR_LIST(winter, "winter", "Winter", "Winter", "Vinter") +MAKE_PSTR_LIST(outdoor, "outdoor", "Außen", "Buiten", "Utomhus") +MAKE_PSTR_LIST(room, "room", "Raum", "Kamer", "Rum") +MAKE_PSTR_LIST(room_outdoor, "room outdoor", "Raum+Außen", "Kamer+Buiten", "Rum+Ute") +MAKE_PSTR_LIST(power, "power", "Leistung", "Vermogen", "Effekt") +MAKE_PSTR_LIST(constant, "constant", "konstant", "constant", "Konstant") +MAKE_PSTR_LIST(simple, "simple", "einfach", "simpel", "enkel") +MAKE_PSTR_LIST(optimized, "optimized", "optimiert", "geoptimaliseerd", "optimerad") +MAKE_PSTR_LIST(nofrost, "nofrost", "Frostschutz", "Vorstbescherming", "Frostskydd") +MAKE_PSTR_LIST(comfort, "comfort", "Komfort", "Comfort", "Komfort") +MAKE_PSTR_LIST(night, "night", "Nacht", "Nacht", "Natt") +MAKE_PSTR_LIST(day, "day", "Tag", "Dag", "Dag") +MAKE_PSTR_LIST(holiday, "holiday", "Urlaub", "Vakantie", "Helgdag") +MAKE_PSTR_LIST(reduce, "reduce", "reduziert", "gereduceerd", "Reducera") +MAKE_PSTR_LIST(noreduce, "no reduce", "unreduziert", "niet gerduceerd", "oreducerad") +MAKE_PSTR_LIST(offset, "offset", "Anhebung", "offset", "Förskutning") +MAKE_PSTR_LIST(design, "design", "Auslegung", "Ontwero", "Design") +MAKE_PSTR_LIST(minflow, "min flow", "min. Durchfluss", "Min. Doorstroom", "Min flöde") +MAKE_PSTR_LIST(maxflow, "max flow", "max. Durchfluss", "Max. Doorstroom", "Max flöde") +MAKE_PSTR_LIST(fast, "fast", "schnell", "snel", "snabb") +MAKE_PSTR_LIST(slow, "slow", "langsam", "langzaam", "långsam") +MAKE_PSTR_LIST(internal_temperature, "internal temperature", "Interne Temperatur", "Interne Temperatuur", "Interntemperatur") +MAKE_PSTR_LIST(internal_setpoint, "internal setpoint", "Interner Sollwert", "Interne Streeftemperatuur", "Internt börvärde") +MAKE_PSTR_LIST(external_temperature, "external temperature", "Externe Temperatur", "Externe Temperatuur", "Extern temperatur") +MAKE_PSTR_LIST(burner_temperature, "burner temperature", "Brennertemperatur", "Brander Temperuur", "Brännartemperatur") +MAKE_PSTR_LIST(ww_temperature, "ww temperature", "Wassertemperatur", "Watertemperatuur", "Vattentemperatur") +MAKE_PSTR_LIST(smoke_temperature, "smoke temperature", "Abgastemperatur", "Buitentemperatuur", "Rökgastemperatur") +MAKE_PSTR_LIST(weather_compensated, "weather compensated", "Wetter kompensiert", "Weer gecompenseerd", "Väderkompenserad") +MAKE_PSTR_LIST(outside_basepoint, "outside basepoint", "Basispunkt Außentemp.", "Buiten basispunt", "Utomhus baspunkt") +MAKE_PSTR_LIST(functioning_mode, "functioning mode", "Funktionsweise", "Functiemodus", "Driftläge") // mixer -MAKE_PSTR_LIST(stopped, F("stopped"), F("gestoppt"), F("gestopt"), F("stoppad")) -MAKE_PSTR_LIST(opening, F("opening"), F("öffnen"), F("openen"), F("öppnar")) -MAKE_PSTR_LIST(closing, F("closing"), F("schließen"), F("sluiten"), F("stänger")) -MAKE_PSTR_LIST(open, F("open"), F("offen"), F("Open"), F("Öppen")) -MAKE_PSTR_LIST(close, F("close"), F("geschlossen"), F("Gesloten"), F("Stängd")) +MAKE_PSTR_LIST(stopped, "stopped", "gestoppt", "gestopt", "stoppad") +MAKE_PSTR_LIST(opening, "opening", "öffnen", "openen", "öppnar") +MAKE_PSTR_LIST(closing, "closing", "schließen", "sluiten", "stänger") +MAKE_PSTR_LIST(open, "open", "offen", "Open", "Öppen") +MAKE_PSTR_LIST(close, "close", "geschlossen", "Gesloten", "Stängd") // solar ww -MAKE_PSTR_LIST(cyl1, F("cyl 1"), F("Zyl_1"), F("Cil 1"), F("Cyl 1")) -MAKE_PSTR_LIST(cyl2, F("cyl 2"), F("Zyl_2"), F("Cil 2"), F("Cyl 2")) +MAKE_PSTR_LIST(cyl1, "cyl 1", "Zyl_1", "Cil 1", "Cyl 1") +MAKE_PSTR_LIST(cyl2, "cyl 2", "Zyl_2", "Cil 2", "Cyl 2") // Entity translations // Boiler -MAKE_PSTR_LIST(wwtapactivated, F("wwtapactivated"), F("turn on/off"), F("Durchlauferhitzer aktiv"), F("zet aan/uit"), F("sätt på/av")) -MAKE_PSTR_LIST(reset, F("reset"), F("Reset"), F("Reset"), F("Nollställ"), F("reset")) -MAKE_PSTR_LIST(oilPreHeat, F("oilpreheat"), F("oil preheating"), F("Ölvorwärmung"), F("Olie voorverwarming"), F("Förvärmning olja")) -MAKE_PSTR_LIST(heatingActive, F("heatingactive"), F("heating active"), F("Heizen aktiv"), F("Verwarming actief"), F("Uppvärmning aktiv")) -MAKE_PSTR_LIST(tapwaterActive, F("tapwateractive"), F("tapwater active"), F("Warmwasser aktiv"), F("Warm water actief"), F("Varmvatten aktiv")) -MAKE_PSTR_LIST(selFlowTemp, - F("selflowtemp"), - F("selected flow temperature"), - F("Sollwert Vorlauftemperatur"), - F("Ingestelde aanvoertemperatuur"), - F("Börvärde Flödestemperatur")) -MAKE_PSTR_LIST(selBurnPow, - F("selburnpow"), - F("burner selected max power"), - F("Sollwert Brennerleistung"), - F("Ingestelde maximale brandervermogen"), - F("Brännare vald maxeffekt")) -MAKE_PSTR_LIST(heatingPumpMod, - F("heatingpumpmod"), - F("heating pump modulation"), - F("Heizungspumpe 1 Modulation"), - F("Modulatie verwarmingspomp"), - F("Modulering Värmepump")) -MAKE_PSTR_LIST(heatingPump2Mod, - F("heatingpump2mod"), - F("heating pump 2 modulation"), - F("Heizungspumpe 2 Modulation"), - F("Modulatie verwarmingspomp 2"), - F("Modulering Värmepump 2")) -MAKE_PSTR_LIST(outdoorTemp, F("outdoortemp"), F("outside temperature"), F("Aussentemperatur"), F("Buitentemperatuur"), F("Utomhustemperatur")) -MAKE_PSTR_LIST(curFlowTemp, - F("curflowtemp"), - F("current flow temperature"), - F("aktuelle Vorlauftemperatur"), - F("Huidige aanvoertemperatuur"), - F("Aktuell flödestemperatur")) -MAKE_PSTR_LIST(retTemp, F("rettemp"), F("return temperature"), F("Rücklauftemperatur"), F("Retourtemperatuur"), F("Returtemperatur")) -MAKE_PSTR_LIST(switchTemp, F("switchtemp"), F("mixing switch temperature"), F("Mischer Schalttemperatur"), F("Mixer temperatuur"), F("Blandartemperatur")) -MAKE_PSTR_LIST(sysPress, F("syspress"), F("system pressure"), F("Systemdruck"), F("Systeemdruk"), F("systemtryck")) -MAKE_PSTR_LIST(boilTemp, F("boiltemp"), F("actual boiler temperature"), F("Kesseltemperatur"), F("Keteltemperatuur"), F("Temperatur Värmepanna")) -MAKE_PSTR_LIST(exhaustTemp, F("exhausttemp"), F("exhaust temperature"), F("Abgastemperatur"), F("Uitlaattemperatuur"), F("Avgastemperatur")) -MAKE_PSTR_LIST(burnGas, F("burngas"), F("gas"), F("Gas"), F("Gas"), F("Gas")) -MAKE_PSTR_LIST(burnGas2, F("burngas2"), F("gas stage 2"), F("Gas Stufe 2"), F("gas fase 2"), F("Gas Fas 2")) -MAKE_PSTR_LIST(flameCurr, F("flamecurr"), F("flame current"), F("Flammenstrom"), F("Vlammenstroom"), F("Lågström")) -MAKE_PSTR_LIST(heatingPump, F("heatingpump"), F("heating pump"), F("Heizungspumpe"), F("Verwarmingspomp"), F("Värmepump")) -MAKE_PSTR_LIST(fanWork, F("fanwork"), F("fan"), F("Gebläse"), F("Ventilator"), F("Fläkt")) -MAKE_PSTR_LIST(ignWork, F("ignwork"), F("ignition"), F("Zündung"), F("Ontsteking"), F("Tändning")) -MAKE_PSTR_LIST(heatingActivated, F("heatingactivated"), F("heating activated"), F("Heizen aktiviert"), F("Verwarmen geactiveerd"), F("Uppvärmning aktiv")) -MAKE_PSTR_LIST(heatingTemp, F("heatingtemp"), F("heating temperature"), F("Heizungstemperatur"), F("Verwarmingstemperatuur"), F("Uppvärmningstemperatur")) -MAKE_PSTR_LIST(pumpModMax, F("pumpmodmax"), F("boiler pump max power"), F("Kesselpumpen Maximalleistung"), F("Ketelpomp max vermogen"), F("Värmepannepump max effekt")) -MAKE_PSTR_LIST(pumpModMin, F("pumpmodmin"), F("boiler pump min power"), F("Kesselpumpen Minmalleistung"), F("Ketelpomp min vermogen"), F("Värmepannepump min effekt")) -MAKE_PSTR_LIST(pumpDelay, F("pumpdelay"), F("pump delay"), F("Pumpennachlaufzeit"), F("Pomp nalooptijd"), F("Pumpfördröjning")) -MAKE_PSTR_LIST(burnMinPeriod, F("burnminperiod"), F("burner min period"), F("Antipendelzeit"), F("Antipendeltijd"), F("Värmepanna Min Period")) -MAKE_PSTR_LIST(burnMinPower, F("burnminpower"), F("burner min power"), F("minimale Brennerleistung"), F("Minimaal brandervermogen"), F("Värmepanna Min Effekt")) -MAKE_PSTR_LIST(burnMaxPower, F("burnmaxpower"), F("burner max power"), F("maximale Brennerleistung"), F("Maximaal brandervermogen"), F("Värmepanna Max Effekt")) -MAKE_PSTR_LIST(boilHystOn, - F("boilhyston"), - F("hysteresis on temperature"), - F("Einschaltdifferenz"), - F("ketel aan hysterese verschil"), - F("Hysteres aktiveringstemperatur")) -MAKE_PSTR_LIST(boilHystOff, - F("boilhystoff"), - F("hysteresis off temperature"), - F("Ausschaltdifferenz"), - F("ketel uit hysterese verschil"), - F("Hysteres inaktiveringstemperatur")) -MAKE_PSTR_LIST(setFlowTemp, - F("setflowtemp"), - F("set flow temperature"), - F("Sollwert Vorlauftemperatur"), - F("Ingestelde aanvoertemperatuur"), - F("Börvärde Flödestemperatur")) -MAKE_PSTR_LIST(setBurnPow, F("setburnpow"), F("burner set power"), F("Sollwert Brennerleistung"), F("Ingesteld brandervermogen"), F("Värmepanna vald Effekt")) -MAKE_PSTR_LIST(curBurnPow, F("curburnpow"), F("burner current power"), F("Brennerleistung"), F("Brandervermogen"), F("Värmepanna aktuell effekt")) -MAKE_PSTR_LIST(burnStarts, F("burnstarts"), F("burner starts"), F("Brenner Starts"), F("Aantal brander starts"), F("Värmepanna antal starter")) -MAKE_PSTR_LIST(burnWorkMin, F("burnworkmin"), F("total burner operating time"), F("Brenner Laufzeit"), F("Totale branderlooptijd"), F("Värmepanna aktiva timmar")) +MAKE_PSTR_LIST(wwtapactivated, "wwtapactivated", "turn on/off", "Durchlauferhitzer aktiv", "zet aan/uit", "sätt på/av") +MAKE_PSTR_LIST(reset, "reset", "Reset", "Reset", "Nollställ", "reset") +MAKE_PSTR_LIST(oilPreHeat, "oilpreheat", "oil preheating", "Ölvorwärmung", "Olie voorverwarming", "Förvärmning olja") +MAKE_PSTR_LIST(heatingActive, "heatingactive", "heating active", "Heizen aktiv", "Verwarming actief", "Uppvärmning aktiv") +MAKE_PSTR_LIST(tapwaterActive, "tapwateractive", "tapwater active", "Warmwasser aktiv", "Warm water actief", "Varmvatten aktiv") +MAKE_PSTR_LIST(selFlowTemp, "selflowtemp", "selected flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur") +MAKE_PSTR_LIST(selBurnPow, "selburnpow", "burner selected max power", "Sollwert Brennerleistung", "Ingestelde maximale brandervermogen", "Brännare vald maxeffekt") +MAKE_PSTR_LIST(heatingPumpMod, "heatingpumpmod", "heating pump modulation", "Heizungspumpe 1 Modulation", "Modulatie verwarmingspomp", "Modulering Värmepump") +MAKE_PSTR_LIST(heatingPump2Mod, "heatingpump2mod", "heating pump 2 modulation", "Heizungspumpe 2 Modulation", "Modulatie verwarmingspomp 2", "Modulering Värmepump 2") +MAKE_PSTR_LIST(outdoorTemp, "outdoortemp", "outside temperature", "Aussentemperatur", "Buitentemperatuur", "Utomhustemperatur") +MAKE_PSTR_LIST(curFlowTemp, "curflowtemp", "current flow temperature", "aktuelle Vorlauftemperatur", "Huidige aanvoertemperatuur", "Aktuell flödestemperatur") +MAKE_PSTR_LIST(retTemp, "rettemp", "return temperature", "Rücklauftemperatur", "Retourtemperatuur", "Returtemperatur") +MAKE_PSTR_LIST(switchTemp, "switchtemp", "mixing switch temperature", "Mischer Schalttemperatur", "Mixer temperatuur", "Blandartemperatur") +MAKE_PSTR_LIST(sysPress, "syspress", "system pressure", "Systemdruck", "Systeemdruk", "systemtryck") +MAKE_PSTR_LIST(boilTemp, "boiltemp", "actual boiler temperature", "Kesseltemperatur", "Keteltemperatuur", "Temperatur Värmepanna") +MAKE_PSTR_LIST(exhaustTemp, "exhausttemp", "exhaust temperature", "Abgastemperatur", "Uitlaattemperatuur", "Avgastemperatur") +MAKE_PSTR_LIST(burnGas, "burngas", "gas", "Gas", "Gas", "Gas") +MAKE_PSTR_LIST(burnGas2, "burngas2", "gas stage 2", "Gas Stufe 2", "gas fase 2", "Gas Fas 2") +MAKE_PSTR_LIST(flameCurr, "flamecurr", "flame current", "Flammenstrom", "Vlammenstroom", "Lågström") +MAKE_PSTR_LIST(heatingPump, "heatingpump", "heating pump", "Heizungspumpe", "Verwarmingspomp", "Värmepump") +MAKE_PSTR_LIST(fanWork, "fanwork", "fan", "Gebläse", "Ventilator", "Fläkt") +MAKE_PSTR_LIST(ignWork, "ignwork", "ignition", "Zündung", "Ontsteking", "Tändning") +MAKE_PSTR_LIST(heatingActivated, "heatingactivated", "heating activated", "Heizen aktiviert", "Verwarmen geactiveerd", "Uppvärmning aktiv") +MAKE_PSTR_LIST(heatingTemp, "heatingtemp", "heating temperature", "Heizungstemperatur", "Verwarmingstemperatuur", "Uppvärmningstemperatur") +MAKE_PSTR_LIST(pumpModMax, "pumpmodmax", "boiler pump max power", "Kesselpumpen Maximalleistung", "Ketelpomp max vermogen", "Värmepannepump max effekt") +MAKE_PSTR_LIST(pumpModMin, "pumpmodmin", "boiler pump min power", "Kesselpumpen Minmalleistung", "Ketelpomp min vermogen", "Värmepannepump min effekt") +MAKE_PSTR_LIST(pumpDelay, "pumpdelay", "pump delay", "Pumpennachlaufzeit", "Pomp nalooptijd", "Pumpfördröjning") +MAKE_PSTR_LIST(burnMinPeriod, "burnminperiod", "burner min period", "Antipendelzeit", "Antipendeltijd", "Värmepanna Min Period") +MAKE_PSTR_LIST(burnMinPower, "burnminpower", "burner min power", "minimale Brennerleistung", "Minimaal brandervermogen", "Värmepanna Min Effekt") +MAKE_PSTR_LIST(burnMaxPower, "burnmaxpower", "burner max power", "maximale Brennerleistung", "Maximaal brandervermogen", "Värmepanna Max Effekt") +MAKE_PSTR_LIST(boilHystOn, "boilhyston", "hysteresis on temperature", "Einschaltdifferenz", "ketel aan hysterese verschil", "Hysteres aktiveringstemperatur") +MAKE_PSTR_LIST(boilHystOff, "boilhystoff", "hysteresis off temperature", "Ausschaltdifferenz", "ketel uit hysterese verschil", "Hysteres inaktiveringstemperatur") +MAKE_PSTR_LIST(setFlowTemp, "setflowtemp", "set flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur") +MAKE_PSTR_LIST(setBurnPow, "setburnpow", "burner set power", "Sollwert Brennerleistung", "Ingesteld brandervermogen", "Värmepanna vald Effekt") +MAKE_PSTR_LIST(curBurnPow, "curburnpow", "burner current power", "Brennerleistung", "Brandervermogen", "Värmepanna aktuell effekt") +MAKE_PSTR_LIST(burnStarts, "burnstarts", "burner starts", "Brenner Starts", "Aantal brander starts", "Värmepanna antal starter") +MAKE_PSTR_LIST(burnWorkMin, "burnworkmin", "total burner operating time", "Brenner Laufzeit", "Totale branderlooptijd", "Värmepanna aktiva timmar") MAKE_PSTR_LIST(burn2WorkMin, - F("burn2workmin"), - F("burner stage 2 operating time"), - F("Brenner Stufe 2 Laufzeit"), - F("Totale looptijd brander fase 2"), - F("Värmepanna steg 2 aktiva timmar")) -MAKE_PSTR_LIST(heatWorkMin, F("heatworkmin"), F("total heat operating time"), F("Heizung Laufzeit"), F("Totale looptijd verwarming"), F("Uppvärmning aktiva timmar")) -MAKE_PSTR_LIST(UBAuptime, F("ubauptime"), F("total UBA operating time"), F("Anlagen-Gesamtlaufzeit"), F("totale looptijd branderautomaat (UBA)"), F("Total Tid")) -MAKE_PSTR_LIST(lastCode, F("lastcode"), F("last error code"), F("Fehlerspeicher"), F("Laatste foutcode"), F("Senaste Felkod")) -MAKE_PSTR_LIST(serviceCode, F("servicecode"), F("service code"), F("Statusmeldung"), F("Statuscode"), F("Servicekod")) -MAKE_PSTR_LIST(serviceCodeNumber, F("servicecodenumber"), F("service code number"), F("Statusmeldungsnummer"), F("Status codenummer"), F("Servicekodsnummer")) -MAKE_PSTR_LIST(maintenanceMessage, F("maintenancemessage"), F("maintenance message"), F("Wartungsmeldung"), F("Onderhoudsmelding"), F("Servicemeddelande")) -MAKE_PSTR_LIST(maintenanceDate, F("maintenancedate"), F("next maintenance date"), F("Wartungsdatum"), F("Onderhoudsdatum"), F("Datum nästa Service")) -MAKE_PSTR_LIST(maintenanceType, F("maintenance"), F("maintenance scheduled"), F("Wartungsplan"), F("Onderhoud gepland"), F("Underhåll schemlagt")) -MAKE_PSTR_LIST(maintenanceTime, F("maintenancetime"), F("time to next maintenance"), F("Wartung in"), F("Onderhoud in"), F("Tid till nästa underhåll")) -MAKE_PSTR_LIST(emergencyOps, F("emergencyops"), F("emergency operation"), F("Notoperation"), F("Noodoperatie"), F("Nöddrift")) -MAKE_PSTR_LIST(emergencyTemp, F("emergencytemp"), F("emergency temperature"), F("Nottemperatur"), F("Noodtemperatuur"), F("Nödtemperatur")) + "burn2workmin", + "burner stage 2 operating time", + "Brenner Stufe 2 Laufzeit", + "Totale looptijd brander fase 2", + "Värmepanna steg 2 aktiva timmar") +MAKE_PSTR_LIST(heatWorkMin, "heatworkmin", "total heat operating time", "Heizung Laufzeit", "Totale looptijd verwarming", "Uppvärmning aktiva timmar") +MAKE_PSTR_LIST(UBAuptime, "ubauptime", "total UBA operating time", "Anlagen-Gesamtlaufzeit", "totale looptijd branderautomaat (UBA)", "Total Tid") +MAKE_PSTR_LIST(lastCode, "lastcode", "last error code", "Fehlerspeicher", "Laatste foutcode", "Senaste Felkod") +MAKE_PSTR_LIST(serviceCode, "servicecode", "service code", "Statusmeldung", "Statuscode", "Servicekod") +MAKE_PSTR_LIST(serviceCodeNumber, "servicecodenumber", "service code number", "Statusmeldungsnummer", "Status codenummer", "Servicekodsnummer") +MAKE_PSTR_LIST(maintenanceMessage, "maintenancemessage", "maintenance message", "Wartungsmeldung", "Onderhoudsmelding", "Servicemeddelande") +MAKE_PSTR_LIST(maintenanceDate, "maintenancedate", "next maintenance date", "Wartungsdatum", "Onderhoudsdatum", "Datum nästa Service") +MAKE_PSTR_LIST(maintenanceType, "maintenance", "maintenance scheduled", "Wartungsplan", "Onderhoud gepland", "Underhåll schemlagt") +MAKE_PSTR_LIST(maintenanceTime, "maintenancetime", "time to next maintenance", "Wartung in", "Onderhoud in", "Tid till nästa underhåll") +MAKE_PSTR_LIST(emergencyOps, "emergencyops", "emergency operation", "Notoperation", "Noodoperatie", "Nöddrift") +MAKE_PSTR_LIST(emergencyTemp, "emergencytemp", "emergency temperature", "Nottemperatur", "Noodtemperatuur", "Nödtemperatur") // heatpump/compress specific -MAKE_PSTR_LIST(upTimeControl, F("uptimecontrol"), F("total operating time heat"), F("Betriebszeit Heizen gesamt"), F("Totale bedrijfstijd"), F("Total tid uppvärmning")) +MAKE_PSTR_LIST(upTimeControl, "uptimecontrol", "total operating time heat", "Betriebszeit Heizen gesamt", "Totale bedrijfstijd", "Total tid uppvärmning") MAKE_PSTR_LIST(upTimeCompHeating, - F("uptimecompheating"), - F("operating time compressor heating"), - F("Betriebszeit Kompressor heizen"), - F("Bedrijfstijd compressor verwarmingsbedrijf"), - F("Total tid kompressor uppvärmning")) + "uptimecompheating", + "operating time compressor heating", + "Betriebszeit Kompressor heizen", + "Bedrijfstijd compressor verwarmingsbedrijf", + "Total tid kompressor uppvärmning") MAKE_PSTR_LIST(upTimeCompCooling, - F("uptimecompcooling"), - F("operating time compressor cooling"), - F("Betriebszeit Kompressor kühlen"), - F("Bedrijfstijd compressor koelbedrijf"), - F("Total tid kompressor kyla")) + "uptimecompcooling", + "operating time compressor cooling", + "Betriebszeit Kompressor kühlen", + "Bedrijfstijd compressor koelbedrijf", + "Total tid kompressor kyla") MAKE_PSTR_LIST(upTimeCompWw, - F("uptimecompww"), - F("operating time compressor dhw"), - F("Betriebszeit Kompressor"), - F("Bedrijfstijd compressor warmwaterbedrijf"), - F("Total tid kompressor varmvatten")) + "uptimecompww", + "operating time compressor dhw", + "Betriebszeit Kompressor", + "Bedrijfstijd compressor warmwaterbedrijf", + "Total tid kompressor varmvatten") MAKE_PSTR_LIST(upTimeCompPool, - F("uptimecomppool"), - F("operating time compressor pool"), - F("Betriebszeit Kompressor Pool"), - F("Bedrijfstijd compressor voor zwembadbedrijf"), - F("Total tid kompressor pool")) -MAKE_PSTR_LIST(totalCompStarts, - F("totalcompstarts"), - F("total compressor control starts"), - F("Kompressor Starts gesamt"), - F("Totaal compressorstarts"), - F("Kompressorstarter Totalt")) -MAKE_PSTR_LIST(heatingStarts, F("heatingstarts"), F("heating control starts"), F("Heizen Starts"), F("Starts verwarmingsbedrijf"), F("Kompressorstarter Uppvärmning")) -MAKE_PSTR_LIST(coolingStarts, F("coolingstarts"), F("cooling control starts"), F("Kühlen Starts"), F("Starts koelbedrijf"), F("Kompressorstarter Kyla")) -MAKE_PSTR_LIST(poolStarts, F("poolstarts"), F("pool control starts"), F("Pool Starts"), F("Starts zwembadbedrijf"), F("Kompressorstarter Pool")) -MAKE_PSTR_LIST(nrgConsTotal, F("nrgconstotal"), F("total energy consumption"), F("totaler Energieverbrauch"), F("Energieverbrauch gesamt"), F("Energieverbruik totaal")) + "uptimecomppool", + "operating time compressor pool", + "Betriebszeit Kompressor Pool", + "Bedrijfstijd compressor voor zwembadbedrijf", + "Total tid kompressor pool") +MAKE_PSTR_LIST(totalCompStarts, "totalcompstarts", "total compressor control starts", "Kompressor Starts gesamt", "Totaal compressorstarts", "Kompressorstarter Totalt") +MAKE_PSTR_LIST(heatingStarts, "heatingstarts", "heating control starts", "Heizen Starts", "Starts verwarmingsbedrijf", "Kompressorstarter Uppvärmning") +MAKE_PSTR_LIST(coolingStarts, "coolingstarts", "cooling control starts", "Kühlen Starts", "Starts koelbedrijf", "Kompressorstarter Kyla") +MAKE_PSTR_LIST(poolStarts, "poolstarts", "pool control starts", "Pool Starts", "Starts zwembadbedrijf", "Kompressorstarter Pool") +MAKE_PSTR_LIST(nrgConsTotal, "nrgconstotal", "total energy consumption", "totaler Energieverbrauch", "Energieverbrauch gesamt", "Energieverbruik totaal") MAKE_PSTR_LIST(nrgConsCompTotal, - F("nrgconscomptotal"), - F("total energy consumption compressor"), - F("Energieverbrauch Kompressor gesamt"), - F("Energieverbruik compressor totaal"), - F("Energiförbrukning kompressor")) + "nrgconscomptotal", + "total energy consumption compressor", + "Energieverbrauch Kompressor gesamt", + "Energieverbruik compressor totaal", + "Energiförbrukning kompressor") MAKE_PSTR_LIST(nrgConsCompHeating, - F("nrgconscompheating"), - F("energy consumption compressor heating"), - F("Energieverbrauch Kompressor heizen"), - F("Energieverbruik compressor verwarmingsbedrijf"), - F("Energiförbrukning uppvärmning")) + "nrgconscompheating", + "energy consumption compressor heating", + "Energieverbrauch Kompressor heizen", + "Energieverbruik compressor verwarmingsbedrijf", + "Energiförbrukning uppvärmning") MAKE_PSTR_LIST(nrgConsCompWw, - F("nrgconscompww"), - F("energy consumption compressor dhw"), - F("Energieverbrauch Kompressor"), - F("Energieverbruik compressor warmwaterbedrijf"), - F("Energiförbrukning varmvatten")) + "nrgconscompww", + "energy consumption compressor dhw", + "Energieverbrauch Kompressor", + "Energieverbruik compressor warmwaterbedrijf", + "Energiförbrukning varmvatten") MAKE_PSTR_LIST(nrgConsCompCooling, - F("nrgconscompcooling"), - F("energy consumption compressor cooling"), - F("Energieverbrauch Kompressor kühlen"), - F("Energieverbruik compressor koelbedrijf"), - F("Energiförbrukning kyla")) + "nrgconscompcooling", + "energy consumption compressor cooling", + "Energieverbrauch Kompressor kühlen", + "Energieverbruik compressor koelbedrijf", + "Energiförbrukning kyla") MAKE_PSTR_LIST(nrgConsCompPool, - F("nrgconscomppool"), - F("energy consumption compressor pool"), - F("Energieverbrauch Kompressor Pool"), - F("Energiebedrijf compressor zwembadbedrijf"), - F("Energiförbrukning pool")) -MAKE_PSTR_LIST(nrgSuppTotal, F("nrgsupptotal"), F("total energy supplied"), F("gesamte Energieabgabe"), F("Totaal opgewekte energie"), F("Tillförd energi")) + "nrgconscomppool", + "energy consumption compressor pool", + "Energieverbrauch Kompressor Pool", + "Energiebedrijf compressor zwembadbedrijf", + "Energiförbrukning pool") +MAKE_PSTR_LIST(nrgSuppTotal, "nrgsupptotal", "total energy supplied", "gesamte Energieabgabe", "Totaal opgewekte energie", "Tillförd energi") MAKE_PSTR_LIST(nrgSuppHeating, - F("nrgsuppheating"), - F("total energy supplied heating"), - F("gesamte Energieabgabe heizen"), - F("Opgewekte energie verwarmingsbedrijf"), - F("Tillförd energi Uppvärmning")) -MAKE_PSTR_LIST(nrgSuppWw, - F("nrgsuppww"), - F("total energy warm supplied dhw"), - F("gesamte Energieabgabe"), - F("Opgewekte energie warmwaterbedrijf"), - F("Tillförd energi Varmvatten")) -MAKE_PSTR_LIST(nrgSuppCooling, - F("nrgsuppcooling"), - F("total energy supplied cooling"), - F("gesamte Energieabgabe kühlen"), - F("Opgewekte energie koelbedrijf"), - F("Tillförd energi Kyla")) -MAKE_PSTR_LIST(nrgSuppPool, - F("nrgsupppool"), - F("total energy supplied pool"), - F("gesamte Energieabgabe Pool"), - F("Opgewekte energie zwembadbedrijf"), - F("TIllförd energi Pool")) + "nrgsuppheating", + "total energy supplied heating", + "gesamte Energieabgabe heizen", + "Opgewekte energie verwarmingsbedrijf", + "Tillförd energi Uppvärmning") +MAKE_PSTR_LIST(nrgSuppWw, "nrgsuppww", "total energy warm supplied dhw", "gesamte Energieabgabe", "Opgewekte energie warmwaterbedrijf", "Tillförd energi Varmvatten") +MAKE_PSTR_LIST(nrgSuppCooling, "nrgsuppcooling", "total energy supplied cooling", "gesamte Energieabgabe kühlen", "Opgewekte energie koelbedrijf", "Tillförd energi Kyla") +MAKE_PSTR_LIST(nrgSuppPool, "nrgsupppool", "total energy supplied pool", "gesamte Energieabgabe Pool", "Opgewekte energie zwembadbedrijf", "TIllförd energi Pool") MAKE_PSTR_LIST(auxElecHeatNrgConsTotal, - F("auxelecheatnrgconstotal"), - F("total auxiliary electrical heater energy consumption"), - F("Energieverbrauch el. Zusatzheizung"), - F("Totaal energieverbruik electrisch verwarmingselement"), - F("Energiförbrukning Elpatron")) + "auxelecheatnrgconstotal", + "total auxiliary electrical heater energy consumption", + "Energieverbrauch el. Zusatzheizung", + "Totaal energieverbruik electrisch verwarmingselement", + "Energiförbrukning Elpatron") MAKE_PSTR_LIST(auxElecHeatNrgConsHeating, - F("auxelecheatnrgconsheating"), - F("auxiliary electrical heater energy consumption heating"), - F("Energieverbrauch el. Zusatzheizung Heizen"), - F("Energieverbruik electrisch verwarmingselement voor verwarmingsbedrijf"), - F("Energiförbrukning Elpatron Uppvärmning")) + "auxelecheatnrgconsheating", + "auxiliary electrical heater energy consumption heating", + "Energieverbrauch el. Zusatzheizung Heizen", + "Energieverbruik electrisch verwarmingselement voor verwarmingsbedrijf", + "Energiförbrukning Elpatron Uppvärmning") MAKE_PSTR_LIST(auxElecHeatNrgConsWW, - F("auxelecheatnrgconsww"), - F("auxiliary electrical heater energy consumption dhw"), - F("Energieverbrauch el. Zusatzheizung"), - F("Energieverbruik electrisch verwarmingselement voor warmwaterbedrijf"), - F("Energiförbrukning Elpatron Varmvatten")) + "auxelecheatnrgconsww", + "auxiliary electrical heater energy consumption dhw", + "Energieverbrauch el. Zusatzheizung", + "Energieverbruik electrisch verwarmingselement voor warmwaterbedrijf", + "Energiförbrukning Elpatron Varmvatten") MAKE_PSTR_LIST(auxElecHeatNrgConsPool, - F("auxelecheatnrgconspool"), - F("auxiliary electrical heater energy consumption pool"), - F("Energieverbrauch el. Zusatzheizung Pool"), - F("Energieverbruik electrisch verwarmingselement voor zwembadbedrijf"), - F("Energiförbrukning Elpatron Pool")) + "auxelecheatnrgconspool", + "auxiliary electrical heater energy consumption pool", + "Energieverbrauch el. Zusatzheizung Pool", + "Energieverbruik electrisch verwarmingselement voor zwembadbedrijf", + "Energiförbrukning Elpatron Pool") -MAKE_PSTR_LIST(hpCompOn, F("hpcompon"), F("hp compressor"), F("WP Kompressor"), F("WP compressor"), F("VP Kompressor")) -MAKE_PSTR_LIST(hpHeatingOn, F("hpheatingon"), F("hp heating"), F("WP Heizen"), F("WP verwarmingsbedrijf"), F("VP Uppvärmning")) -MAKE_PSTR_LIST(hpCoolingOn, F("hpcoolingon"), F("hp cooling"), F("WP Kühlen"), F("WP koelbedrijf"), F("VP Kyla")) -MAKE_PSTR_LIST(hpWwOn, F("hpwwon"), F("hp dhw"), F("WP Warmwasser"), F("WP warmwaterbedrijf"), F("VP Varmvatten")) -MAKE_PSTR_LIST(hpPoolOn, F("hppoolon"), F("hp pool"), F("WP Pool"), F("WP zwembadbedrijf"), F("VP Pool")) -MAKE_PSTR_LIST(hpBrinePumpSpd, F("hpbrinepumpspd"), F("brine pump speed"), F("Solepumpen-Geschw."), F("Snelheid pekelpomp"), F("Hastighet Brine-pump")) -MAKE_PSTR_LIST(hpCompSpd, F("hpcompspd"), F("compressor speed"), F("Kompressor-Geschw."), F("Snelheid compressor"), F("Kompressorhastighet")) -MAKE_PSTR_LIST(hpCircSpd, F("hpcircspd"), F("circulation pump speed"), F("Zirkulationspumpen-Geschw."), F("Snelheid circulatiepomp"), F("Hastighet Cirkulationspump")) -MAKE_PSTR_LIST(hpBrineIn, F("hpbrinein"), F("brine in/evaporator"), F("Sole in/Verdampfer"), F("pekel in/verdamper"), F("Brine in/förångare")) -MAKE_PSTR_LIST(hpBrineOut, F("hpbrineout"), F("brine out/condenser"), F("Sole aus/Kondensator"), F("pekel uit/condensor"), F("Brine ut/kondensor")) -MAKE_PSTR_LIST(hpSuctionGas, F("hpsuctiongas"), F("suction gas"), F("Gasansaugung"), F("Gasaanzuiging"), F("Gasintag")) -MAKE_PSTR_LIST(hpHotGas, F("hphotgas"), F("hot gas/compressed"), F("Heißgas/verdichtet"), F("heet gas/samengeperst"), F("Hetgas/komprimerad")) -MAKE_PSTR_LIST(hpSwitchValve, F("hpswitchvalve"), F("switch valve"), F("Schaltventil"), F("schakelklep"), F("Växelventil")) -MAKE_PSTR_LIST(hpActivity, F("hpactivity"), F("compressor activity"), F("Kompressoraktivität"), F("Compressoractiviteit"), F("Kompressoraktivitet")) +MAKE_PSTR_LIST(hpCompOn, "hpcompon", "hp compressor", "WP Kompressor", "WP compressor", "VP Kompressor") +MAKE_PSTR_LIST(hpHeatingOn, "hpheatingon", "hp heating", "WP Heizen", "WP verwarmingsbedrijf", "VP Uppvärmning") +MAKE_PSTR_LIST(hpCoolingOn, "hpcoolingon", "hp cooling", "WP Kühlen", "WP koelbedrijf", "VP Kyla") +MAKE_PSTR_LIST(hpWwOn, "hpwwon", "hp dhw", "WP Warmwasser", "WP warmwaterbedrijf", "VP Varmvatten") +MAKE_PSTR_LIST(hpPoolOn, "hppoolon", "hp pool", "WP Pool", "WP zwembadbedrijf", "VP Pool") +MAKE_PSTR_LIST(hpBrinePumpSpd, "hpbrinepumpspd", "brine pump speed", "Solepumpen-Geschw.", "Snelheid pekelpomp", "Hastighet Brine-pump") +MAKE_PSTR_LIST(hpCompSpd, "hpcompspd", "compressor speed", "Kompressor-Geschw.", "Snelheid compressor", "Kompressorhastighet") +MAKE_PSTR_LIST(hpCircSpd, "hpcircspd", "circulation pump speed", "Zirkulationspumpen-Geschw.", "Snelheid circulatiepomp", "Hastighet Cirkulationspump") +MAKE_PSTR_LIST(hpBrineIn, "hpbrinein", "brine in/evaporator", "Sole in/Verdampfer", "pekel in/verdamper", "Brine in/förångare") +MAKE_PSTR_LIST(hpBrineOut, "hpbrineout", "brine out/condenser", "Sole aus/Kondensator", "pekel uit/condensor", "Brine ut/kondensor") +MAKE_PSTR_LIST(hpSuctionGas, "hpsuctiongas", "suction gas", "Gasansaugung", "Gasaanzuiging", "Gasintag") +MAKE_PSTR_LIST(hpHotGas, "hphotgas", "hot gas/compressed", "Heißgas/verdichtet", "heet gas/samengeperst", "Hetgas/komprimerad") +MAKE_PSTR_LIST(hpSwitchValve, "hpswitchvalve", "switch valve", "Schaltventil", "schakelklep", "Växelventil") +MAKE_PSTR_LIST(hpActivity, "hpactivity", "compressor activity", "Kompressoraktivität", "Compressoractiviteit", "Kompressoraktivitet") -MAKE_PSTR_LIST(hpPower, F("hppower"), F("compressor power output"), F("Kompressorleistung"), F("Compressorvermogen"), F("Kompressoreffekt")) -MAKE_PSTR_LIST(hpTc0, F("hptc0"), F("heat carrier return (TC0)"), F("Kältemittel Rücklauf (TC0)"), F("Koudemiddel retour (TC0O"), F("Värmebärare Retur (TC0)")) -MAKE_PSTR_LIST(hpTc1, F("hptc1"), F("heat carrier forward (TC1)"), F("Kältemittel Vorlauf (TC1)"), F("Koudemiddel aanvoer (TC1)"), F("Värmebärare Framledning (TC1)")) -MAKE_PSTR_LIST(hpTc3, F("hptc3"), F("condenser temperature (TC3)"), F("Verflüssigertemperatur (TC3)"), F("Condensortemperatuur (TC3)"), F("Kondensortemperatur (TC3)")) +MAKE_PSTR_LIST(hpPower, "hppower", "compressor power output", "Kompressorleistung", "Compressorvermogen", "Kompressoreffekt") +MAKE_PSTR_LIST(hpTc0, "hptc0", "heat carrier return (TC0)", "Kältemittel Rücklauf (TC0)", "Koudemiddel retour (TC0O", "Värmebärare Retur (TC0)") +MAKE_PSTR_LIST(hpTc1, "hptc1", "heat carrier forward (TC1)", "Kältemittel Vorlauf (TC1)", "Koudemiddel aanvoer (TC1)", "Värmebärare Framledning (TC1)") +MAKE_PSTR_LIST(hpTc3, "hptc3", "condenser temperature (TC3)", "Verflüssigertemperatur (TC3)", "Condensortemperatuur (TC3)", "Kondensortemperatur (TC3)") MAKE_PSTR_LIST(hpTr3, - F("hptr3"), - F("refrigerant temperature liquid side (condenser output) (TR3)"), - F("Kältemittel (flüssig) (TR3)"), - F("Temperatuur koudemiddel vloeibare zijde (TR3)"), - F("Köldmedium temperatur (kondensorutlopp) (TR3)")) -MAKE_PSTR_LIST(hpTr4, - F("hptr4"), - F("evaporator inlet temperature (TR4)"), - F("Verdampfer Eingang (TR4)"), - F("Verdamper ingangstemperatuur (TR4)"), - F("Förångare inloppstemp (TR4)")) -MAKE_PSTR_LIST(hpTr5, - F("hptr5"), - F("compressor inlet temperature (TR5)"), - F("Kompessoreingang (TR5)"), - F("Compressor ingangstemperatuur (TR5)"), - F("Kompressor inloppstemp (TR5)")) -MAKE_PSTR_LIST(hpTr6, - F("hptr6"), - F("compressor outlet temperature (TR6)"), - F("Kompressorausgang (TR6)"), - F("Compressor uitgangstemperatuur (TR6)"), - F("Kompressor utloppstemp (TR6)")) + "hptr3", + "refrigerant temperature liquid side (condenser output) (TR3)", + "Kältemittel (flüssig) (TR3)", + "Temperatuur koudemiddel vloeibare zijde (TR3)", + "Köldmedium temperatur (kondensorutlopp) (TR3)") +MAKE_PSTR_LIST(hpTr4, "hptr4", "evaporator inlet temperature (TR4)", "Verdampfer Eingang (TR4)", "Verdamper ingangstemperatuur (TR4)", "Förångare inloppstemp (TR4)") +MAKE_PSTR_LIST(hpTr5, "hptr5", "compressor inlet temperature (TR5)", "Kompessoreingang (TR5)", "Compressor ingangstemperatuur (TR5)", "Kompressor inloppstemp (TR5)") +MAKE_PSTR_LIST(hpTr6, "hptr6", "compressor outlet temperature (TR6)", "Kompressorausgang (TR6)", "Compressor uitgangstemperatuur (TR6)", "Kompressor utloppstemp (TR6)") MAKE_PSTR_LIST(hpTr7, - F("hptr7"), - F("refrigerant temperature gas side (condenser input) (TR7)"), - F("Kältemittel (gasförmig) (TR7)"), - F("Temperatuur koudemiddel gasvormig (TR7)"), - F("Köldmedium temperatur gassida (kondensorinlopp) (TR7)")) -MAKE_PSTR_LIST(hpTl2, - F("hptl2"), - F("air inlet temperature (TL2)"), - F("Außenluft-Einlasstemperatur (TL2)"), - F("Temperatuur luchtinlaat (TL2)"), - F("Luftintagstemperatur (TL2)")) -MAKE_PSTR_LIST(hpPl1, - F("hppl1"), - F("low pressure side temperature (PL1)"), - F("Niederdruckfühler (PL1)"), - F("Temperatuur lage drukzijde (PL1)"), - F("Temperatur Lågtryckssidan (PL1)")) -MAKE_PSTR_LIST(hpPh1, - F("hpph1"), - F("high pressure side temperature (PH1)"), - F("Hochdruckfühler (PH1)"), - F("Temperatuur hoge drukzijde (PH1)"), - F("Temperatur Högtryckssidan (PH1)")) + "hptr7", + "refrigerant temperature gas side (condenser input) (TR7)", + "Kältemittel (gasförmig) (TR7)", + "Temperatuur koudemiddel gasvormig (TR7)", + "Köldmedium temperatur gassida (kondensorinlopp) (TR7)") +MAKE_PSTR_LIST(hpTl2, "hptl2", "air inlet temperature (TL2)", "Außenluft-Einlasstemperatur (TL2)", "Temperatuur luchtinlaat (TL2)", "Luftintagstemperatur (TL2)") +MAKE_PSTR_LIST(hpPl1, "hppl1", "low pressure side temperature (PL1)", "Niederdruckfühler (PL1)", "Temperatuur lage drukzijde (PL1)", "Temperatur Lågtryckssidan (PL1)") +MAKE_PSTR_LIST(hpPh1, "hpph1", "high pressure side temperature (PH1)", "Hochdruckfühler (PH1)", "Temperatuur hoge drukzijde (PH1)", "Temperatur Högtryckssidan (PH1)") -MAKE_PSTR_LIST(hpInput1, F("hpin1"), F("input 1 state"), F("Eingang 1 Status"), F("Status input 1"), F("Status Ingång 1")) -MAKE_PSTR_LIST(hpInput2, F("hpin2"), F("input 2 state"), F("Eingang 2 Status"), F("Status input 2"), F("Status Ingång 2")) -MAKE_PSTR_LIST(hpInput3, F("hpin3"), F("input 3 state"), F("Eingang 3 Status"), F("Status input 3"), F("Status Ingång 3")) -MAKE_PSTR_LIST(hpInput4, F("hpin4"), F("input 4 state"), F("Eingang 4 Status"), F("Status input 4"), F("Status Ingång 4")) -MAKE_PSTR_LIST(hpIn1Opt, F("hpin1opt"), F("input 1 options"), F("Eingang 1 Einstellung"), F("Instelling input 1"), F("Inställningar Ingång 1")) -MAKE_PSTR_LIST(hpIn2Opt, F("hpin2opt"), F("input 2 options"), F("Eingang 2 Einstellung"), F("Instelling input 2"), F("Inställningar Ingång 2")) -MAKE_PSTR_LIST(hpIn3Opt, F("hpin3opt"), F("input 3 options"), F("Eingang 3 Einstellung"), F("Instelling input 3"), F("Inställningar Ingång 3")) -MAKE_PSTR_LIST(hpIn4Opt, F("hpin4opt"), F("input 4 options"), F("Eingang 4 Einstellung"), F("Instelling input 4"), F("Inställningar Ingång 4")) +MAKE_PSTR_LIST(hpInput1, "hpin1", "input 1 state", "Eingang 1 Status", "Status input 1", "Status Ingång 1") +MAKE_PSTR_LIST(hpInput2, "hpin2", "input 2 state", "Eingang 2 Status", "Status input 2", "Status Ingång 2") +MAKE_PSTR_LIST(hpInput3, "hpin3", "input 3 state", "Eingang 3 Status", "Status input 3", "Status Ingång 3") +MAKE_PSTR_LIST(hpInput4, "hpin4", "input 4 state", "Eingang 4 Status", "Status input 4", "Status Ingång 4") +MAKE_PSTR_LIST(hpIn1Opt, "hpin1opt", "input 1 options", "Eingang 1 Einstellung", "Instelling input 1", "Inställningar Ingång 1") +MAKE_PSTR_LIST(hpIn2Opt, "hpin2opt", "input 2 options", "Eingang 2 Einstellung", "Instelling input 2", "Inställningar Ingång 2") +MAKE_PSTR_LIST(hpIn3Opt, "hpin3opt", "input 3 options", "Eingang 3 Einstellung", "Instelling input 3", "Inställningar Ingång 3") +MAKE_PSTR_LIST(hpIn4Opt, "hpin4opt", "input 4 options", "Eingang 4 Einstellung", "Instelling input 4", "Inställningar Ingång 4") // hybrid heatpump -MAKE_PSTR_LIST(hybridStrategy, F("hybridstrategy"), F("hybrid control strategy"), F("Hybrid Strategie"), F("Hybride strategie"), F("Hybrid kontrollstrategi")) +MAKE_PSTR_LIST(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi") MAKE_PSTR_LIST(switchOverTemp, - F("switchovertemp"), - F("outside switchover temperature"), - F("Außentemperatur für Umschaltung"), - F("Schakeltemperatuur buitentemperatuur"), - F("Utomhus Omställningstemperatur")) -MAKE_PSTR_LIST(energyCostRatio, F("energycostratio"), F("energy cost ratio"), F("Energie/Kosten-Verhältnis"), F("Energiekostenratio"), F("Energi/Kostnads-förhållande")) -MAKE_PSTR_LIST(fossileFactor, - F("fossilefactor"), - F("fossile energy factor"), - F("Energiefaktor Fossil"), - F("Energiefactor fossiele brandstof"), - F("Energifaktor fossilenergi")) -MAKE_PSTR_LIST(electricFactor, - F("electricfactor"), - F("electric energy factor"), - F("Energiefaktor elektrisch"), - F("Energiefactor electrisch"), - F("Elektrisk energifaktor")) -MAKE_PSTR_LIST(delayBoiler, F("delayboiler"), F("delay boiler support"), F("Verzögerungs-Option"), F("Vertragingsoptie"), F("Fördörjningsoption")) -MAKE_PSTR_LIST(tempDiffBoiler, - F("tempdiffboiler"), - F("temp diff boiler support"), - F("Temperaturdifferenz-Option"), - F("Verschiltemperatuuroptie"), - F("Temperaturskillnadsoption")) + "switchovertemp", + "outside switchover temperature", + "Außentemperatur für Umschaltung", + "Schakeltemperatuur buitentemperatuur", + "Utomhus Omställningstemperatur") +MAKE_PSTR_LIST(energyCostRatio, "energycostratio", "energy cost ratio", "Energie/Kosten-Verhältnis", "Energiekostenratio", "Energi/Kostnads-förhållande") +MAKE_PSTR_LIST(fossileFactor, "fossilefactor", "fossile energy factor", "Energiefaktor Fossil", "Energiefactor fossiele brandstof", "Energifaktor fossilenergi") +MAKE_PSTR_LIST(electricFactor, "electricfactor", "electric energy factor", "Energiefaktor elektrisch", "Energiefactor electrisch", "Elektrisk energifaktor") +MAKE_PSTR_LIST(delayBoiler, "delayboiler", "delay boiler support", "Verzögerungs-Option", "Vertragingsoptie", "Fördörjningsoption") +MAKE_PSTR_LIST(tempDiffBoiler, "tempdiffboiler", "temp diff boiler support", "Temperaturdifferenz-Option", "Verschiltemperatuuroptie", "Temperaturskillnadsoption") // alternative heatsource AM200 -MAKE_PSTR_LIST(aCylTopTemp, F("cyltoptemp"), F("cylinder top temperature"), F("Speichertemperatur Oben"), F("Buffer temperatuur boven"), F("Cylindertemperatur Toppen")) -MAKE_PSTR_LIST(aCylCenterTemp, - F("cylcentertemp"), - F("cylinder center temperature"), - F("Speichertemperatur Mitte"), - F("Buffer temperatuur midden"), - F("Cylindertemperatur Mitten")) -MAKE_PSTR_LIST(aCylBottomTemp, - F("cylbottomtemp"), - F("cylinder bottom temperature"), - F("Speichertemperatur Unten"), - F("Buffer temperatuur onder"), - F("Cylindertemperatur Botten")) +MAKE_PSTR_LIST(aCylTopTemp, "cyltoptemp", "cylinder top temperature", "Speichertemperatur Oben", "Buffer temperatuur boven", "Cylindertemperatur Toppen") +MAKE_PSTR_LIST(aCylCenterTemp, "cylcentertemp", "cylinder center temperature", "Speichertemperatur Mitte", "Buffer temperatuur midden", "Cylindertemperatur Mitten") +MAKE_PSTR_LIST(aCylBottomTemp, "cylbottomtemp", "cylinder bottom temperature", "Speichertemperatur Unten", "Buffer temperatuur onder", "Cylindertemperatur Botten") MAKE_PSTR_LIST(aFlowTemp, - F("altflowtemp"), - F("alternative hs flow temperature"), - F("Alternativer WE Vorlauftemperatur"), - F("Alternatieve warmtebron aanvoertemperatuur"), - F("Alternativ flödestemp värmekälla")) + "altflowtemp", + "alternative hs flow temperature", + "Alternativer WE Vorlauftemperatur", + "Alternatieve warmtebron aanvoertemperatuur", + "Alternativ flödestemp värmekälla") MAKE_PSTR_LIST(aRetTemp, - F("altrettemp"), - F("alternative hs return temperature"), - F("Alternativer WE Rücklauftemperatur"), - F("Alternatieve warmtebron retourtemperatuur"), - F("Alternativ returtemp värmekälla")) -MAKE_PSTR_LIST(sysFlowTemp, F("sysflowtemp"), F("system flow temperature"), F("System Vorlauftemperatur"), F("Systeem aanvoertemperatuur"), F("Systemflödestemperatur")) -MAKE_PSTR_LIST(sysRetTemp, F("sysrettemp"), F("system return temperature"), F("System Rücklauftemperatur"), F("Systeem retourtemperatuur"), F("Systemreturtemperatur")) -MAKE_PSTR_LIST(valveByPass, F("valvebypass"), F("bypass valve"), F("Bypass-Ventil"), F("Bypass klep"), F("Bypassventil")) -MAKE_PSTR_LIST(valveBuffer, F("valvebuffer"), F("buffer valve"), F("Puffer-Ventil"), F("Bufferklep"), F("Buffertventil")) -MAKE_PSTR_LIST(valveReturn, F("valvereturn"), F("return valve"), F("Rückfluss-Ventil"), F("Retourklep"), F("Returventil")) + "altrettemp", + "alternative hs return temperature", + "Alternativer WE Rücklauftemperatur", + "Alternatieve warmtebron retourtemperatuur", + "Alternativ returtemp värmekälla") +MAKE_PSTR_LIST(sysFlowTemp, "sysflowtemp", "system flow temperature", "System Vorlauftemperatur", "Systeem aanvoertemperatuur", "Systemflödestemperatur") +MAKE_PSTR_LIST(sysRetTemp, "sysrettemp", "system return temperature", "System Rücklauftemperatur", "Systeem retourtemperatuur", "Systemreturtemperatur") +MAKE_PSTR_LIST(valveByPass, "valvebypass", "bypass valve", "Bypass-Ventil", "Bypass klep", "Bypassventil") +MAKE_PSTR_LIST(valveBuffer, "valvebuffer", "buffer valve", "Puffer-Ventil", "Bufferklep", "Buffertventil") +MAKE_PSTR_LIST(valveReturn, "valvereturn", "return valve", "Rückfluss-Ventil", "Retourklep", "Returventil") MAKE_PSTR_LIST(aPumpMod, - F("altpumpmod"), - F("alternative hs pump modulation"), - F("Alternativer WE Pumpenmodulation"), - F("Alternatieve warmtebron pomp modulatie"), - F("Alternativ Pumpmodulering Värmekälla")) -MAKE_PSTR_LIST(heatSource, - F("heatsource"), - F("alternative heating active"), - F("Alternativer Wärmeerzeuger aktiv"), - F("Alternatieve warmtebron aktief"), - F("Alternativ Värmekälla aktiv")) + "altpumpmod", + "alternative hs pump modulation", + "Alternativer WE Pumpenmodulation", + "Alternatieve warmtebron pomp modulatie", + "Alternativ Pumpmodulering Värmekälla") +MAKE_PSTR_LIST(heatSource, "heatsource", "alternative heating active", "Alternativer Wärmeerzeuger aktiv", "Alternatieve warmtebron aktief", "Alternativ Värmekälla aktiv") -MAKE_PSTR_LIST(vr2Config, F("vr2config"), F("vr2 configuration"), F("VR2 Konfiguration"), F("VR2 configuratie"), F("VR2 Konfiguration")) +MAKE_PSTR_LIST(vr2Config, "vr2config", "vr2 configuration", "VR2 Konfiguration", "VR2 configuratie", "VR2 Konfiguration") MAKE_PSTR_LIST(ahsActivated, - F("ahsactivated"), - F("alternate heat source activation"), - F("Alt. Wärmeerzeuger aktiviert"), - F("Altenatieve warmtebron geactiveerd"), - F("Alternativ värmekälla aktivering")) -MAKE_PSTR_LIST(aPumpConfig, F("apumpconfig"), F("primary pump config"), F("Konfig. Hauptpumpe"), F("Primaire pomp configuratie"), F("Konfiguration Primärpump")) -MAKE_PSTR_LIST(aPumpSignal, F("apumpsignal"), F("output for pr1 pump"), F("Ausgang Pumpe PR1"), F("Output voor pomp PR1"), F("Utgång från pump PR1")) -MAKE_PSTR_LIST(aPumpMin, F("apumpmin"), F("min output pump pr1"), F("Minimale Pumpenansteuerung"), F("Minimale output pomp PR1"), F("Min Output Pump PR1")) -MAKE_PSTR_LIST(tempRise, F("temprise"), F("ahs return temp rise"), F("Rücklauf Temperaturerhöhung"), F("Verhoging retourtemperatuur"), F("Förhöjd returtemperatur")) -MAKE_PSTR_LIST(setReturnTemp, F("setreturntemp"), F("set temp return"), F("Soll-Rücklauftemperatur"), F("Streeftemperatuur retour"), F("Vald returtemperatur")) -MAKE_PSTR_LIST(mixRuntime, F("mixruntime"), F("mixer run time"), F("Mischer-Laufzeit"), F("Mixer looptijd"), F("Blandningsventil drifttid")) -MAKE_PSTR_LIST(bufBypass, F("bufbypass"), F("buffer bypass config"), F("Puffer-Bypass Konfig."), F("Buffer bypass configuratie"), F("Konfiguration Buffer bypass")) -MAKE_PSTR_LIST(bufMixRuntime, - F("bufmixruntime"), - F("bypass mixer run time"), - F("Speicher-Mischer-Laufzeit"), - F("Buffer mixer looptijd"), - F("Blandningsventil Bypass drifttid")) -MAKE_PSTR_LIST(bufConfig, - F("bufconfig"), - F("dhw buffer config"), - F("Konfig. Warmwasserspeicher"), - F("Warmwater boiler configuratie"), - F("Konfiguration Varmvattentank")) -MAKE_PSTR_LIST(blockMode, F("blockmode"), F("config htg. blocking mode"), F("Konfig. Sperr-Modus"), F("Configuratie blokeermodus"), F("Konfiguration Blockeringsläge")) -MAKE_PSTR_LIST(blockTerm, - F("blockterm"), - F("config of block terminal"), - F("Konfig. Sperrterminal"), - F("Configuratie blookerterminal"), - F("Konfiguration Blockeringsterminal")) -MAKE_PSTR_LIST(blockHyst, F("blockhyst"), F("hyst. for boiler block"), F("Hysterese Sperrmodus"), F("Hysterese blokeerterminal"), F("Hysteres Blockeringsmodul")) -MAKE_PSTR_LIST(releaseWait, F("releasewait"), F("boiler release wait time"), F("Wartezeit Kessel-Freigabe"), F("Wachttijd ketel vrijgave"), F("Väntetid Frisläppning")) + "ahsactivated", + "alternate heat source activation", + "Alt. Wärmeerzeuger aktiviert", + "Altenatieve warmtebron geactiveerd", + "Alternativ värmekälla aktivering") +MAKE_PSTR_LIST(aPumpConfig, "apumpconfig", "primary pump config", "Konfig. Hauptpumpe", "Primaire pomp configuratie", "Konfiguration Primärpump") +MAKE_PSTR_LIST(aPumpSignal, "apumpsignal", "output for pr1 pump", "Ausgang Pumpe PR1", "Output voor pomp PR1", "Utgång från pump PR1") +MAKE_PSTR_LIST(aPumpMin, "apumpmin", "min output pump pr1", "Minimale Pumpenansteuerung", "Minimale output pomp PR1", "Min Output Pump PR1") +MAKE_PSTR_LIST(tempRise, "temprise", "ahs return temp rise", "Rücklauf Temperaturerhöhung", "Verhoging retourtemperatuur", "Förhöjd returtemperatur") +MAKE_PSTR_LIST(setReturnTemp, "setreturntemp", "set temp return", "Soll-Rücklauftemperatur", "Streeftemperatuur retour", "Vald returtemperatur") +MAKE_PSTR_LIST(mixRuntime, "mixruntime", "mixer run time", "Mischer-Laufzeit", "Mixer looptijd", "Blandningsventil drifttid") +MAKE_PSTR_LIST(bufBypass, "bufbypass", "buffer bypass config", "Puffer-Bypass Konfig.", "Buffer bypass configuratie", "Konfiguration Buffer bypass") +MAKE_PSTR_LIST(bufMixRuntime, "bufmixruntime", "bypass mixer run time", "Speicher-Mischer-Laufzeit", "Buffer mixer looptijd", "Blandningsventil Bypass drifttid") +MAKE_PSTR_LIST(bufConfig, "bufconfig", "dhw buffer config", "Konfig. Warmwasserspeicher", "Warmwater boiler configuratie", "Konfiguration Varmvattentank") +MAKE_PSTR_LIST(blockMode, "blockmode", "config htg. blocking mode", "Konfig. Sperr-Modus", "Configuratie blokeermodus", "Konfiguration Blockeringsläge") +MAKE_PSTR_LIST(blockTerm, "blockterm", "config of block terminal", "Konfig. Sperrterminal", "Configuratie blookerterminal", "Konfiguration Blockeringsterminal") +MAKE_PSTR_LIST(blockHyst, "blockhyst", "hyst. for boiler block", "Hysterese Sperrmodus", "Hysterese blokeerterminal", "Hysteres Blockeringsmodul") +MAKE_PSTR_LIST(releaseWait, "releasewait", "boiler release wait time", "Wartezeit Kessel-Freigabe", "Wachttijd ketel vrijgave", "Väntetid Frisläppning") // the following are dhw for the boiler and automatically tagged with 'dhw' -MAKE_PSTR_LIST(wwSelTempLow, - F("wwseltemplow"), - F("selected lower temperature"), - F("untere Solltemperatur"), - F("Onderste streeftemperatuur"), - F("Vald lägstatemperatur")) -MAKE_PSTR_LIST(wwSelTempOff, - F("wwseltempoff"), - F("selected temperature for off"), - F("Solltemperatur bei AUS"), - F("Streeftemperatuur bij UIT"), - F("Vald tempereatur för AV")) +MAKE_PSTR_LIST(wwSelTempLow, "wwseltemplow", "selected lower temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Vald lägstatemperatur") +MAKE_PSTR_LIST(wwSelTempOff, "wwseltempoff", "selected temperature for off", "Solltemperatur bei AUS", "Streeftemperatuur bij UIT", "Vald tempereatur för AV") MAKE_PSTR_LIST(wwSelTempSingle, - F("wwseltempsingle"), - F("single charge temperature"), - F("Solltemperatur Einmalladung"), - F("Streeftemperatuur enkele lading"), - F("Temperatur Engångsladdning")) + "wwseltempsingle", + "single charge temperature", + "Solltemperatur Einmalladung", + "Streeftemperatuur enkele lading", + "Temperatur Engångsladdning") MAKE_PSTR_LIST(wwCylMiddleTemp, - F("wwcylmiddletemp"), - F("cylinder middle temperature (TS3)"), - F("Speichertemperature Mitte"), - F("Buffer temperatuur midden"), - F("Cylinder Temperatur Mitten (TS3)")) + "wwcylmiddletemp", + "cylinder middle temperature (TS3)", + "Speichertemperature Mitte", + "Buffer temperatuur midden", + "Cylinder Temperatur Mitten (TS3)") -MAKE_PSTR_LIST(wwSelTemp, F("wwseltemp"), F("selected temperature"), F("gewählte Temperatur"), F("Geselecteerd temperatuur"), F("Vald Temperatur")) -MAKE_PSTR_LIST(wwSetTemp, F("wwsettemp"), F("set temperature"), F("Solltemperatur"), F("Streeftemperatuut"), F("Börtempertur")) -MAKE_PSTR_LIST(wwType, F("wwtype"), F("type"), F("Typ"), F("type"), F("Typ")) -MAKE_PSTR_LIST(wwComfort, F("wwcomfort"), F("comfort"), F("Komfort"), F("Comfort"), F("Komfort")) -MAKE_PSTR_LIST(wwComfort1, F("wwcomfort1"), F("comfort mode"), F("Komfort-Modus"), F("Comfort modus"), F("Komfortläge")) -MAKE_PSTR_LIST(wwFlowTempOffset, - F("wwflowtempoffset"), - F("flow temperature offset"), - F("Vorlauftemperaturanhebung"), - F("Aanvoertemperatuur offset"), - F("Flödestemperatur förskjutning")) -MAKE_PSTR_LIST(wwMaxPower, F("wwmaxpower"), F("max power"), F("max Leistung"), F("Maximaal vermogen"), F("Max Effekt")) -MAKE_PSTR_LIST(wwCircPump, - F("wwcircpump"), - F("circulation pump available"), - F("Zirkulationspumpe vorhanden"), - F("Circulatiepomp aanwezig"), - F("Cirkulationspump tillgänglig")) -MAKE_PSTR_LIST(wwChargeType, F("wwchargetype"), F("charging type"), F("Speicher-Ladungstyp"), F("Buffer laadtype"), F("Laddningstyp")) -MAKE_PSTR_LIST(wwDisinfectionTemp, - F("wwdisinfectiontemp"), - F("disinfection temperature"), - F("Desinfektionstemperatur"), - F("Desinfectietemperatuur"), - F("Desinfektionstemperatur")) -MAKE_PSTR_LIST(wwCircMode, F("wwcircmode"), F("circulation pump mode"), F("Zirkulationspumpen-Modus"), F("Modus circulatiepomp"), F("Läge Cirkulationspump")) -MAKE_PSTR_LIST(wwCirc, F("wwcirc"), F("circulation active"), F("Zirkulation aktiv"), F("Circulatiepomp actief"), F("Cirkulation aktiv")) -MAKE_PSTR_LIST(wwCurTemp, - F("wwcurtemp"), - F("current intern temperature"), - F("aktuelle interne Temperatur"), - F("Huidige interne temperatuur"), - F("Aktuell Intern Temperatur")) -MAKE_PSTR_LIST(wwCurTemp2, - F("wwcurtemp2"), - F("current extern temperature"), - F("aktuelle externe Temperatur"), - F("Huidige externe temperatuur"), - F("Aktuell Extern Temperatur")) -MAKE_PSTR_LIST(wwCurFlow, F("wwcurflow"), F("current tap water flow"), F("aktueller Durchfluss"), F("Hudige warmwater doorstroming"), F("Aktuellt tappvattenflöde")) -MAKE_PSTR_LIST(wwStorageTemp1, - F("wwstoragetemp1"), - F("storage intern temperature"), - F("interne Speichertemperature"), - F("Interne buffertemperatuur"), - F("Beredare Intern Temperatur")) -MAKE_PSTR_LIST(wwStorageTemp2, - F("wwstoragetemp2"), - F("storage extern temperature"), - F("externer Speichertemperatur"), - F("Externe buffertemperatuur"), - F("Beredare Extern Tempereatur")) -MAKE_PSTR_LIST(wwActivated, F("wwactivated"), F("activated"), F("aktiviert"), F("geactiveerd"), F("Aktiverad")) -MAKE_PSTR_LIST(wwOneTime, F("wwonetime"), F("one time charging"), F("Einmalladung"), F("Buffer eenmalig laden"), F("Engångsladdning")) -MAKE_PSTR_LIST(wwDisinfecting, F("wwdisinfecting"), F("disinfecting"), F("Desinfizieren"), F("Desinfectie"), F("Desinficerar")) -MAKE_PSTR_LIST(wwCharging, F("wwcharging"), F("charging"), F("Laden"), F("Laden"), F("Laddar")) -MAKE_PSTR_LIST(wwChargeOptimization, F("wwchargeoptimization"), F("charge optimization"), F("Ladungsoptimierung"), F("laadoptimalisatie"), F("Laddningsoptimering")) -MAKE_PSTR_LIST(wwRecharging, F("wwrecharging"), F("recharging"), F("Nachladen"), F("herladen"), F("Omladdar")) -MAKE_PSTR_LIST(wwTempOK, F("wwtempok"), F("temperature ok"), F("Temperatur ok"), F("Temperatuur OK"), F("Temperatur OK")) -MAKE_PSTR_LIST(wwActive, F("wwactive"), F("active"), F("aktiv"), F("Actief"), F("Aktiv")) -MAKE_PSTR_LIST(ww3wayValve, F("ww3wayvalve"), F("3-way valve active"), F("3-Wegeventil aktiv"), F("3-wegklep actief"), F("Trevägsventil Aktiv")) -MAKE_PSTR_LIST(wwSetPumpPower, F("wwsetpumppower"), F("set pump power"), F("Soll Pumpenleistung"), F("Streefwaarde pompvermogen"), F("Vald pumpeffekt")) -MAKE_PSTR_LIST(wwMixerTemp, F("wwmixertemp"), F("mixer temperature"), F("Mischertemperatur"), F("Mixertemperatuur"), F("Blandningsventil-tempertur")) -MAKE_PSTR_LIST(wwStarts, F("wwstarts"), F("starts"), F("Anzahl Starts"), F("Aantal starts"), F("Antal Starter")) -MAKE_PSTR_LIST(wwStarts2, F("wwstarts2"), F("control starts2"), F("Kreis 2 Anzahl Starts"), F("Aantal starts circuit 2"), F("Antal Starter Krets 2")) -MAKE_PSTR_LIST(wwWorkM, F("wwworkm"), F("active time"), F("aktive Zeit"), F("Actieve tijd"), F("Aktiv Tid")) -MAKE_PSTR_LIST(wwHystOn, - F("wwhyston"), - F("hysteresis on temperature"), - F("Einschalttemperaturdifferenz"), - F("Inschakeltemperatuurverschil"), - F("Hysteres PÅ-temperatur")) -MAKE_PSTR_LIST(wwHystOff, - F("wwhystoff"), - F("hysteresis off temperature"), - F("Ausschalttemperaturdifferenz"), - F("Uitschakeltemperatuurverschil"), - F("Hysteres AV-temperatur")) -MAKE_PSTR_LIST(wwProgMode, F("wwprogmode"), F("program"), F("Programmmodus"), F("Programma"), F("Program")) -MAKE_PSTR_LIST(wwCircProg, F("wwcircprog"), F("circulation program"), F("Zirkulationsprogramm"), F("Circulatieprogramma"), F("Cirkulationsprogram")) -MAKE_PSTR_LIST(wwMaxTemp, F("wwmaxtemp"), F("maximum temperature"), F("Maximale Temperatur"), F("Maximale temperatuur"), F("Maximal Temperatur")) -MAKE_PSTR_LIST(wwOneTimeKey, F("wwonetimekey"), F("one time key function"), F("Einmalladungstaste"), F("Knop voor eenmalig laden buffer"), F("Engångsfunktion")) +MAKE_PSTR_LIST(wwSelTemp, "wwseltemp", "selected temperature", "gewählte Temperatur", "Geselecteerd temperatuur", "Vald Temperatur") +MAKE_PSTR_LIST(wwSetTemp, "wwsettemp", "set temperature", "Solltemperatur", "Streeftemperatuut", "Börtempertur") +MAKE_PSTR_LIST(wwType, "wwtype", "type", "Typ", "type", "Typ") +MAKE_PSTR_LIST(wwComfort, "wwcomfort", "comfort", "Komfort", "Comfort", "Komfort") +MAKE_PSTR_LIST(wwComfort1, "wwcomfort1", "comfort mode", "Komfort-Modus", "Comfort modus", "Komfortläge") +MAKE_PSTR_LIST(wwFlowTempOffset, "wwflowtempoffset", "flow temperature offset", "Vorlauftemperaturanhebung", "Aanvoertemperatuur offset", "Flödestemperatur förskjutning") +MAKE_PSTR_LIST(wwMaxPower, "wwmaxpower", "max power", "max Leistung", "Maximaal vermogen", "Max Effekt") +MAKE_PSTR_LIST(wwCircPump, "wwcircpump", "circulation pump available", "Zirkulationspumpe vorhanden", "Circulatiepomp aanwezig", "Cirkulationspump tillgänglig") +MAKE_PSTR_LIST(wwChargeType, "wwchargetype", "charging type", "Speicher-Ladungstyp", "Buffer laadtype", "Laddningstyp") +MAKE_PSTR_LIST(wwDisinfectionTemp, "wwdisinfectiontemp", "disinfection temperature", "Desinfektionstemperatur", "Desinfectietemperatuur", "Desinfektionstemperatur") +MAKE_PSTR_LIST(wwCircMode, "wwcircmode", "circulation pump mode", "Zirkulationspumpen-Modus", "Modus circulatiepomp", "Läge Cirkulationspump") +MAKE_PSTR_LIST(wwCirc, "wwcirc", "circulation active", "Zirkulation aktiv", "Circulatiepomp actief", "Cirkulation aktiv") +MAKE_PSTR_LIST(wwCurTemp, "wwcurtemp", "current intern temperature", "aktuelle interne Temperatur", "Huidige interne temperatuur", "Aktuell Intern Temperatur") +MAKE_PSTR_LIST(wwCurTemp2, "wwcurtemp2", "current extern temperature", "aktuelle externe Temperatur", "Huidige externe temperatuur", "Aktuell Extern Temperatur") +MAKE_PSTR_LIST(wwCurFlow, "wwcurflow", "current tap water flow", "aktueller Durchfluss", "Hudige warmwater doorstroming", "Aktuellt tappvattenflöde") +MAKE_PSTR_LIST(wwStorageTemp1, "wwstoragetemp1", "storage intern temperature", "interne Speichertemperature", "Interne buffertemperatuur", "Beredare Intern Temperatur") +MAKE_PSTR_LIST(wwStorageTemp2, "wwstoragetemp2", "storage extern temperature", "externer Speichertemperatur", "Externe buffertemperatuur", "Beredare Extern Tempereatur") +MAKE_PSTR_LIST(wwActivated, "wwactivated", "activated", "aktiviert", "geactiveerd", "Aktiverad") +MAKE_PSTR_LIST(wwOneTime, "wwonetime", "one time charging", "Einmalladung", "Buffer eenmalig laden", "Engångsladdning") +MAKE_PSTR_LIST(wwDisinfecting, "wwdisinfecting", "disinfecting", "Desinfizieren", "Desinfectie", "Desinficerar") +MAKE_PSTR_LIST(wwCharging, "wwcharging", "charging", "Laden", "Laden", "Laddar") +MAKE_PSTR_LIST(wwChargeOptimization, "wwchargeoptimization", "charge optimization", "Ladungsoptimierung", "laadoptimalisatie", "Laddningsoptimering") +MAKE_PSTR_LIST(wwRecharging, "wwrecharging", "recharging", "Nachladen", "herladen", "Omladdar") +MAKE_PSTR_LIST(wwTempOK, "wwtempok", "temperature ok", "Temperatur ok", "Temperatuur OK", "Temperatur OK") +MAKE_PSTR_LIST(wwActive, "wwactive", "active", "aktiv", "Actief", "Aktiv") +MAKE_PSTR_LIST(ww3wayValve, "ww3wayvalve", "3-way valve active", "3-Wegeventil aktiv", "3-wegklep actief", "Trevägsventil Aktiv") +MAKE_PSTR_LIST(wwSetPumpPower, "wwsetpumppower", "set pump power", "Soll Pumpenleistung", "Streefwaarde pompvermogen", "Vald pumpeffekt") +MAKE_PSTR_LIST(wwMixerTemp, "wwmixertemp", "mixer temperature", "Mischertemperatur", "Mixertemperatuur", "Blandningsventil-tempertur") +MAKE_PSTR_LIST(wwStarts, "wwstarts", "starts", "Anzahl Starts", "Aantal starts", "Antal Starter") +MAKE_PSTR_LIST(wwStarts2, "wwstarts2", "control starts2", "Kreis 2 Anzahl Starts", "Aantal starts circuit 2", "Antal Starter Krets 2") +MAKE_PSTR_LIST(wwWorkM, "wwworkm", "active time", "aktive Zeit", "Actieve tijd", "Aktiv Tid") +MAKE_PSTR_LIST(wwHystOn, "wwhyston", "hysteresis on temperature", "Einschalttemperaturdifferenz", "Inschakeltemperatuurverschil", "Hysteres PÅ-temperatur") +MAKE_PSTR_LIST(wwHystOff, "wwhystoff", "hysteresis off temperature", "Ausschalttemperaturdifferenz", "Uitschakeltemperatuurverschil", "Hysteres AV-temperatur") +MAKE_PSTR_LIST(wwProgMode, "wwprogmode", "program", "Programmmodus", "Programma", "Program") +MAKE_PSTR_LIST(wwCircProg, "wwcircprog", "circulation program", "Zirkulationsprogramm", "Circulatieprogramma", "Cirkulationsprogram") +MAKE_PSTR_LIST(wwMaxTemp, "wwmaxtemp", "maximum temperature", "Maximale Temperatur", "Maximale temperatuur", "Maximal Temperatur") +MAKE_PSTR_LIST(wwOneTimeKey, "wwonetimekey", "one time key function", "Einmalladungstaste", "Knop voor eenmalig laden buffer", "Engångsfunktion") // mqtt values / commands -MAKE_PSTR_LIST(switchtime, F("switchtime"), F("program switchtime"), F("Programm Schaltzeit"), F("Programma schakeltijd"), F("Program Bytestid")) -MAKE_PSTR_LIST(switchtime1, F("switchtime1"), F("own1 program switchtime"), F("Programm 1 Schaltzeit"), F("Schakeltijd programma 1"), F("Program 1 Bytestid")) -MAKE_PSTR_LIST(switchtime2, F("switchtime2"), F("own2 program switchtime"), F("Programm 2 Schaltzeit"), F("Schakeltijd programma 2"), F("Program 2 Bytestid")) -MAKE_PSTR_LIST(wwswitchtime, - F("wwswitchtime"), - F("program switchtime"), - F("Programm Schaltzeit"), - F("Warm water programma schakeltijd"), - F("Varmvattenprogram Bytestid")) +MAKE_PSTR_LIST(switchtime, "switchtime", "program switchtime", "Programm Schaltzeit", "Programma schakeltijd", "Program Bytestid") +MAKE_PSTR_LIST(switchtime1, "switchtime1", "own1 program switchtime", "Programm 1 Schaltzeit", "Schakeltijd programma 1", "Program 1 Bytestid") +MAKE_PSTR_LIST(switchtime2, "switchtime2", "own2 program switchtime", "Programm 2 Schaltzeit", "Schakeltijd programma 2", "Program 2 Bytestid") +MAKE_PSTR_LIST(wwswitchtime, "wwswitchtime", "program switchtime", "Programm Schaltzeit", "Warm water programma schakeltijd", "Varmvattenprogram Bytestid") MAKE_PSTR_LIST(wwcircswitchtime, - F("wwcircswitchtime"), - F("circulation program switchtime"), - F("Zirculationsprogramm Schaltzeit"), - F("Schakeltijd circulatieprogramma"), - F("Cirkulationsprogram Bytestid")) -MAKE_PSTR_LIST(dateTime, F("datetime"), F("date/time"), F("Datum/Zeit"), F("Datum/Tijd"), F("Datum/Tid")) -MAKE_PSTR_LIST(errorCode, F("errorcode"), F("error code"), F("Fehlermeldung"), F("Foutmeldingscode"), F("Felkod")) -MAKE_PSTR_LIST(ibaMainDisplay, F("display"), F("display"), F("Anzeige"), F("Display"), F("Display")) -MAKE_PSTR_LIST(ibaLanguage, F("language"), F("language"), F("Sprache"), F("Taal"), F("Språk")) -MAKE_PSTR_LIST(ibaClockOffset, F("clockoffset"), F("clock offset"), F("Uhrkorrektur"), F("Klokcorrectie"), F("Tidskorrigering")) -MAKE_PSTR_LIST(ibaBuildingType, F("building"), F("building type"), F("Gebäudetyp"), F(""), F("Byggnadstyp")) -MAKE_PSTR_LIST(heatingPID, F("heatingpid"), F("heating PID"), F("Heizungs-PID"), F(""), F("Uppvärmning PID")) -MAKE_PSTR_LIST(ibaCalIntTemperature, F("intoffset"), F("internal temperature offset"), F("Korrektur interner Temperatur"), F(""), F("Korrigering interntemperatur")) -MAKE_PSTR_LIST(ibaMinExtTemperature, F("minexttemp"), F("minimal external temperature"), F("min. Aussentemperatur"), F(""), F("Min Extern Temperatur")) -MAKE_PSTR_LIST(backlight, F("backlight"), F("key backlight"), F("Gegenlicht"), F("Toetsverlichting"), F("Bakgrundsbelysning")) -MAKE_PSTR_LIST(damping, - F("damping"), - F("damping outdoor temperature"), - F("Dämpfung der Außentemperatur"), - F("Demping buitentemperatuur"), - F("Dämpning Utomhustemperatur")) -MAKE_PSTR_LIST(tempsensor1, F("inttemp1"), F("temperature sensor 1"), F("Temperatursensor 1"), F("Temperatuursensor 1"), F("Temperatursensor 1")) -MAKE_PSTR_LIST(tempsensor2, F("inttemp2"), F("temperature sensor 2"), F("Temperatursensor 2"), F("Temperatuursensor 2"), F("Temperatursensor 2")) -MAKE_PSTR_LIST(dampedoutdoortemp, - F("dampedoutdoortemp"), - F("damped outdoor temperature"), - F("gedämpfte Außentemperatur"), - F("Gedempte buitentemperatuur"), - F("Dämpad Utomhustemperatur")) -MAKE_PSTR_LIST(floordrystatus, F("floordry"), F("floor drying"), F("Estrichtrocknung"), F("Vloerdroogprogramma"), F("Golvtorkning")) -MAKE_PSTR_LIST(floordrytemp, - F("floordrytemp"), - F("floor drying temperature"), - F("Estrichtrocknungs Temperatur"), - F("Temperatuur vloerdroogprogramma"), - F("Golvtorkning Temperatur")) -MAKE_PSTR_LIST(brightness, F("brightness"), F("screen brightness"), F("Bildschirmhelligkeit"), F("Schermhelderheid"), F("Ljusstyrka")) + "wwcircswitchtime", + "circulation program switchtime", + "Zirculationsprogramm Schaltzeit", + "Schakeltijd circulatieprogramma", + "Cirkulationsprogram Bytestid") +MAKE_PSTR_LIST(dateTime, "datetime", "date/time", "Datum/Zeit", "Datum/Tijd", "Datum/Tid") +MAKE_PSTR_LIST(errorCode, "errorcode", "error code", "Fehlermeldung", "Foutmeldingscode", "Felkod") +MAKE_PSTR_LIST(ibaMainDisplay, "display", "display", "Anzeige", "Display", "Display") +MAKE_PSTR_LIST(ibaLanguage, "language", "language", "Sprache", "Taal", "Språk") +MAKE_PSTR_LIST(ibaClockOffset, "clockoffset", "clock offset", "Uhrkorrektur", "Klokcorrectie", "Tidskorrigering") +MAKE_PSTR_LIST(ibaBuildingType, "building", "building type", "Gebäudetyp", "", "Byggnadstyp") +MAKE_PSTR_LIST(heatingPID, "heatingpid", "heating PID", "Heizungs-PID", "", "Uppvärmning PID") +MAKE_PSTR_LIST(ibaCalIntTemperature, "intoffset", "internal temperature offset", "Korrektur interner Temperatur", "", "Korrigering interntemperatur") +MAKE_PSTR_LIST(ibaMinExtTemperature, "minexttemp", "minimal external temperature", "min. Aussentemperatur", "", "Min Extern Temperatur") +MAKE_PSTR_LIST(backlight, "backlight", "key backlight", "Gegenlicht", "Toetsverlichting", "Bakgrundsbelysning") +MAKE_PSTR_LIST(damping, "damping", "damping outdoor temperature", "Dämpfung der Außentemperatur", "Demping buitentemperatuur", "Dämpning Utomhustemperatur") +MAKE_PSTR_LIST(tempsensor1, "inttemp1", "temperature sensor 1", "Temperatursensor 1", "Temperatuursensor 1", "Temperatursensor 1") +MAKE_PSTR_LIST(tempsensor2, "inttemp2", "temperature sensor 2", "Temperatursensor 2", "Temperatuursensor 2", "Temperatursensor 2") +MAKE_PSTR_LIST(dampedoutdoortemp, "dampedoutdoortemp", "damped outdoor temperature", "gedämpfte Außentemperatur", "Gedempte buitentemperatuur", "Dämpad Utomhustemperatur") +MAKE_PSTR_LIST(floordrystatus, "floordry", "floor drying", "Estrichtrocknung", "Vloerdroogprogramma", "Golvtorkning") +MAKE_PSTR_LIST(floordrytemp, "floordrytemp", "floor drying temperature", "Estrichtrocknungs Temperatur", "Temperatuur vloerdroogprogramma", "Golvtorkning Temperatur") +MAKE_PSTR_LIST(brightness, "brightness", "screen brightness", "Bildschirmhelligkeit", "Schermhelderheid", "Ljusstyrka") MAKE_PSTR_LIST(autodst, - F("autodst"), - F("automatic change daylight saving time"), - F("automatische Sommerzeit Umstellung"), - F("Automatische omschakeling zomer-wintertijd"), - F("Automatisk växling sommar/vinter-tid")) + "autodst", + "automatic change daylight saving time", + "automatische Sommerzeit Umstellung", + "Automatische omschakeling zomer-wintertijd", + "Automatisk växling sommar/vinter-tid") MAKE_PSTR_LIST(preheating, - F("preheating"), - F("preheating in the clock program"), - F("Vorheizen im Zeitprogramm"), - F("Voorverwarming in het klokprogramma"), - F("Förvärmning i tidsprogram")) -MAKE_PSTR_LIST(offtemp, F("offtemp"), F("temperature when mode is off"), F("Temperatur bei AUS"), F("Temperatuur bij UIT"), F("Temperatur Avslagen")) -MAKE_PSTR_LIST(mixingvalves, F("mixingvalves"), F("mixing valves"), F("Mischventile"), F("Mengkleppen"), F("Blandningsventiler")) + "preheating", + "preheating in the clock program", + "Vorheizen im Zeitprogramm", + "Voorverwarming in het klokprogramma", + "Förvärmning i tidsprogram") +MAKE_PSTR_LIST(offtemp, "offtemp", "temperature when mode is off", "Temperatur bei AUS", "Temperatuur bij UIT", "Temperatur Avslagen") +MAKE_PSTR_LIST(mixingvalves, "mixingvalves", "mixing valves", "Mischventile", "Mengkleppen", "Blandningsventiler") // thermostat ww -MAKE_PSTR_LIST(wwMode, F("wwmode"), F("mode"), F("Modus"), F("Modus"), F("Läge")) -MAKE_PSTR_LIST(wwSetTempLow, F("wwsettemplow"), F("set low temperature"), F("untere Solltemperatur"), F("Onderste streeftemperatuur"), F("Nedre Börvärde")) -MAKE_PSTR_LIST(wwWhenModeOff, - F("wwwhenmodeoff"), - F("when thermostat mode off"), - F("bei Thermostatmodus AUS"), - F("Als Thermostaat op UIT"), - F("när Termostatläge är AV")) -MAKE_PSTR_LIST(wwExtra1, F("wwextra1"), F("circuit 1 extra"), F("Kreis 1 Extra"), F("Circuit 1 extra"), F("Krets 1 Extra")) -MAKE_PSTR_LIST(wwExtra2, F("wwextra2"), F("circuit 2 extra"), F("Kreis 2 Extra"), F("Circuit 2 extra"), F("Kets 2 Extra")) +MAKE_PSTR_LIST(wwMode, "wwmode", "mode", "Modus", "Modus", "Läge") +MAKE_PSTR_LIST(wwSetTempLow, "wwsettemplow", "set low temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Nedre Börvärde") +MAKE_PSTR_LIST(wwWhenModeOff, "wwwhenmodeoff", "when thermostat mode off", "bei Thermostatmodus AUS", "Als Thermostaat op UIT", "när Termostatläge är AV") +MAKE_PSTR_LIST(wwExtra1, "wwextra1", "circuit 1 extra", "Kreis 1 Extra", "Circuit 1 extra", "Krets 1 Extra") +MAKE_PSTR_LIST(wwExtra2, "wwextra2", "circuit 2 extra", "Kreis 2 Extra", "Circuit 2 extra", "Kets 2 Extra") -MAKE_PSTR_LIST(wwCharge, F("wwcharge"), F("charge"), F("Laden"), F("Laden"), F("Ladda")) -MAKE_PSTR_LIST(wwChargeDuration, F("wwchargeduration"), F("charge duration"), F("Ladedauer"), F("Laadtijd"), F("Laddtid")) -MAKE_PSTR_LIST(wwDisinfect, F("wwdisinfect"), F("disinfection"), F("Desinfektion"), F("Desinfectie"), F("Desinfektion")) -MAKE_PSTR_LIST(wwDisinfectDay, F("wwdisinfectday"), F("disinfection day"), F("Desinfektionstag"), F("Desinfectiedag"), F("Desinfektionsdag")) -MAKE_PSTR_LIST(wwDisinfectHour, F("wwdisinfecthour"), F("disinfection hour"), F("Desinfektionsstunde"), F("Desinfectieuur"), F("Desinfektionstimme")) -MAKE_PSTR_LIST(wwDisinfectTime, F("wwdisinfecttime"), F("disinfection time"), F("Desinfektionszeit"), F("Desinfectietijd"), F("Desinfektionstid")) -MAKE_PSTR_LIST(wwDailyHeating, F("wwdailyheating"), F("daily heating"), F("täglich Heizen"), F("Dagelijks opwarmen"), F("Daglig Uppvärmning")) -MAKE_PSTR_LIST(wwDailyHeatTime, F("wwdailyheattime"), F("daily heating time"), F("tägliche Heizzeit"), F("Tijd dagelijkse opwarming"), F("Daglig Uppvärmningstid")) +MAKE_PSTR_LIST(wwCharge, "wwcharge", "charge", "Laden", "Laden", "Ladda") +MAKE_PSTR_LIST(wwChargeDuration, "wwchargeduration", "charge duration", "Ladedauer", "Laadtijd", "Laddtid") +MAKE_PSTR_LIST(wwDisinfect, "wwdisinfect", "disinfection", "Desinfektion", "Desinfectie", "Desinfektion") +MAKE_PSTR_LIST(wwDisinfectDay, "wwdisinfectday", "disinfection day", "Desinfektionstag", "Desinfectiedag", "Desinfektionsdag") +MAKE_PSTR_LIST(wwDisinfectHour, "wwdisinfecthour", "disinfection hour", "Desinfektionsstunde", "Desinfectieuur", "Desinfektionstimme") +MAKE_PSTR_LIST(wwDisinfectTime, "wwdisinfecttime", "disinfection time", "Desinfektionszeit", "Desinfectietijd", "Desinfektionstid") +MAKE_PSTR_LIST(wwDailyHeating, "wwdailyheating", "daily heating", "täglich Heizen", "Dagelijks opwarmen", "Daglig Uppvärmning") +MAKE_PSTR_LIST(wwDailyHeatTime, "wwdailyheattime", "daily heating time", "tägliche Heizzeit", "Tijd dagelijkse opwarming", "Daglig Uppvärmningstid") // thermostat hc -MAKE_PSTR_LIST(selRoomTemp, F("seltemp"), F("selected room temperature"), F("Sollwert Raumtemperatur"), F("Streeftemperatuur kamer"), F("Vald Rumstemperatur")) -MAKE_PSTR_LIST(roomTemp, F("currtemp"), F("current room temperature"), F("aktuelle Raumtemperatur"), F("Huidige kamertemperatuur"), F("Aktuell Rumstemperatur")) -MAKE_PSTR_LIST(mode, F("mode"), F("mode"), F("Modus"), F("Modus"), F("Läge")) -MAKE_PSTR_LIST(modetype, F("modetype"), F("mode type"), F("Modus Typ"), F("Type modus"), F("Typ av läge")) -MAKE_PSTR_LIST(fastheatup, F("fastheatup"), F("fast heatup"), F("schnelles Aufheizen"), F("Snel opwarmen"), F("Snabb Uppvärmning")) -MAKE_PSTR_LIST(daytemp, F("daytemp"), F("day temperature"), F("Tagestemperatur"), F("temperatuur dag"), F("Dagstemperatur")) -MAKE_PSTR_LIST(daylowtemp, F("daytemp2"), F("day temperature T2"), F("Tagestemperatur T2"), F("Temperatuur dag T2"), F("Dagstemperatur T2")) -MAKE_PSTR_LIST(daymidtemp, F("daytemp3"), F("day temperature T3"), F("Tagestemperatur T3"), F("Temperatuur dag T3"), F("Dagstemperatur T3")) -MAKE_PSTR_LIST(dayhightemp, F("daytemp4"), F("day temperature T4"), F("Tagestemperatur T4"), F("Temperatuur dag T4"), F("Dagstemperatur T4")) -MAKE_PSTR_LIST(heattemp, F("heattemp"), F("heat temperature"), F("Heizen Temperatur"), F("Temperatuur verwarming"), F("Temperatur Uppvärmning")) -MAKE_PSTR_LIST(nighttemp, F("nighttemp"), F("night temperature"), F("Nachttemperatur"), F("Nachttemperatuur"), F("Nattemperatur")) -MAKE_PSTR_LIST(nighttemp2, F("nighttemp"), F("night temperature T1"), F("Nachttemperatur T1"), F("Nachttemperatuur T1"), F("Nattemperatur T1")) -MAKE_PSTR_LIST(ecotemp, F("ecotemp"), F("eco temperature"), F("eco Temperatur"), F("Temperatuur eco"), F("Eko-temperatur")) -MAKE_PSTR_LIST(manualtemp, F("manualtemp"), F("manual temperature"), F("manuelle Temperatur"), F("temperatuur handmatig"), F("Temperatur Manuell")) +MAKE_PSTR_LIST(selRoomTemp, "seltemp", "selected room temperature", "Sollwert Raumtemperatur", "Streeftemperatuur kamer", "Vald Rumstemperatur") +MAKE_PSTR_LIST(roomTemp, "currtemp", "current room temperature", "aktuelle Raumtemperatur", "Huidige kamertemperatuur", "Aktuell Rumstemperatur") +MAKE_PSTR_LIST(mode, "mode", "mode", "Modus", "Modus", "Läge") +MAKE_PSTR_LIST(modetype, "modetype", "mode type", "Modus Typ", "Type modus", "Typ av läge") +MAKE_PSTR_LIST(fastheatup, "fastheatup", "fast heatup", "schnelles Aufheizen", "Snel opwarmen", "Snabb Uppvärmning") +MAKE_PSTR_LIST(daytemp, "daytemp", "day temperature", "Tagestemperatur", "temperatuur dag", "Dagstemperatur") +MAKE_PSTR_LIST(daylowtemp, "daytemp2", "day temperature T2", "Tagestemperatur T2", "Temperatuur dag T2", "Dagstemperatur T2") +MAKE_PSTR_LIST(daymidtemp, "daytemp3", "day temperature T3", "Tagestemperatur T3", "Temperatuur dag T3", "Dagstemperatur T3") +MAKE_PSTR_LIST(dayhightemp, "daytemp4", "day temperature T4", "Tagestemperatur T4", "Temperatuur dag T4", "Dagstemperatur T4") +MAKE_PSTR_LIST(heattemp, "heattemp", "heat temperature", "Heizen Temperatur", "Temperatuur verwarming", "Temperatur Uppvärmning") +MAKE_PSTR_LIST(nighttemp, "nighttemp", "night temperature", "Nachttemperatur", "Nachttemperatuur", "Nattemperatur") +MAKE_PSTR_LIST(nighttemp2, "nighttemp", "night temperature T1", "Nachttemperatur T1", "Nachttemperatuur T1", "Nattemperatur T1") +MAKE_PSTR_LIST(ecotemp, "ecotemp", "eco temperature", "eco Temperatur", "Temperatuur eco", "Eko-temperatur") +MAKE_PSTR_LIST(manualtemp, "manualtemp", "manual temperature", "manuelle Temperatur", "temperatuur handmatig", "Temperatur Manuell") MAKE_PSTR_LIST(tempautotemp, - F("tempautotemp"), - F("temporary set temperature automode"), - F("temporäre Solltemperatur"), - F("Streeftemperatuur automodus tijdelijk"), - F("Temporär Aktivering av Auto-läge")) + "tempautotemp", + "temporary set temperature automode", + "temporäre Solltemperatur", + "Streeftemperatuur automodus tijdelijk", + "Temporär Aktivering av Auto-läge") MAKE_PSTR_LIST(remoteseltemp, - F("remoteseltemp"), - F("temporary set temperature from remote"), - F("temporäre Solltemperatur Remote"), - F("Temperatuur van afstandsbedieding"), - F("Temperatur från fjärruppkoppling")) -MAKE_PSTR_LIST(comforttemp, F("comforttemp"), F("comfort temperature"), F("Komforttemperatur"), F("Comforttemperatuur"), F("Komforttemperatur")) -MAKE_PSTR_LIST(summertemp, F("summertemp"), F("summer temperature"), F("Sommertemperatur"), F("Zomertemperatuur"), F("Sommartemperatur")) -MAKE_PSTR_LIST(designtemp, F("designtemp"), F("design temperature"), F("Auslegungstemperatur"), F("Ontwerptemperatuur"), F("Design-temperatur")) -MAKE_PSTR_LIST(offsettemp, F("offsettemp"), F("offset temperature"), F("Temperaturanhebung"), F("Temperatuur offset"), F("Temperaturkorrigering")) -MAKE_PSTR_LIST(minflowtemp, F("minflowtemp"), F("min flow temperature"), F("min Vorlauftemperatur"), F(""), F("Min Flödestemperatur")) -MAKE_PSTR_LIST(maxflowtemp, F("maxflowtemp"), F("max flow temperature"), F("max Vorlauftemperatur"), F(""), F("Max Flödestemperatur")) -MAKE_PSTR_LIST(roominfluence, F("roominfluence"), F("room influence"), F("Raumeinfluss"), F("Ruimteinvloed"), F("Rumspåverkan")) -MAKE_PSTR_LIST(roominfl_factor, F("roominflfactor"), F("room influence factor"), F("Raumeinfluss Factor"), F("Factor ruimteinvloed"), F("Rumspåverkansfaktor")) -MAKE_PSTR_LIST(curroominfl, F("curroominfl"), F("current room influence"), F("aktueller Raumeinfluss"), F("Huidige ruimteinvloed"), F("Aktuell Rumspåverkan")) -MAKE_PSTR_LIST(nofrosttemp, F("nofrosttemp"), F("nofrost temperature"), F("Frostschutztemperatur"), F("Temperatuur vorstbeveiliging"), F("Temperatur Frostskydd")) -MAKE_PSTR_LIST(targetflowtemp, - F("targetflowtemp"), - F("target flow temperature"), - F("berechnete Vorlauftemperatur"), - F("Berekende aanvoertemperatuur"), - F("Målvärde Flödestemperatur")) -MAKE_PSTR_LIST(heatingtype, F("heatingtype"), F("heating type"), F("Heizungstyp"), F("Verwarmingstype"), F("Uppvärmningstyp")) -MAKE_PSTR_LIST(summersetmode, F("summersetmode"), F("set summer mode"), F("Einstellung Sommerbetrieb"), F("Instelling zomerbedrijf"), F("Aktivera Sommarläge")) -MAKE_PSTR_LIST(hpoperatingmode, - F("hpoperatingmode"), - F("heatpump operating mode"), - F("Wärmepumpe Betriebsmodus"), - F("Bedrijfsmodus warmtepomp"), - F("Värmepump Driftläge")) -MAKE_PSTR_LIST(hpoperatingstate, F("hpoperatingstate"), F("heatpump operating state"), F("WP Arbeitsweise"), F("Huidige modus warmtepomp"), F("Värmepump Driftstatus")) -MAKE_PSTR_LIST(controlmode, F("controlmode"), F("control mode"), F("Kontrollmodus"), F("Comtrolemodus"), F("Kontrolläge")) -MAKE_PSTR_LIST(control, F("control"), F("control device"), F("Fernsteuerung"), F("Afstandsbedieding"), F("Kontrollenhet")) -MAKE_PSTR_LIST(program, F("program"), F("program"), F("Programm"), F("Programma"), F("Program")) -MAKE_PSTR_LIST(pause, F("pause"), F("pause time"), F("Pausenzeit"), F("Pausetijd"), F("Paustid")) -MAKE_PSTR_LIST(party, F("party"), F("party time"), F("Partyzeit"), F("Partytijd"), F("Partytid")) -MAKE_PSTR_LIST(holidaytemp, F("holidaytemp"), F("holiday temperature"), F("Urlaubstemperatur"), F("Vakantietemperatuur"), F("Helgtemperatur")) -MAKE_PSTR_LIST(summermode, F("summermode"), F("summer mode"), F("Sommerbetrieb"), F("Zomerbedrijf"), F("Sommarläge")) -MAKE_PSTR_LIST(holidaymode, F("holidaymode"), F("holiday mode"), F("Urlaubsbetrieb"), F("Vakantiebedrijf"), F("Helgläge")) + "remoteseltemp", + "temporary set temperature from remote", + "temporäre Solltemperatur Remote", + "Temperatuur van afstandsbedieding", + "Temperatur från fjärruppkoppling") +MAKE_PSTR_LIST(comforttemp, "comforttemp", "comfort temperature", "Komforttemperatur", "Comforttemperatuur", "Komforttemperatur") +MAKE_PSTR_LIST(summertemp, "summertemp", "summer temperature", "Sommertemperatur", "Zomertemperatuur", "Sommartemperatur") +MAKE_PSTR_LIST(designtemp, "designtemp", "design temperature", "Auslegungstemperatur", "Ontwerptemperatuur", "Design-temperatur") +MAKE_PSTR_LIST(offsettemp, "offsettemp", "offset temperature", "Temperaturanhebung", "Temperatuur offset", "Temperaturkorrigering") +MAKE_PSTR_LIST(minflowtemp, "minflowtemp", "min flow temperature", "min Vorlauftemperatur", "", "Min Flödestemperatur") +MAKE_PSTR_LIST(maxflowtemp, "maxflowtemp", "max flow temperature", "max Vorlauftemperatur", "", "Max Flödestemperatur") +MAKE_PSTR_LIST(roominfluence, "roominfluence", "room influence", "Raumeinfluss", "Ruimteinvloed", "Rumspåverkan") +MAKE_PSTR_LIST(roominfl_factor, "roominflfactor", "room influence factor", "Raumeinfluss Factor", "Factor ruimteinvloed", "Rumspåverkansfaktor") +MAKE_PSTR_LIST(curroominfl, "curroominfl", "current room influence", "aktueller Raumeinfluss", "Huidige ruimteinvloed", "Aktuell Rumspåverkan") +MAKE_PSTR_LIST(nofrosttemp, "nofrosttemp", "nofrost temperature", "Frostschutztemperatur", "Temperatuur vorstbeveiliging", "Temperatur Frostskydd") +MAKE_PSTR_LIST(targetflowtemp, "targetflowtemp", "target flow temperature", "berechnete Vorlauftemperatur", "Berekende aanvoertemperatuur", "Målvärde Flödestemperatur") +MAKE_PSTR_LIST(heatingtype, "heatingtype", "heating type", "Heizungstyp", "Verwarmingstype", "Uppvärmningstyp") +MAKE_PSTR_LIST(summersetmode, "summersetmode", "set summer mode", "Einstellung Sommerbetrieb", "Instelling zomerbedrijf", "Aktivera Sommarläge") +MAKE_PSTR_LIST(hpoperatingmode, "hpoperatingmode", "heatpump operating mode", "Wärmepumpe Betriebsmodus", "Bedrijfsmodus warmtepomp", "Värmepump Driftläge") +MAKE_PSTR_LIST(hpoperatingstate, "hpoperatingstate", "heatpump operating state", "WP Arbeitsweise", "Huidige modus warmtepomp", "Värmepump Driftstatus") +MAKE_PSTR_LIST(controlmode, "controlmode", "control mode", "Kontrollmodus", "Comtrolemodus", "Kontrolläge") +MAKE_PSTR_LIST(control, "control", "control device", "Fernsteuerung", "Afstandsbedieding", "Kontrollenhet") +MAKE_PSTR_LIST(program, "program", "program", "Programm", "Programma", "Program") +MAKE_PSTR_LIST(pause, "pause", "pause time", "Pausenzeit", "Pausetijd", "Paustid") +MAKE_PSTR_LIST(party, "party", "party time", "Partyzeit", "Partytijd", "Partytid") +MAKE_PSTR_LIST(holidaytemp, "holidaytemp", "holiday temperature", "Urlaubstemperatur", "Vakantietemperatuur", "Helgtemperatur") +MAKE_PSTR_LIST(summermode, "summermode", "summer mode", "Sommerbetrieb", "Zomerbedrijf", "Sommarläge") +MAKE_PSTR_LIST(holidaymode, "holidaymode", "holiday mode", "Urlaubsbetrieb", "Vakantiebedrijf", "Helgläge") MAKE_PSTR_LIST(flowtempoffset, - F("flowtempoffset"), - F("flow temperature offset for mixer"), - F("Vorlauftemperaturanhebung"), - F("Mixer aanvoertemperatuur offset"), - F("Temperaturkorrigering Flödestemp. Blandningsventil")) -MAKE_PSTR_LIST(reducemode, F("reducemode"), F("reduce mode"), F("Absenkmodus"), F("Gereduceerde modus"), F("Reducerat Läge")) -MAKE_PSTR_LIST(noreducetemp, - F("noreducetemp"), - F("no reduce below temperature"), - F("Durchheizen unter"), - F("Reduceermodus onderbreken onder"), - F("Inaktivera reducering under")) -MAKE_PSTR_LIST(reducetemp, F("reducetemp"), F("off/reduce switch temperature"), F("Absenkmodus unter"), F("Onderste afschakeltemperatuur"), F("Avslag/Reducera under")) + "flowtempoffset", + "flow temperature offset for mixer", + "Vorlauftemperaturanhebung", + "Mixer aanvoertemperatuur offset", + "Temperaturkorrigering Flödestemp. Blandningsventil") +MAKE_PSTR_LIST(reducemode, "reducemode", "reduce mode", "Absenkmodus", "Gereduceerde modus", "Reducerat Läge") +MAKE_PSTR_LIST(noreducetemp, "noreducetemp", "no reduce below temperature", "Durchheizen unter", "Reduceermodus onderbreken onder", "Inaktivera reducering under") +MAKE_PSTR_LIST(reducetemp, "reducetemp", "off/reduce switch temperature", "Absenkmodus unter", "Onderste afschakeltemperatuur", "Avslag/Reducera under") MAKE_PSTR_LIST(vacreducetemp, - F("vacreducetemp"), - F("vacations off/reduce switch temperature"), - F("Urlaub Absenkmodus unter"), - F("Vakantiemodus onderste afschakeltemperatuur"), - F("Helg Avslag/Reducering under")) -MAKE_PSTR_LIST(vacreducemode, F("vacreducemode"), F("vacations reduce mode"), F("Urlaub Absenkmodus"), F("Vakantie afschakelmodus"), F("Helg reduceringsläge")) -MAKE_PSTR_LIST(nofrostmode, F("nofrostmode"), F("nofrost mode"), F("Frostschutz Modus"), F("Vorstbeveiligingsmodus"), F("Frostskyddsläge")) -MAKE_PSTR_LIST(remotetemp, - F("remotetemp"), - F("room temperature from remote"), - F("Raumtemperatur Remote"), - F("Ruimtetemperatuur van afstandsbediening"), - F("Rumstemperatur från fjärr")) + "vacreducetemp", + "vacations off/reduce switch temperature", + "Urlaub Absenkmodus unter", + "Vakantiemodus onderste afschakeltemperatuur", + "Helg Avslag/Reducering under") +MAKE_PSTR_LIST(vacreducemode, "vacreducemode", "vacations reduce mode", "Urlaub Absenkmodus", "Vakantie afschakelmodus", "Helg reduceringsläge") +MAKE_PSTR_LIST(nofrostmode, "nofrostmode", "nofrost mode", "Frostschutz Modus", "Vorstbeveiligingsmodus", "Frostskyddsläge") +MAKE_PSTR_LIST(remotetemp, "remotetemp", "room temperature from remote", "Raumtemperatur Remote", "Ruimtetemperatuur van afstandsbediening", "Rumstemperatur från fjärr") -MAKE_PSTR_LIST(wwHolidays, F("wwholidays"), F("holiday dates"), F("Feiertage"), F("Feestdagen"), F("Helgdagar")) -MAKE_PSTR_LIST(wwVacations, F("wwvacations"), F("vacation dates"), F("Urlaubstage"), F("Vakantiedagen"), F("Semesterdatum Varmvatten")) -MAKE_PSTR_LIST(holidays, F("holidays"), F("holiday dates"), F("Feiertage"), F("Feestdagen"), F("Helgdatum")) -MAKE_PSTR_LIST(vacations, F("vacations"), F("vacation dates"), F("Urlaubstage"), F("Vakantiedagen"), F("Semesterdatum")) -MAKE_PSTR_LIST(wwprio, F("wwprio"), F("dhw priority"), F("WW-Vorrang"), F("Prioriteit warm water"), F("Prioritera Varmvatten")) -MAKE_PSTR_LIST(nofrostmode1, F("nofrostmode1"), F("nofrost mode"), F("Frostschutz"), F("Vorstbeveiligingsmodus"), F("Frostskyddsläge")) -MAKE_PSTR_LIST(reducehours, F("reducehours"), F("duration for nighttemp"), F("Dauer Nachttemp."), F("Duur nachtverlaging"), F("Timmar Nattsänkning")) -MAKE_PSTR_LIST(reduceminutes, - F("reduceminutes"), - F("remaining time for nightmode"), - F("Restzeit Nachttemp."), - F("Resterende tijd nachtverlaging"), - F("Återstående Tid Nattläge")) -MAKE_PSTR_LIST(switchonoptimization, - F("switchonoptimization"), - F("switch-on optimization"), - F("Einschaltoptimierung"), - F("Inschakeloptimalisering"), - F("Växlingsoptimering")) +MAKE_PSTR_LIST(wwHolidays, "wwholidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdagar") +MAKE_PSTR_LIST(wwVacations, "wwvacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum Varmvatten") +MAKE_PSTR_LIST(holidays, "holidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdatum") +MAKE_PSTR_LIST(vacations, "vacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum") +MAKE_PSTR_LIST(wwprio, "wwprio", "dhw priority", "WW-Vorrang", "Prioriteit warm water", "Prioritera Varmvatten") +MAKE_PSTR_LIST(nofrostmode1, "nofrostmode1", "nofrost mode", "Frostschutz", "Vorstbeveiligingsmodus", "Frostskyddsläge") +MAKE_PSTR_LIST(reducehours, "reducehours", "duration for nighttemp", "Dauer Nachttemp.", "Duur nachtverlaging", "Timmar Nattsänkning") +MAKE_PSTR_LIST(reduceminutes, "reduceminutes", "remaining time for nightmode", "Restzeit Nachttemp.", "Resterende tijd nachtverlaging", "Återstående Tid Nattläge") +MAKE_PSTR_LIST(switchonoptimization, "switchonoptimization", "switch-on optimization", "Einschaltoptimierung", "Inschakeloptimalisering", "Växlingsoptimering") // heatpump -MAKE_PSTR_LIST(airHumidity, F("airhumidity"), F("relative air humidity"), F("relative Luftfeuchte"), F("Relatieve luchtvochtigheid"), F("Relativ Luftfuktighet")) -MAKE_PSTR_LIST(dewTemperature, F("dewtemperature"), F("dew point temperature"), F("Taupunkttemperatur"), F("Dauwpunttemperatuur"), F("Daggpunkt")) +MAKE_PSTR_LIST(airHumidity, "airhumidity", "relative air humidity", "relative Luftfeuchte", "Relatieve luchtvochtigheid", "Relativ Luftfuktighet") +MAKE_PSTR_LIST(dewTemperature, "dewtemperature", "dew point temperature", "Taupunkttemperatur", "Dauwpunttemperatuur", "Daggpunkt") // mixer -MAKE_PSTR_LIST(flowSetTemp, - F("flowsettemp"), - F("setpoint flow temperature"), - F("Sollwert Vorlauftemperatur"), - F("Streefwaarde aanvoertemperatuur"), - F("Vald flödestemperatur")) -MAKE_PSTR_LIST(flowTempHc, - F("flowtemphc"), - F("flow temperature (TC1)"), - F("Vorlauftemperatur HK (TC1)"), - F("Aanvoertemperatuut circuit (TC1)"), - F("Flödestemperatur (TC1)")) -MAKE_PSTR_LIST(pumpStatus, F("pumpstatus"), F("pump status (PC1)"), F("Pumpenstatus HK (PC1)"), F("pompstatus circuit (PC1)"), F("Pumpstatus (PC1)")) -MAKE_PSTR_LIST(mixerStatus, - F("valvestatus"), - F("mixing valve actuator (VC1)"), - F("Mischerventil Position (VC1)"), - F("positie mixerklep (VC1)"), - F("Shuntventil Status (VC1)")) +MAKE_PSTR_LIST(flowSetTemp, "flowsettemp", "setpoint flow temperature", "Sollwert Vorlauftemperatur", "Streefwaarde aanvoertemperatuur", "Vald flödestemperatur") +MAKE_PSTR_LIST(flowTempHc, "flowtemphc", "flow temperature (TC1)", "Vorlauftemperatur HK (TC1)", "Aanvoertemperatuut circuit (TC1)", "Flödestemperatur (TC1)") +MAKE_PSTR_LIST(pumpStatus, "pumpstatus", "pump status (PC1)", "Pumpenstatus HK (PC1)", "pompstatus circuit (PC1)", "Pumpstatus (PC1)") +MAKE_PSTR_LIST(mixerStatus, "valvestatus", "mixing valve actuator (VC1)", "Mischerventil Position (VC1)", "positie mixerklep (VC1)", "Shuntventil Status (VC1)") MAKE_PSTR_LIST(flowTempVf, - F("flowtempvf"), - F("flow temperature in header (T0/Vf)"), - F("Vorlauftemperatur am Verteiler (T0/Vf)"), - F("aanvoertemperatuur verdeler (T0/Vf)"), - F("Flödestemperatur Fördelare (T0/Vf)")) -MAKE_PSTR_LIST(mixerSetTime, F("valvesettime"), F("time to set valve"), F("Zeit zum Einstellen des Ventils"), F("Inschakeltijd mengklep"), F("Inställningstid Ventil")) + "flowtempvf", + "flow temperature in header (T0/Vf)", + "Vorlauftemperatur am Verteiler (T0/Vf)", + "aanvoertemperatuur verdeler (T0/Vf)", + "Flödestemperatur Fördelare (T0/Vf)") +MAKE_PSTR_LIST(mixerSetTime, "valvesettime", "time to set valve", "Zeit zum Einstellen des Ventils", "Inschakeltijd mengklep", "Inställningstid Ventil") // mixer prefixed with wwc MAKE_PSTR_LIST(wwPumpStatus, - F("pumpstatus"), - F("pump status in assigned wwc (PC1)"), - F("Pumpenstatus des wwk (PC1)"), - F("Pompstatus in WW circuit (PC1)"), - F("Pumpstatus i VV-krets (PC1)")) + "pumpstatus", + "pump status in assigned wwc (PC1)", + "Pumpenstatus des wwk (PC1)", + "Pompstatus in WW circuit (PC1)", + "Pumpstatus i VV-krets (PC1)") MAKE_PSTR_LIST(wwTempStatus, - F("wwtempstatus"), - F("temperature switch in assigned wwc (MC1)"), - F("Temperaturschalter des wwk (MC1)"), - F("Temperatuurschakeling in WW circuit (MC1)"), - F("Temperaturventil i VV-krets (MC1)")) -MAKE_PSTR_LIST(wwTemp, F("wwtemp"), F("current temperature"), F("aktuelle Temperatur"), F("huidige temperatuur"), F("Aktuell Temperatur")) + "wwtempstatus", + "temperature switch in assigned wwc (MC1)", + "Temperaturschalter des wwk (MC1)", + "Temperatuurschakeling in WW circuit (MC1)", + "Temperaturventil i VV-krets (MC1)") +MAKE_PSTR_LIST(wwTemp, "wwtemp", "current temperature", "aktuelle Temperatur", "huidige temperatuur", "Aktuell Temperatur") // mixer pool -MAKE_PSTR_LIST(poolSetTemp, F("poolsettemp"), F("pool set temperature"), F("Pool Solltemperatur"), F("Streeftemperatuur zwembad"), F("Pool Temperatur Börvärde")) -MAKE_PSTR_LIST(poolTemp, F("pooltemp"), F("pool temperature"), F("Pool Temperatur"), F("Zwembadtemperatuur"), F("Pooltemperatur")) +MAKE_PSTR_LIST(poolSetTemp, "poolsettemp", "pool set temperature", "Pool Solltemperatur", "Streeftemperatuur zwembad", "Pool Temperatur Börvärde") +MAKE_PSTR_LIST(poolTemp, "pooltemp", "pool temperature", "Pool Temperatur", "Zwembadtemperatuur", "Pooltemperatur") MAKE_PSTR_LIST(poolShuntStatus, - F("poolshuntstatus"), - F("pool shunt status opening/closing"), - F("Pool Ventil öffnen/schließen"), - F("Zwembadklep status openen/sluiten"), - F("Pool Shunt-status öppnen/stängd")) -MAKE_PSTR_LIST(poolShunt, - F("poolshunt"), - F("pool shunt open/close (0% = pool / 100% = heat)"), - F("Pool Ventil Öffnung"), - F("Mengklep zwembad stand"), - F("Pool Shunt Öppen/Stängd")) -MAKE_PSTR_LIST(hydrTemp, F("hydrTemp"), F("hydraulic header temperature"), F("Verteilertemperatur"), F("Temperatuur open verdeler"), F("Fördelartemperatur")) + "poolshuntstatus", + "pool shunt status opening/closing", + "Pool Ventil öffnen/schließen", + "Zwembadklep status openen/sluiten", + "Pool Shunt-status öppnen/stängd") +MAKE_PSTR_LIST(poolShunt, "poolshunt", "pool shunt open/close (0% = pool / 100% = heat)", "Pool Ventil Öffnung", "Mengklep zwembad stand", "Pool Shunt Öppen/Stängd") +MAKE_PSTR_LIST(hydrTemp, "hydrTemp", "hydraulic header temperature", "Verteilertemperatur", "Temperatuur open verdeler", "Fördelartemperatur") // solar MAKE_PSTR_LIST(cylMiddleTemp, - F("cylmiddletemp"), - F("cylinder middle temperature (TS3)"), - F("Speichertemperatur Mitte (TS3)"), - F("Zonneboilertemperatuur midden (TS3)"), - F("Cylindertemperatur Mitten (TS3)")) + "cylmiddletemp", + "cylinder middle temperature (TS3)", + "Speichertemperatur Mitte (TS3)", + "Zonneboilertemperatuur midden (TS3)", + "Cylindertemperatur Mitten (TS3)") MAKE_PSTR_LIST(retHeatAssist, - F("retheatassist"), - F("return temperature heat assistance (TS4)"), - F("Rücklaufanhebungs-Temp. (TS4)"), - F("Retourtemperatuur verwarmingsassistentie (TS4)"), - F("Returtemperatur värmestöd (TS4)")) + "retheatassist", + "return temperature heat assistance (TS4)", + "Rücklaufanhebungs-Temp. (TS4)", + "Retourtemperatuur verwarmingsassistentie (TS4)", + "Returtemperatur värmestöd (TS4)") MAKE_PSTR_LIST(m1Valve, - F("heatassistvalve"), - F("heat assistance valve (M1)"), - F("Ventil Heizungsunterstützung (M1)"), - F("Klep verwarmingsassistentie (M1)"), - F("Uppvärmningsstöd Ventil (M1)")) + "heatassistvalve", + "heat assistance valve (M1)", + "Ventil Heizungsunterstützung (M1)", + "Klep verwarmingsassistentie (M1)", + "Uppvärmningsstöd Ventil (M1)") MAKE_PSTR_LIST(m1Power, - F("heatassistpower"), - F("heat assistance valve power (M1)"), - F("Ventilleistung Heizungsunterstützung (M1)"), - F("Vermogen klep verwarmingsassistentie (M1)"), - F("Uppvärmningsstöd Ventil Effekt (M1)")) -MAKE_PSTR_LIST(pumpMinMod, F("pumpminmod"), F("minimum pump modulation"), F("minimale Pumpenmodulation"), F("Minimale pompmodulatie"), F("Min Pumpmodulering")) -MAKE_PSTR_LIST(maxFlow, F("maxflow"), F("maximum solar flow"), F("maximaler Durchfluss"), F("Maximale doorstroom solar"), F("Max Flöde Solpanel")) -MAKE_PSTR_LIST(solarPower, F("solarpower"), F("actual solar power"), F("aktuelle Solarleistung"), F("Huidig solar vermogen"), F("Aktuellt Sol-effekt")) -MAKE_PSTR_LIST(solarPumpTurnonDiff, - F("turnondiff"), - F("pump turn on difference"), - F("Einschalthysterese Pumpe"), - F("Inschakelhysterese pomp"), - F("Aktiveringshysteres Pump")) -MAKE_PSTR_LIST(solarPumpTurnoffDiff, - F("turnoffdiff"), - F("pump turn off difference"), - F("Ausschalthysterese Pumpe"), - F("Uitschakelhysterese pomp"), - F("Avslagshysteres Pump")) -MAKE_PSTR_LIST(pump2MinMod, - F("pump2minmod"), - F("minimum pump 2 modulation"), - F("minimale Modulation Pumpe 2"), - F("Minimale modulatie pomp 2"), - F("Min Modulering Pump 2")) -MAKE_PSTR_LIST(solarPump2TurnonDiff, - F("turnondiff2"), - F("pump 2 turn on difference"), - F("Einschalthysterese Pumpe 2"), - F("Inschakelhysterese pomp 2"), - F("Aktiveringshysteres Pump 2")) -MAKE_PSTR_LIST(solarPump2TurnoffDiff, - F("turnoffdiff2"), - F("pump 2 turn off difference"), - F("Ausschalthysterese Pumpe 2"), - F("Uitschakelhysterese pomp 2"), - F("Avslagshysteres Pump 2")) + "heatassistpower", + "heat assistance valve power (M1)", + "Ventilleistung Heizungsunterstützung (M1)", + "Vermogen klep verwarmingsassistentie (M1)", + "Uppvärmningsstöd Ventil Effekt (M1)") +MAKE_PSTR_LIST(pumpMinMod, "pumpminmod", "minimum pump modulation", "minimale Pumpenmodulation", "Minimale pompmodulatie", "Min Pumpmodulering") +MAKE_PSTR_LIST(maxFlow, "maxflow", "maximum solar flow", "maximaler Durchfluss", "Maximale doorstroom solar", "Max Flöde Solpanel") +MAKE_PSTR_LIST(solarPower, "solarpower", "actual solar power", "aktuelle Solarleistung", "Huidig solar vermogen", "Aktuellt Sol-effekt") +MAKE_PSTR_LIST(solarPumpTurnonDiff, "turnondiff", "pump turn on difference", "Einschalthysterese Pumpe", "Inschakelhysterese pomp", "Aktiveringshysteres Pump") +MAKE_PSTR_LIST(solarPumpTurnoffDiff, "turnoffdiff", "pump turn off difference", "Ausschalthysterese Pumpe", "Uitschakelhysterese pomp", "Avslagshysteres Pump") +MAKE_PSTR_LIST(pump2MinMod, "pump2minmod", "minimum pump 2 modulation", "minimale Modulation Pumpe 2", "Minimale modulatie pomp 2", "Min Modulering Pump 2") +MAKE_PSTR_LIST(solarPump2TurnonDiff, "turnondiff2", "pump 2 turn on difference", "Einschalthysterese Pumpe 2", "Inschakelhysterese pomp 2", "Aktiveringshysteres Pump 2") +MAKE_PSTR_LIST(solarPump2TurnoffDiff, "turnoffdiff2", "pump 2 turn off difference", "Ausschalthysterese Pumpe 2", "Uitschakelhysterese pomp 2", "Avslagshysteres Pump 2") -MAKE_PSTR_LIST(collectorTemp, - F("collectortemp"), - F("collector temperature (TS1)"), - F("Kollektortemperatur (TS1)"), - F("Collectortemperatuur (TS1)"), - F("Kollektor Temperatur (TS1)")) +MAKE_PSTR_LIST(collectorTemp, "collectortemp", "collector temperature (TS1)", "Kollektortemperatur (TS1)", "Collectortemperatuur (TS1)", "Kollektor Temperatur (TS1)") MAKE_PSTR_LIST(collector2Temp, - F("collector2temp"), - F("collector 2 temperature (TS7)"), - F("Kollector 2 Temperatur (TS7)"), - F("Collector 2 temperatuur (TS7)"), - F("Kollektor 2 Temperatur (TS7)")) + "collector2temp", + "collector 2 temperature (TS7)", + "Kollector 2 Temperatur (TS7)", + "Collector 2 temperatuur (TS7)", + "Kollektor 2 Temperatur (TS7)") MAKE_PSTR_LIST(cylBottomTemp, - F("cylbottomtemp"), - F("cylinder bottom temperature (TS2)"), - F("Speicher Bodentemperatur (TS2)"), - F("Bodemtemperatuur zonneboiler (TS2)"), - F("Cylindertemperatur Botten (TS2)")) + "cylbottomtemp", + "cylinder bottom temperature (TS2)", + "Speicher Bodentemperatur (TS2)", + "Bodemtemperatuur zonneboiler (TS2)", + "Cylindertemperatur Botten (TS2)") MAKE_PSTR_LIST(cyl2BottomTemp, - F("cyl2bottomtemp"), - F("second cylinder bottom temperature (TS5)"), - F("2. Speicher Bodentemperatur (TS5)"), - F("Bodemtemperatuur 2e boiler"), - F("Sekundär Cylindertemperatur Botten (TS5)")) + "cyl2bottomtemp", + "second cylinder bottom temperature (TS5)", + "2. Speicher Bodentemperatur (TS5)", + "Bodemtemperatuur 2e boiler", + "Sekundär Cylindertemperatur Botten (TS5)") MAKE_PSTR_LIST(heatExchangerTemp, - F("heatexchangertemp"), - F("heat exchanger temperature (TS6)"), - F("wärmetauscher Temperatur (TS6)"), - F("Temperatuur warmtewisselaar (TS6)"), - F("Värmeväxlare Temperatur (TS6)")) + "heatexchangertemp", + "heat exchanger temperature (TS6)", + "wärmetauscher Temperatur (TS6)", + "Temperatuur warmtewisselaar (TS6)", + "Värmeväxlare Temperatur (TS6)") MAKE_PSTR_LIST(collectorMaxTemp, - F("collectormaxtemp"), - F("maximum collector temperature"), - F("maximale Kollektortemperatur"), - F("Maximale collectortemperatuur"), - F("Max Kollektortemperatur")) + "collectormaxtemp", + "maximum collector temperature", + "maximale Kollektortemperatur", + "Maximale collectortemperatuur", + "Max Kollektortemperatur") MAKE_PSTR_LIST(collectorMinTemp, - F("collectormintemp"), - F("minimum collector temperature"), - F("minimale Kollektortemperatur"), - F("Minimale collectortemperatuur"), - F("Min Kollektortemperatur")) -MAKE_PSTR_LIST(cylMaxTemp, - F("cylmaxtemp"), - F("maximum cylinder temperature"), - F("maximale Speichertemperatur"), - F("maximale temperatuur zonneboiler"), - F("Max Cylindertemperatur")) -MAKE_PSTR_LIST(solarPumpMod, F("solarpumpmod"), F("pump modulation (PS1)"), F("Pumpenmodulation (PS1)"), F("Pompmodulatie (PS1)"), F("Pumpmodulering (PS1)")) + "collectormintemp", + "minimum collector temperature", + "minimale Kollektortemperatur", + "Minimale collectortemperatuur", + "Min Kollektortemperatur") +MAKE_PSTR_LIST(cylMaxTemp, "cylmaxtemp", "maximum cylinder temperature", "maximale Speichertemperatur", "maximale temperatuur zonneboiler", "Max Cylindertemperatur") +MAKE_PSTR_LIST(solarPumpMod, "solarpumpmod", "pump modulation (PS1)", "Pumpenmodulation (PS1)", "Pompmodulatie (PS1)", "Pumpmodulering (PS1)") MAKE_PSTR_LIST(cylPumpMod, - F("cylpumpmod"), - F("cylinder pump modulation (PS5)"), - F("Speicherpumpenmodulation (PS5)"), - F("Modulatie zonneboilerpomp (PS5)"), - F("Cylinderpumpmodulering (PS5)")) -MAKE_PSTR_LIST(solarPump, F("solarpump"), F("pump (PS1)"), F("Pumpe (PS1)"), F("Pomp (PS1)"), F("Pump (PS1)")) -MAKE_PSTR_LIST(solarPump2, F("solarpump2"), F("pump 2 (PS4)"), F("Pumpe 2 (PS4)"), F("Pomp 2 (PS4)"), F("Pump 2 (PS4)")) -MAKE_PSTR_LIST(solarPump2Mod, - F("solarpump2mod"), - F("pump 2 modulation (PS4)"), - F("Pumpe 2 Modulation (PS4)"), - F("Modulatie pomp 2 (PS4)"), - F("Pump 2 Modulering (PS4)")) -MAKE_PSTR_LIST(valveStatus, F("valvestatus"), F("valve status"), F("Ventilstatus"), F("Klepstatus"), F("Ventilstatus")) -MAKE_PSTR_LIST(cylHeated, F("cylheated"), F("cyl heated"), F("Speichertemperatur erreicht"), F("Boilertemperatuur behaald"), F("Värmepanna Uppvärmd")) -MAKE_PSTR_LIST(collectorShutdown, F("collectorshutdown"), F("collector shutdown"), F("Kollektorabschaltung"), F("Collector afschakeling"), F("Kollektor Avstängning")) -MAKE_PSTR_LIST(pumpWorkTime, F("pumpworktime"), F("pump working time"), F("Pumpenlaufzeit"), F("Pomplooptijd"), F("Pump Drifttid")) -MAKE_PSTR_LIST(pump2WorkTime, F("pump2worktime"), F("pump 2 working time"), F("Pumpe 2 Laufzeit"), F("Looptijd pomp 2"), F("Pump 2 Drifttid")) + "cylpumpmod", + "cylinder pump modulation (PS5)", + "Speicherpumpenmodulation (PS5)", + "Modulatie zonneboilerpomp (PS5)", + "Cylinderpumpmodulering (PS5)") +MAKE_PSTR_LIST(solarPump, "solarpump", "pump (PS1)", "Pumpe (PS1)", "Pomp (PS1)", "Pump (PS1)") +MAKE_PSTR_LIST(solarPump2, "solarpump2", "pump 2 (PS4)", "Pumpe 2 (PS4)", "Pomp 2 (PS4)", "Pump 2 (PS4)") +MAKE_PSTR_LIST(solarPump2Mod, "solarpump2mod", "pump 2 modulation (PS4)", "Pumpe 2 Modulation (PS4)", "Modulatie pomp 2 (PS4)", "Pump 2 Modulering (PS4)") +MAKE_PSTR_LIST(valveStatus, "valvestatus", "valve status", "Ventilstatus", "Klepstatus", "Ventilstatus") +MAKE_PSTR_LIST(cylHeated, "cylheated", "cyl heated", "Speichertemperatur erreicht", "Boilertemperatuur behaald", "Värmepanna Uppvärmd") +MAKE_PSTR_LIST(collectorShutdown, "collectorshutdown", "collector shutdown", "Kollektorabschaltung", "Collector afschakeling", "Kollektor Avstängning") +MAKE_PSTR_LIST(pumpWorkTime, "pumpworktime", "pump working time", "Pumpenlaufzeit", "Pomplooptijd", "Pump Drifttid") +MAKE_PSTR_LIST(pump2WorkTime, "pump2worktime", "pump 2 working time", "Pumpe 2 Laufzeit", "Looptijd pomp 2", "Pump 2 Drifttid") MAKE_PSTR_LIST(m1WorkTime, - F("m1worktime"), - F("differential control working time"), - F("Differenzregelung Arbeitszeit"), - F("Verschilregeling arbeidstijd"), - F("Differentialreglering Drifttid")) -MAKE_PSTR_LIST(energyLastHour, F("energylasthour"), F("energy last hour"), F("Energie letzte Std"), F("Energie laatste uur"), F("Energi Senaste Timmen")) -MAKE_PSTR_LIST(energyTotal, F("energytotal"), F("total energy"), F("Gesamtenergie"), F("Totale energie"), F("Total Energi")) -MAKE_PSTR_LIST(energyToday, F("energytoday"), F("total energy today"), F("Energie heute"), F("Energie vandaag"), F("Total Energi Idag")) + "m1worktime", + "differential control working time", + "Differenzregelung Arbeitszeit", + "Verschilregeling arbeidstijd", + "Differentialreglering Drifttid") +MAKE_PSTR_LIST(energyLastHour, "energylasthour", "energy last hour", "Energie letzte Std", "Energie laatste uur", "Energi Senaste Timmen") +MAKE_PSTR_LIST(energyTotal, "energytotal", "total energy", "Gesamtenergie", "Totale energie", "Total Energi") +MAKE_PSTR_LIST(energyToday, "energytoday", "total energy today", "Energie heute", "Energie vandaag", "Total Energi Idag") // solar ww -MAKE_PSTR_LIST(wwTemp1, F("wwtemp1"), F("temperature 1"), F("Temperatur 1"), F("Temperatuur 1"), F("Temperatur 1")) -MAKE_PSTR_LIST(wwTemp3, F("wwtemp3"), F("temperature 3"), F("Temperatur 3"), F("Temperatuur 2"), F("Temperatur 2")) -MAKE_PSTR_LIST(wwTemp4, F("wwtemp4"), F("temperature 4"), F("Temperatur 4"), F("Temperatuur 3"), F("Temperatur 3")) -MAKE_PSTR_LIST(wwTemp5, F("wwtemp5"), F("temperature 5"), F("Temperatur 5"), F("Temperatuur 5"), F("Temperatur 4")) -MAKE_PSTR_LIST(wwTemp7, F("wwtemp7"), F("temperature 7"), F("Temperatur 7"), F("Temperatuur 7"), F("Temperatur 5")) -MAKE_PSTR_LIST(wwPump, F("wwpump"), F("pump"), F("Pumpe"), F("Pomp"), F("Pump")) +MAKE_PSTR_LIST(wwTemp1, "wwtemp1", "temperature 1", "Temperatur 1", "Temperatuur 1", "Temperatur 1") +MAKE_PSTR_LIST(wwTemp3, "wwtemp3", "temperature 3", "Temperatur 3", "Temperatuur 2", "Temperatur 2") +MAKE_PSTR_LIST(wwTemp4, "wwtemp4", "temperature 4", "Temperatur 4", "Temperatuur 3", "Temperatur 3") +MAKE_PSTR_LIST(wwTemp5, "wwtemp5", "temperature 5", "Temperatur 5", "Temperatuur 5", "Temperatur 4") +MAKE_PSTR_LIST(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 5") +MAKE_PSTR_LIST(wwPump, "wwpump", "pump", "Pumpe", "Pomp", "Pump") // solar ww and mixer wwc -MAKE_PSTR_LIST(wwMinTemp, F("wwmintemp"), F("minimum temperature"), F("minimale Temperatur"), F("Minimale temperatuur"), F("Min Temperatur")) -MAKE_PSTR_LIST(wwRedTemp, F("wwredtemp"), F("reduced temperature"), F("reduzierte Temperatur"), F("Gereduceerde temperatuur"), F("Reducerad Temperatur")) -MAKE_PSTR_LIST(wwDailyTemp, F("wwdailytemp"), F("daily temperature"), F("tägl. Temperatur"), F("Dagelijkse temperatuur"), F("Daglig temperatur")) -MAKE_PSTR_LIST(wwKeepWarm, F("wwkeepwarm"), F("keep warm"), F("Warmhalten"), F("Warm houde"), F("Varmhållning")) -MAKE_PSTR_LIST(wwStatus2, F("wwstatus2"), F("status 2"), F("Status 2"), F("Status 2"), F("Status 2")) -MAKE_PSTR_LIST(wwPumpMod, F("wwpumpmod"), F("pump modulation"), F("Pumpen Modulation"), F("Pompmodulatie"), F("Pumpmodulering")) -MAKE_PSTR_LIST(wwFlow, F("wwflow"), F("flow rate"), F("Volumenstrom"), F("Doorstroomsnelheid"), F("Flöde")) +MAKE_PSTR_LIST(wwMinTemp, "wwmintemp", "minimum temperature", "minimale Temperatur", "Minimale temperatuur", "Min Temperatur") +MAKE_PSTR_LIST(wwRedTemp, "wwredtemp", "reduced temperature", "reduzierte Temperatur", "Gereduceerde temperatuur", "Reducerad Temperatur") +MAKE_PSTR_LIST(wwDailyTemp, "wwdailytemp", "daily temperature", "tägl. Temperatur", "Dagelijkse temperatuur", "Daglig temperatur") +MAKE_PSTR_LIST(wwKeepWarm, "wwkeepwarm", "keep warm", "Warmhalten", "Warm houde", "Varmhållning") +MAKE_PSTR_LIST(wwStatus2, "wwstatus2", "status 2", "Status 2", "Status 2", "Status 2") +MAKE_PSTR_LIST(wwPumpMod, "wwpumpmod", "pump modulation", "Pumpen Modulation", "Pompmodulatie", "Pumpmodulering") +MAKE_PSTR_LIST(wwFlow, "wwflow", "flow rate", "Volumenstrom", "Doorstroomsnelheid", "Flöde") // extra mixer ww -MAKE_PSTR_LIST(wwRequiredTemp, F("wwrequiredtemp"), F("required temperature"), F("benötigte Temperatur"), F("Benodigde temperatuur"), F("Nödvändig Temperatur")) +MAKE_PSTR_LIST(wwRequiredTemp, "wwrequiredtemp", "required temperature", "benötigte Temperatur", "Benodigde temperatuur", "Nödvändig Temperatur") MAKE_PSTR_LIST(wwDiffTemp, - F("wwdifftemp"), - F("start differential temperature"), - F("Start Differential Temperatur"), - F("Start differentiele temperatuur"), - F("Start Differentialtemperatur")) + "wwdifftemp", + "start differential temperature", + "Start Differential Temperatur", + "Start differentiele temperatuur", + "Start Differentialtemperatur") // SM100 -MAKE_PSTR_LIST(heatTransferSystem, - F("heattransfersystem"), - F("heattransfer system"), - F("Wärmeübertragungs-System"), - F("Warmteoverdrachtssysteem"), - F("Värmeöverföringssystem")) -MAKE_PSTR_LIST(externalCyl, F("externalcyl"), F("external cylinder"), F("Externer Speicher"), F("Externe boiler"), F("Extern Cylinder")) -MAKE_PSTR_LIST(thermalDisinfect, F("thermaldisinfect"), F("thermal disinfection"), F("Thermische Desinfektion"), F("Thermische desinfectie"), F("Termisk Desinfektion")) -MAKE_PSTR_LIST(heatMetering, F("heatmetering"), F("heatmetering"), F("Wärmemessung"), F("warmtemeting"), F("Värmemätning")) -MAKE_PSTR_LIST(solarIsEnabled, F("solarenabled"), F("solarmodule enabled"), F("Solarmodul aktiviert"), F("Solarmodule geactiveerd"), F("Solmodul Aktiverad")) +MAKE_PSTR_LIST(heatTransferSystem, "heattransfersystem", "heattransfer system", "Wärmeübertragungs-System", "Warmteoverdrachtssysteem", "Värmeöverföringssystem") +MAKE_PSTR_LIST(externalCyl, "externalcyl", "external cylinder", "Externer Speicher", "Externe boiler", "Extern Cylinder") +MAKE_PSTR_LIST(thermalDisinfect, "thermaldisinfect", "thermal disinfection", "Thermische Desinfektion", "Thermische desinfectie", "Termisk Desinfektion") +MAKE_PSTR_LIST(heatMetering, "heatmetering", "heatmetering", "Wärmemessung", "warmtemeting", "Värmemätning") +MAKE_PSTR_LIST(solarIsEnabled, "solarenabled", "solarmodule enabled", "Solarmodul aktiviert", "Solarmodule geactiveerd", "Solmodul Aktiverad") // telegram 0x035A -MAKE_PSTR_LIST(solarPumpMode, F("solarpumpmode"), F("pump mode"), F("Solar Pumpen Einst."), F("Modus zonneboilerpomp"), F("Sol Pumpläge")) -MAKE_PSTR_LIST(solarPumpKick, F("pumpkick"), F("pump kick"), F("Röhrenkollektorfunktion"), F("Modus buizencollector"), F("Sol Kollektorfunktion")) -MAKE_PSTR_LIST(plainWaterMode, F("plainwatermode"), F("plain water mode"), F("Südeuropafunktion"), F("Modus Zuid-Europa"), F("Sydeuropa-funktion")) -MAKE_PSTR_LIST(doubleMatchFlow, F("doublematchflow"), F("doublematchflow"), F("Double Match Flow"), F("Double Match Flow"), F("Dubbelmatchning Flöde")) -MAKE_PSTR_LIST(solarPump2Mode, F("pump2mode"), F("pump 2 mode"), F("Pumpe 2 Modus"), F("Modus pomp 2"), F("Pump 2 Läge")) -MAKE_PSTR_LIST(solarPump2Kick, F("pump2kick"), F("pump kick 2"), F("Pumpe 2 Startboost"), F("Startboost pomp 2"), F("Pump 2 Kollektorfunktion")) +MAKE_PSTR_LIST(solarPumpMode, "solarpumpmode", "pump mode", "Solar Pumpen Einst.", "Modus zonneboilerpomp", "Sol Pumpläge") +MAKE_PSTR_LIST(solarPumpKick, "pumpkick", "pump kick", "Röhrenkollektorfunktion", "Modus buizencollector", "Sol Kollektorfunktion") +MAKE_PSTR_LIST(plainWaterMode, "plainwatermode", "plain water mode", "Südeuropafunktion", "Modus Zuid-Europa", "Sydeuropa-funktion") +MAKE_PSTR_LIST(doubleMatchFlow, "doublematchflow", "doublematchflow", "Double Match Flow", "Double Match Flow", "Dubbelmatchning Flöde") +MAKE_PSTR_LIST(solarPump2Mode, "pump2mode", "pump 2 mode", "Pumpe 2 Modus", "Modus pomp 2", "Pump 2 Läge") +MAKE_PSTR_LIST(solarPump2Kick, "pump2kick", "pump kick 2", "Pumpe 2 Startboost", "Startboost pomp 2", "Pump 2 Kollektorfunktion") // telegram 0x035F -MAKE_PSTR_LIST(cylPriority, F("cylpriority"), F("cylinder priority"), F("Speicher Priorität"), F("Prioriteit boiler"), F("Cylinderprioritering")) +MAKE_PSTR_LIST(cylPriority, "cylpriority", "cylinder priority", "Speicher Priorität", "Prioriteit boiler", "Cylinderprioritering") // telegram 0x380 -MAKE_PSTR_LIST(climateZone, F("climatezone"), F("climate zone"), F("Klimazone"), F("klimaatzone"), F("Klimatzon")) -MAKE_PSTR_LIST(collector1Area, F("collector1area"), F("collector 1 area"), F("Kollektor 1 Fläche"), F("oppervlakte collector 1"), F("Kollektor 1 Area")) -MAKE_PSTR_LIST(collector1Type, F("collector1type"), F("collector 1 type"), F("Kollektor 1 Typ"), F("Type collector 1"), F("Kollektor 1 Typ")) -MAKE_PSTR_LIST(collector2Area, F("collector2area"), F("collector 2 area"), F("Kollektor 2 Fläche"), F("Oppervlakte collector 2"), F("Kollektor 2 Area")) -MAKE_PSTR_LIST(collector2Type, F("collector2type"), F("collector 2 type"), F("Kollektor 2 Typ"), F("Type collector 2"), F("Kollektor 2 Typ")) +MAKE_PSTR_LIST(climateZone, "climatezone", "climate zone", "Klimazone", "klimaatzone", "Klimatzon") +MAKE_PSTR_LIST(collector1Area, "collector1area", "collector 1 area", "Kollektor 1 Fläche", "oppervlakte collector 1", "Kollektor 1 Area") +MAKE_PSTR_LIST(collector1Type, "collector1type", "collector 1 type", "Kollektor 1 Typ", "Type collector 1", "Kollektor 1 Typ") +MAKE_PSTR_LIST(collector2Area, "collector2area", "collector 2 area", "Kollektor 2 Fläche", "Oppervlakte collector 2", "Kollektor 2 Area") +MAKE_PSTR_LIST(collector2Type, "collector2type", "collector 2 type", "Kollektor 2 Typ", "Type collector 2", "Kollektor 2 Typ") // telegram 0x0363 heatCounter MAKE_PSTR_LIST(heatCntFlowTemp, - F("heatcntflowtemp"), - F("heat counter flow temperature"), - F("Wärmezähler Vorlauf-Temperatur"), - F("Aanvoertemperatuur warmteenergiemeter"), - F("Värmeräknare Flödestemperatur")) + "heatcntflowtemp", + "heat counter flow temperature", + "Wärmezähler Vorlauf-Temperatur", + "Aanvoertemperatuur warmteenergiemeter", + "Värmeräknare Flödestemperatur") MAKE_PSTR_LIST(heatCntRetTemp, - F("heatcntrettemp"), - F("heat counter return temperature"), - F("Wärmezähler Rücklauf-Temperatur"), - F("Retourtemperatuur warmteenergiemeter"), - F("Värmeräknare Returtemperatur")) -MAKE_PSTR_LIST(heatCnt, F("heatcnt"), F("heat counter impulses"), F("Wärmezähler Impulse"), F("Warmteenergiemeter pulsen"), F("Värmeräknare Impuls")) + "heatcntrettemp", + "heat counter return temperature", + "Wärmezähler Rücklauf-Temperatur", + "Retourtemperatuur warmteenergiemeter", + "Värmeräknare Returtemperatur") +MAKE_PSTR_LIST(heatCnt, "heatcnt", "heat counter impulses", "Wärmezähler Impulse", "Warmteenergiemeter pulsen", "Värmeräknare Impuls") MAKE_PSTR_LIST(swapFlowTemp, - F("swapflowtemp"), - F("swap flow temperature (TS14)"), - F("Austausch Vorlauf-Temperatur (TS14)"), - F("Aanvoertemperatuur verwisselaar (TS14)"), - F("Växlingstemperatur Flöde (TS14)")) + "swapflowtemp", + "swap flow temperature (TS14)", + "Austausch Vorlauf-Temperatur (TS14)", + "Aanvoertemperatuur verwisselaar (TS14)", + "Växlingstemperatur Flöde (TS14)") MAKE_PSTR_LIST(swapRetTemp, - F("swaprettemp"), - F("swap return temperature (TS15)"), - F("Austausch Rücklauf-Temperatur (TS15)"), - F("Retourtemperatuur verwisselaar (TS15)"), - F("Växlingstemperatur Returflöde (TS15)")) + "swaprettemp", + "swap return temperature (TS15)", + "Austausch Rücklauf-Temperatur (TS15)", + "Retourtemperatuur verwisselaar (TS15)", + "Växlingstemperatur Returflöde (TS15)") // switch -MAKE_PSTR_LIST(activated, F("activated"), F("activated"), F("Aktiviert"), F("Geactiveerd"), F("Aktiverad")) -MAKE_PSTR_LIST(status, F("status"), F("status"), F("Status"), F("Status"), F("Status")) +MAKE_PSTR_LIST(activated, "activated", "activated", "Aktiviert", "Geactiveerd", "Aktiverad") +MAKE_PSTR_LIST(status, "status", "status", "Status", "Status", "Status") // RF sensor, id 0x40, telegram 0x435 -MAKE_PSTR_LIST(RFTemp, F("rftemp"), F("RF room temperature sensor"), F("RF Raumtemperatur Sensor"), F("RF ruimtetemperatuur sensor"), F("RF Rumsgivare Temp")) +MAKE_PSTR_LIST(RFTemp, "rftemp", "RF room temperature sensor", "RF Raumtemperatur Sensor", "RF ruimtetemperatuur sensor", "RF Rumsgivare Temp") /* // unknown fields to track (SM10), only for testing // **** NO TRANSLATION NEEDED **** -MAKE_PSTR_LIST(data11, F("data11"), F("unknown datafield 11")) -MAKE_PSTR_LIST(data12, F("data12"), F("unknown datafield 12")) -MAKE_PSTR_LIST(data8, F("data8"), F("unknown datafield 8")) -MAKE_PSTR_LIST(data0, F("data0"), F("unknown datafield 0")) -MAKE_PSTR_LIST(data1, F("data1"), F("unknown datafield 1")) -MAKE_PSTR_LIST(setting3, F("setting3"), F("unknown setting 3")) -MAKE_PSTR_LIST(setting4, F("setting4"), F("unknown setting 4")) +MAKE_PSTR_LIST(data11, "data11", "unknown datafield 11") +MAKE_PSTR_LIST(data12, "data12", "unknown datafield 12") +MAKE_PSTR_LIST(data8, "data8", "unknown datafield 8") +MAKE_PSTR_LIST(data0, "data0", "unknown datafield 0") +MAKE_PSTR_LIST(data1, "data1", "unknown datafield 1") +MAKE_PSTR_LIST(setting3, "setting3", "unknown setting 3") +MAKE_PSTR_LIST(setting4, "setting4", "unknown setting 4") */ diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 0ed29ea09..1b17f41ae 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -186,26 +186,26 @@ void Mqtt::loop() { // print MQTT log and other stuff to console void Mqtt::show_mqtt(uuid::console::Shell & shell) { - shell.printfln(F("MQTT is %s"), connected() ? read_flash_string(F_(connected)).c_str() : read_flash_string(F_(disconnected)).c_str()); + shell.printfln(("MQTT is %s"), connected() ? F_(connected) : F_(disconnected)); - shell.printfln(F("MQTT publish errors: %lu"), mqtt_publish_fails_); + shell.printfln(("MQTT publish errors: %lu"), mqtt_publish_fails_); shell.println(); // show subscriptions - shell.printfln(F("MQTT topic subscriptions:")); + shell.printfln(("MQTT topic subscriptions:")); for (const auto & mqtt_subfunction : mqtt_subfunctions_) { - shell.printfln(F(" %s/%s"), mqtt_base_.c_str(), mqtt_subfunction.topic_.c_str()); + shell.printfln((" %s/%s"), mqtt_base_.c_str(), mqtt_subfunction.topic_.c_str()); } shell.println(); // show queues if (mqtt_messages_.empty()) { - shell.printfln(F("MQTT queue is empty")); + shell.printfln(("MQTT queue is empty")); shell.println(); return; } - shell.printfln(F("MQTT queue (%d/%d messages):"), mqtt_messages_.size(), MAX_MQTT_MESSAGES); + shell.printfln(("MQTT queue (%d/%d messages):"), mqtt_messages_.size(), MAX_MQTT_MESSAGES); for (const auto & message : mqtt_messages_) { auto content = message.content_; @@ -222,12 +222,12 @@ void Mqtt::show_mqtt(uuid::console::Shell & shell) { // Publish messages if (message.retry_count_ == 0) { if (message.packet_id_ == 0) { - shell.printfln(F(" [%02d] (Pub) topic=%s payload=%s"), message.id_, topic, content->payload.c_str()); + shell.printfln((" [%02d] (Pub) topic=%s payload=%s"), message.id_, topic, content->payload.c_str()); } else { - shell.printfln(F(" [%02d] (Pub) topic=%s payload=%s (pid %d)"), message.id_, topic, content->payload.c_str(), message.packet_id_); + shell.printfln((" [%02d] (Pub) topic=%s payload=%s (pid %d)"), message.id_, topic, content->payload.c_str(), message.packet_id_); } } else { - shell.printfln(F(" [%02d] (Pub) topic=%s payload=%s (pid %d, retry #%d)"), + shell.printfln((" [%02d] (Pub) topic=%s payload=%s (pid %d, retry #%d)"), message.id_, topic, content->payload.c_str(), @@ -236,7 +236,7 @@ void Mqtt::show_mqtt(uuid::console::Shell & shell) { } } else { // Subscribe messages - shell.printfln(F(" [%02d] (Sub) topic=%s"), message.id_, topic); + shell.printfln((" [%02d] (Sub) topic=%s"), message.id_, topic); } } shell.println(); @@ -264,16 +264,16 @@ void Mqtt::on_message(const char * topic, const char * payload, size_t len) cons #if defined(EMSESP_DEBUG) if (len) { - LOG_DEBUG(F("Received topic `%s` => payload `%s` (length %d)"), topic, message, len); + LOG_DEBUG(("Received topic `%s` => payload `%s` (length %d)"), topic, message, len); } else { - LOG_DEBUG(F("Received topic `%s`"), topic); + LOG_DEBUG(("Received topic `%s`"), topic); } #endif // remove HA topics if we don't use discovery if (strncmp(topic, discovery_prefix().c_str(), discovery_prefix().size()) == 0) { if (!ha_enabled_ && len) { // don't ping pong the empty message queue_publish_message(topic, "", true); - LOG_DEBUG(F("Remove topic %s"), topic); + LOG_DEBUG(("Remove topic %s"), topic); } return; } @@ -285,7 +285,7 @@ void Mqtt::on_message(const char * topic, const char * payload, size_t len) cons snprintf(full_topic, sizeof(full_topic), "%s/%s", mqtt_base_.c_str(), mf.topic_.c_str()); if ((!strcmp(topic, full_topic)) && (mf.mqtt_subfunction_)) { if (!(mf.mqtt_subfunction_)(message)) { - LOG_ERROR(F("error: invalid payload %s for this topic %s"), message, topic); + LOG_ERROR(("error: invalid payload %s for this topic %s"), message, topic); if (send_response_) { Mqtt::publish(F_(response), "error: invalid data"); } @@ -341,10 +341,10 @@ void Mqtt::show_topic_handlers(uuid::console::Shell & shell, const uint8_t devic return; } - // shell.print(F(" Subscribed MQTT topics: ")); + // shell.print((" Subscribed MQTT topics: ")); // for (const auto & mqtt_subfunction : mqtt_subfunctions_) { // if (mqtt_subfunction.device_type_ == device_type) { - // shell.printf(F("%s "), mqtt_subfunction.topic_.c_str()); + // shell.printf(("%s "), mqtt_subfunction.topic_.c_str()); // } // } shell.println(); @@ -358,7 +358,7 @@ void Mqtt::on_publish(uint16_t packetId) const { // find the MQTT message in the queue and remove it if (mqtt_messages_.empty()) { #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] No message stored for ACK pid %d"), packetId); + LOG_DEBUG(("[DEBUG] No message stored for ACK pid %d"), packetId); #endif return; } @@ -368,18 +368,18 @@ void Mqtt::on_publish(uint16_t packetId) const { // if the last published failed, don't bother checking it. wait for the next retry if (mqtt_message.packet_id_ == 0) { #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] ACK for failed message pid 0")); + LOG_DEBUG(("[DEBUG] ACK for failed message pid 0")); #endif return; } if (mqtt_message.packet_id_ != packetId) { - LOG_ERROR(F("Mismatch, expecting PID %d, got %d"), mqtt_message.packet_id_, packetId); + LOG_ERROR(("Mismatch, expecting PID %d, got %d"), mqtt_message.packet_id_, packetId); mqtt_publish_fails_++; // increment error count } #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] ACK pid %d"), packetId); + LOG_DEBUG(("[DEBUG] ACK pid %d"), packetId); #endif mqtt_messages_.pop_front(); // always remove from queue, regardless if there was a successful ACK @@ -450,17 +450,17 @@ void Mqtt::start() { } connecting_ = false; if (reason == AsyncMqttClientDisconnectReason::TCP_DISCONNECTED) { - LOG_WARNING(F("MQTT disconnected: TCP")); + LOG_WARNING(("MQTT disconnected: TCP")); } else if (reason == AsyncMqttClientDisconnectReason::MQTT_IDENTIFIER_REJECTED) { - LOG_WARNING(F("MQTT disconnected: Identifier Rejected")); + LOG_WARNING(("MQTT disconnected: Identifier Rejected")); } else if (reason == AsyncMqttClientDisconnectReason::MQTT_SERVER_UNAVAILABLE) { - LOG_WARNING(F("MQTT disconnected: Server unavailable")); + LOG_WARNING(("MQTT disconnected: Server unavailable")); } else if (reason == AsyncMqttClientDisconnectReason::MQTT_MALFORMED_CREDENTIALS) { - LOG_WARNING(F("MQTT disconnected: Malformed credentials")); + LOG_WARNING(("MQTT disconnected: Malformed credentials")); } else if (reason == AsyncMqttClientDisconnectReason::MQTT_NOT_AUTHORIZED) { - LOG_WARNING(F("MQTT disconnected: Not authorized")); + LOG_WARNING(("MQTT disconnected: Not authorized")); } else { - LOG_WARNING(F("MQTT disconnected: code %d"), reason); + LOG_WARNING(("MQTT disconnected: code %d"), reason); } }); @@ -535,7 +535,7 @@ void Mqtt::on_connect() { return; } - LOG_INFO(F("MQTT connected")); + LOG_INFO(("MQTT connected")); connecting_ = true; connectcount_++; @@ -554,7 +554,7 @@ void Mqtt::on_connect() { doc["version"] = EMSESP_APP_VERSION; #ifndef EMSESP_STANDALONE if (WiFi.status() == WL_CONNECTED) { - doc["connection"] = F("WiFi"); + doc["connection"] = ("WiFi"); doc["hostname"] = WiFi.getHostname(); doc["SSID"] = WiFi.SSID(); doc["BSSID"] = WiFi.BSSIDstr(); @@ -567,7 +567,7 @@ void Mqtt::on_connect() { doc["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6()); } } else if (EMSESP::system_.ethernet_connected()) { - doc["connection"] = F("Ethernet"); + doc["connection"] = ("Ethernet"); doc["hostname"] = ETH.getHostname(); doc["MAC"] = ETH.macAddress(); doc["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); @@ -600,7 +600,7 @@ void Mqtt::on_connect() { // re-subscribe to all custom registered MQTT topics resubscribe(); - publish_retain(F("status"), "online", true); // say we're alive to the Last Will topic, with retain on + publish_retain(("status"), "online", true); // say we're alive to the Last Will topic, with retain on mqtt_publish_fails_ = 0; // reset fail count to 0 @@ -609,7 +609,7 @@ void Mqtt::on_connect() { LOG_INFO("Queue size: %d", mqtt_messages_.size()); for (const auto & message : mqtt_messages_) { auto content = message.content_; - LOG_INFO(F(" [%02d] (%d) topic=%s payload=%s"), message.id_, content->operation, content->topic.c_str(), content->payload.c_str()); + LOG_INFO((" [%02d] (%d) topic=%s payload=%s"), message.id_, content->operation, content->topic.c_str(), content->payload.c_str()); } */ } @@ -644,19 +644,19 @@ void Mqtt::ha_status() { // create the sensors - must match the MQTT payload keys if (!EMSESP::system_.ethernet_connected()) { - publish_system_ha_sensor_config(DeviceValueType::INT, F("WiFi RSSI"), F("rssi"), DeviceValueUOM::DBM); - publish_system_ha_sensor_config(DeviceValueType::INT, F("WiFi strength"), F("wifistrength"), DeviceValueUOM::PERCENT); + publish_system_ha_sensor_config(DeviceValueType::INT, ("WiFi RSSI"), ("rssi"), DeviceValueUOM::DBM); + publish_system_ha_sensor_config(DeviceValueType::INT, ("WiFi strength"), ("wifistrength"), DeviceValueUOM::PERCENT); } - publish_system_ha_sensor_config(DeviceValueType::INT, F("Uptime"), F("uptime"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Uptime (sec)"), F("uptime_sec"), DeviceValueUOM::SECONDS); - publish_system_ha_sensor_config(DeviceValueType::BOOL, F("NTP status"), F("ntp_status"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Free memory"), F("freemem"), DeviceValueUOM::KB); - publish_system_ha_sensor_config(DeviceValueType::INT, F("MQTT fails"), F("mqttfails"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Rx received"), F("rxreceived"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Rx fails"), F("rxfails"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Tx reads"), F("txreads"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Tx writes"), F("txwrites"), DeviceValueUOM::NONE); - publish_system_ha_sensor_config(DeviceValueType::INT, F("Tx fails"), F("txfails"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Uptime"), ("uptime"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Uptime (sec)"), ("uptime_sec"), DeviceValueUOM::SECONDS); + publish_system_ha_sensor_config(DeviceValueType::BOOL, ("NTP status"), ("ntp_status"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Free memory"), ("freemem"), DeviceValueUOM::KB); + publish_system_ha_sensor_config(DeviceValueType::INT, ("MQTT fails"), ("mqttfails"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Rx received"), ("rxreceived"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Rx fails"), ("rxfails"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Tx reads"), ("txreads"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Tx writes"), ("txwrites"), DeviceValueUOM::NONE); + publish_system_ha_sensor_config(DeviceValueType::INT, ("Tx fails"), ("txfails"), DeviceValueUOM::NONE); } // add sub or pub task to the queue. @@ -686,7 +686,7 @@ std::shared_ptr Mqtt::queue_message(const uint8_t operation, // if the queue is full, make room but removing the last one if (mqtt_messages_.size() >= MAX_MQTT_MESSAGES) { mqtt_messages_.pop_front(); - LOG_WARNING(F("Queue overflow, removing one message")); + LOG_WARNING(("Queue overflow, removing one message")); mqtt_publish_fails_++; } mqtt_messages_.emplace_back(mqtt_message_id_++, std::move(message)); @@ -718,17 +718,17 @@ void Mqtt::publish(const std::string & topic, const std::string & payload) { } // MQTT Publish, using a user's retain flag - except for char * strings -void Mqtt::publish(const __FlashStringHelper * topic, const char * payload) { - queue_publish_message(read_flash_string(topic), payload, mqtt_retain_); +void Mqtt::publish(const char * topic, const char * payload) { + queue_publish_message((topic), payload, mqtt_retain_); } // MQTT Publish, using a specific retain flag, topic is a flash string -void Mqtt::publish(const __FlashStringHelper * topic, const std::string & payload) { - queue_publish_message(read_flash_string(topic), payload, mqtt_retain_); +void Mqtt::publish(const char * topic, const std::string & payload) { + queue_publish_message((topic), payload, mqtt_retain_); } -void Mqtt::publish(const __FlashStringHelper * topic, const JsonObject & payload) { - publish(read_flash_string(topic), payload); +void Mqtt::publish(const char * topic, const JsonObject & payload) { + publish_retain(topic, payload, mqtt_retain_); } // publish json doc, only if its not empty @@ -737,12 +737,16 @@ void Mqtt::publish(const std::string & topic, const JsonObject & payload) { } // MQTT Publish, using a specific retain flag, topic is a flash string, forcing retain flag -void Mqtt::publish_retain(const __FlashStringHelper * topic, const std::string & payload, bool retain) { - queue_publish_message(read_flash_string(topic), payload, retain); +void Mqtt::publish_retain(const char * topic, const std::string & payload, bool retain) { + queue_publish_message((topic), payload, retain); } // publish json doc, only if its not empty, using the retain flag void Mqtt::publish_retain(const std::string & topic, const JsonObject & payload, bool retain) { + publish_retain(topic.c_str(), payload, retain); +} + +void Mqtt::publish_retain(const char * topic, const JsonObject & payload, bool retain) { if (enabled() && payload.size()) { std::string payload_text; serializeJson(payload, payload_text); // convert json to string @@ -750,12 +754,8 @@ void Mqtt::publish_retain(const std::string & topic, const JsonObject & payload, } } -void Mqtt::publish_retain(const __FlashStringHelper * topic, const JsonObject & payload, bool retain) { - publish_retain(read_flash_string(topic), payload, retain); -} - -void Mqtt::publish_ha(const __FlashStringHelper * topic, const JsonObject & payload) { - publish_ha(read_flash_string(topic), payload); +void Mqtt::publish_ha(const char * topic, const JsonObject & payload) { + publish_ha((topic), payload); } // publish empty payload to remove the topic @@ -766,7 +766,7 @@ void Mqtt::publish_ha(const std::string & topic) { std::string fulltopic = Mqtt::discovery_prefix() + topic; #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] Publishing empty HA topic=%s"), fulltopic.c_str()); + LOG_DEBUG(("[DEBUG] Publishing empty HA topic=%s"), fulltopic.c_str()); #endif queue_publish_message(fulltopic, "", true); // publish with retain to remove from broker @@ -784,9 +784,9 @@ void Mqtt::publish_ha(const std::string & topic, const JsonObject & payload) { std::string fulltopic = Mqtt::discovery_prefix() + topic; #if defined(EMSESP_STANDALONE) - LOG_DEBUG(F("Publishing HA topic=%s, payload=%s"), fulltopic.c_str(), payload_text.c_str()); + LOG_DEBUG(("Publishing HA topic=%s, payload=%s"), fulltopic.c_str(), payload_text.c_str()); #elif defined(EMSESP_DEBUG) - LOG_DEBUG(F("[debug] Publishing HA topic=%s, payload=%s"), fulltopic.c_str(), payload_text.c_str()); + LOG_DEBUG(("[debug] Publishing HA topic=%s, payload=%s"), fulltopic.c_str(), payload_text.c_str()); #endif // queue messages if the MQTT connection is not yet established. to ensure we don't miss messages @@ -815,7 +815,7 @@ void Mqtt::process_queue() { // it will have a real packet ID if (mqtt_message.packet_id_ > 0) { #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] Waiting for QOS-ACK")); + LOG_DEBUG(("[DEBUG] Waiting for QOS-ACK")); #endif // if we don't get the ack within 10 minutes, republish with new packet_id if (uuid::get_uptime_sec() - last_publish_queue_ < 600) { @@ -826,13 +826,13 @@ void Mqtt::process_queue() { // if we're subscribing... if (message->operation == Operation::SUBSCRIBE) { - LOG_DEBUG(F("Subscribing to topic '%s'"), topic); + LOG_DEBUG(("Subscribing to topic '%s'"), topic); uint16_t packet_id = mqttClient_->subscribe(topic, mqtt_qos_); if (!packet_id) { if (++mqtt_messages_.front().retry_count_ < MQTT_PUBLISH_MAX_RETRY) { return; } - LOG_ERROR(F("Error subscribing to topic '%s'"), topic); + LOG_ERROR(("Error subscribing to topic '%s'"), topic); mqtt_publish_fails_++; // increment failure counter } @@ -843,13 +843,13 @@ void Mqtt::process_queue() { // if we're unsubscribing... if (message->operation == Operation::UNSUBSCRIBE) { - LOG_DEBUG(F("Subscribing to topic '%s'"), topic); + LOG_DEBUG(("Subscribing to topic '%s'"), topic); uint16_t packet_id = mqttClient_->unsubscribe(topic); if (!packet_id) { if (++mqtt_messages_.front().retry_count_ < MQTT_PUBLISH_MAX_RETRY) { return; } - LOG_ERROR(F("Error unsubscribing to topic '%s'"), topic); + LOG_ERROR(("Error unsubscribing to topic '%s'"), topic); mqtt_publish_fails_++; // increment failure counter } @@ -860,7 +860,7 @@ void Mqtt::process_queue() { // else try and publish it uint16_t packet_id = mqttClient_->publish(topic, mqtt_qos_, message->retain, message->payload.c_str(), message->payload.size(), false, mqtt_message.id_); - LOG_DEBUG(F("Publishing topic %s (#%02d, retain=%d, retry=%d, size=%d, pid=%d)"), + LOG_DEBUG(("Publishing topic %s (#%02d, retain=%d, retry=%d, size=%d, pid=%d)"), topic, mqtt_message.id_, message->retain, @@ -871,14 +871,14 @@ void Mqtt::process_queue() { if (packet_id == 0) { // it failed. if we retried n times, give up. remove from queue if (mqtt_message.retry_count_ == (MQTT_PUBLISH_MAX_RETRY - 1)) { - LOG_ERROR(F("Failed to publish to %s after %d attempts"), topic, mqtt_message.retry_count_ + 1); + LOG_ERROR(("Failed to publish to %s after %d attempts"), topic, mqtt_message.retry_count_ + 1); mqtt_publish_fails_++; // increment failure counter mqtt_messages_.pop_front(); // delete return; } else { // update the record mqtt_messages_.front().retry_count_++; - LOG_DEBUG(F("Failed to publish to %s. Trying again, #%d"), topic, mqtt_message.retry_count_ + 1); + LOG_DEBUG(("Failed to publish to %s. Trying again, #%d"), topic, mqtt_message.retry_count_ + 1); return; // leave on queue for next time so it gets republished } } @@ -888,7 +888,7 @@ void Mqtt::process_queue() { if (mqtt_qos_ != 0) { mqtt_messages_.front().packet_id_ = packet_id; #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] Setting packetID for ACK to %d"), packet_id); + LOG_DEBUG(("[DEBUG] Setting packetID for ACK to %d"), packet_id); #endif return; } @@ -942,14 +942,14 @@ void Mqtt::publish_ha_sensor_config(DeviceValue & dv, const std::string & model, } // publish HA sensor for System using the heartbeat tag -void Mqtt::publish_system_ha_sensor_config(uint8_t type, const __FlashStringHelper * name, const __FlashStringHelper * entity, const uint8_t uom) { +void Mqtt::publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom) { StaticJsonDocument doc; JsonObject dev_json = doc.createNestedObject("dev"); JsonArray ids = dev_json.createNestedArray("ids"); ids.add("ems-esp"); - auto fullname = read_flash_string(name); + auto fullname = (name); // TODO is this needed? publish_ha_sensor_config(type, DeviceValueTAG::TAG_HEARTBEAT, fullname, name, EMSdevice::DeviceType::SYSTEM, entity, uom, false, false, nullptr, 0, 0, 0, dev_json); } @@ -957,20 +957,20 @@ void Mqtt::publish_system_ha_sensor_config(uint8_t type, const __FlashStringHelp // MQTT discovery configs // entity must match the key/value pair in the *_data topic // note: some extra string copying done here, it looks messy but does help with heap fragmentation issues -void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdevice::DeviceValueType - uint8_t tag, // EMSdevice::DeviceValueTAG - const std::string & fullname, // fullname, already translated - const __FlashStringHelper * const en_name, - const uint8_t device_type, // EMSdevice::DeviceType - const __FlashStringHelper * const entity, // same as shortname - const uint8_t uom, // EMSdevice::DeviceValueUOM (0=NONE) - const bool remove, // true if we want to remove this topic - const bool has_cmd, - const __FlashStringHelper * const ** options, - uint8_t options_size, - const int16_t dv_set_min, - const int16_t dv_set_max, - const JsonObject & dev_json) { +void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdevice::DeviceValueType + uint8_t tag, // EMSdevice::DeviceValueTAG + const std::string & fullname, // fullname, already translated + const char * const en_name, + const uint8_t device_type, // EMSdevice::DeviceType + const char * const entity, // same as shortname + const uint8_t uom, // EMSdevice::DeviceValueUOM (0=NONE) + const bool remove, // true if we want to remove this topic + const bool has_cmd, + const char * const ** options, + uint8_t options_size, + const int16_t dv_set_min, + const int16_t dv_set_max, + const JsonObject & dev_json) { // ignore if name (fullname) is empty if (fullname.empty() || en_name == nullptr) { return; @@ -983,9 +983,9 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // create entity by add the hc/wwc tag if present, separating with a . char new_entity[50]; if (tag >= DeviceValueTAG::TAG_HC1) { - snprintf(new_entity, sizeof(new_entity), "%s.%s", EMSdevice::tag_to_string(tag).c_str(), read_flash_string(entity).c_str()); + snprintf(new_entity, sizeof(new_entity), "%s.%s", EMSdevice::tag_to_string(tag).c_str(), (entity)); } else { - snprintf(new_entity, sizeof(new_entity), "%s", read_flash_string(entity).c_str()); + snprintf(new_entity, sizeof(new_entity), "%s", (entity)); } // build unique identifier which will be used in the topic, replacing all . with _ as not to break HA @@ -1037,7 +1037,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // if we're asking to remove this topic, send an empty payload and exit // https://github.com/emsesp/EMS-ESP32/issues/196 if (remove) { - LOG_DEBUG(F("Removing HA config for %s"), uniq); + LOG_DEBUG(("Removing HA config for %s"), uniq); publish_ha(topic); return; } @@ -1123,11 +1123,9 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // keep it compatible to v3.4, use english fullname, no prefix (basename prefix commmented out) char object_id[130]; if (have_tag) { - // snprintf(object_id, sizeof(object_id), "%s_%s_%s_%s", mqtt_basename_, device_name, EMSdevice::tag_to_string(tag).c_str(), read_flash_string(en_name).c_str()); - snprintf(object_id, sizeof(object_id), "%s_%s_%s", device_name, EMSdevice::tag_to_string(tag).c_str(), read_flash_string(en_name).c_str()); + snprintf(object_id, sizeof(object_id), "%s_%s_%s", device_name, EMSdevice::tag_to_string(tag).c_str(), (en_name)); } else { - // snprintf(object_id, sizeof(object_id), "%s_%s_%s", mqtt_basename_, device_name, read_flash_string(en_name).c_str()); - snprintf(object_id, sizeof(object_id), "%s_%s", device_name, read_flash_string(en_name).c_str()); + snprintf(object_id, sizeof(object_id), "%s_%s", device_name, (en_name)); } doc["object_id"] = object_id; @@ -1137,7 +1135,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, if (is_nested()) { snprintf(val_tpl, sizeof(val_tpl), "{{value_json.%s}}", new_entity); } else { - snprintf(val_tpl, sizeof(val_tpl), "{{value_json.%s}}", read_flash_string(entity).c_str()); + snprintf(val_tpl, sizeof(val_tpl), "{{value_json.%s}}", (entity)); } doc["val_tpl"] = val_tpl; @@ -1147,9 +1145,9 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // and has no unit of measure or icon if (type == DeviceValueType::BOOL) { char result[10]; - doc[F("payload_on")] = Helpers::render_boolean(result, true); - doc[F("payload_off")] = Helpers::render_boolean(result, false); - doc[sc_ha] = F_(measurement); + doc[("payload_on")] = Helpers::render_boolean(result, true); + doc[("payload_off")] = Helpers::render_boolean(result, false); + doc[sc_ha] = F_(measurement); } else { // always set the uom if (uom != DeviceValueUOM::NONE) { @@ -1169,11 +1167,11 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, case DeviceValueUOM::DEGREES: case DeviceValueUOM::DEGREES_R: doc[sc_ha] = F_(measurement); - doc[dc_ha] = F("temperature"); // no icon needed + doc[dc_ha] = ("temperature"); // no icon needed break; case DeviceValueUOM::PERCENT: doc[sc_ha] = F_(measurement); - doc[dc_ha] = F("power_factor"); // no icon needed + doc[dc_ha] = ("power_factor"); // no icon needed break; case DeviceValueUOM::SECONDS: case DeviceValueUOM::MINUTES: @@ -1198,11 +1196,11 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, } else { doc[sc_ha] = F_(measurement); } - doc[dc_ha] = F("energy"); // no icon needed + doc[dc_ha] = ("energy"); // no icon needed break; case DeviceValueUOM::KWH: doc[sc_ha] = F_(total_increasing); - doc[dc_ha] = F("energy"); // no icon needed + doc[dc_ha] = ("energy"); // no icon needed break; case DeviceValueUOM::UA: doc[ic_ha] = F_(iconua); @@ -1210,16 +1208,16 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, break; case DeviceValueUOM::BAR: doc[sc_ha] = F_(measurement); - doc[dc_ha] = F("pressure"); + doc[dc_ha] = ("pressure"); break; case DeviceValueUOM::W: case DeviceValueUOM::KW: doc[sc_ha] = F_(measurement); - doc[dc_ha] = F("power"); + doc[dc_ha] = ("power"); break; case DeviceValueUOM::DBM: doc[sc_ha] = F_(measurement); - doc[dc_ha] = F("signal_strength"); + doc[dc_ha] = ("signal_strength"); break; case DeviceValueUOM::NONE: // for device entities which have numerical values, with no UOM diff --git a/src/mqtt.h b/src/mqtt.h index 26cfb51dc..94584369e 100644 --- a/src/mqtt.h +++ b/src/mqtt.h @@ -79,35 +79,35 @@ class Mqtt { static void resubscribe(); static void publish(const std::string & topic, const std::string & payload); - static void publish(const __FlashStringHelper * topic, const char * payload); + static void publish(const char * topic, const char * payload); static void publish(const std::string & topic, const JsonObject & payload); - static void publish(const __FlashStringHelper * topic, const JsonObject & payload); - static void publish(const __FlashStringHelper * topic, const std::string & payload); + static void publish(const char * topic, const JsonObject & payload); + static void publish(const char * topic, const std::string & payload); static void publish_retain(const std::string & topic, const JsonObject & payload, bool retain); - static void publish_retain(const __FlashStringHelper * topic, const std::string & payload, bool retain); - static void publish_retain(const __FlashStringHelper * topic, const JsonObject & payload, bool retain); + static void publish_retain(const char * topic, const std::string & payload, bool retain); + static void publish_retain(const char * topic, const JsonObject & payload, bool retain); static void publish_ha(const std::string & topic, const JsonObject & payload); - static void publish_ha(const __FlashStringHelper * topic, const JsonObject & payload); + static void publish_ha(const char * topic, const JsonObject & payload); static void publish_ha(const std::string & topic); static void publish_ha_sensor_config(DeviceValue & dv, const std::string & model, const std::string & brand, const bool remove, const bool create_device_config = false); - static void publish_ha_sensor_config(uint8_t type, - uint8_t tag, - const std::string & fullname, - const __FlashStringHelper * const en_name, - const uint8_t device_type, - const __FlashStringHelper * const entity, - const uint8_t uom, - const bool remove, - const bool has_cmd, - const __FlashStringHelper * const ** options, - uint8_t options_size, - const int16_t dv_set_min, - const int16_t dv_set_max, - const JsonObject & dev_json); + static void publish_ha_sensor_config(uint8_t type, + uint8_t tag, + const std::string & fullname, + const char * const en_name, + const uint8_t device_type, + const char * const entity, + const uint8_t uom, + const bool remove, + const bool has_cmd, + const char * const ** options, + uint8_t options_size, + const int16_t dv_set_min, + const int16_t dv_set_max, + const JsonObject & dev_json); - static void publish_system_ha_sensor_config(uint8_t type, const __FlashStringHelper * name, const __FlashStringHelper * entity, const uint8_t uom); + static void publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom); static void publish_ha_climate_config(uint8_t tag, bool has_roomtemp, bool remove = false); static void show_topic_handlers(uuid::console::Shell & shell, const uint8_t device_type); diff --git a/src/shower.cpp b/src/shower.cpp index a481cf281..56a98a8d3 100644 --- a/src/shower.cpp +++ b/src/shower.cpp @@ -57,7 +57,7 @@ void Shower::loop() { // first check to see if hot water has been on long enough to be recognized as a Shower/Bath if (!shower_state_ && (time_now - timer_start_) > SHOWER_MIN_DURATION) { set_shower_state(true); - LOG_DEBUG(F("[Shower] hot water still running, starting shower timer")); + LOG_DEBUG(("[Shower] hot water still running, starting shower timer")); } // check if the shower has been on too long else if ((time_now - timer_start_) > shower_alert_trigger_) { @@ -82,8 +82,8 @@ void Shower::loop() { char s[50]; snprintf(s, 50, "%d minutes and %d seconds", (uint8_t)(duration_ / 60000), (uint8_t)((duration_ / 1000) % 60)); doc["duration"] = s; - Mqtt::publish(F("shower_data"), doc.as()); - LOG_DEBUG(F("[Shower] finished with duration %d"), duration_); + Mqtt::publish(("shower_data"), doc.as()); + LOG_DEBUG(("[Shower] finished with duration %d"), duration_); } } @@ -109,7 +109,7 @@ void Shower::loop() { // turn back on the hot water for the shower void Shower::shower_alert_stop() { if (doing_cold_shot_) { - LOG_DEBUG(F("Shower Alert stopped")); + LOG_DEBUG(("Shower Alert stopped")); (void)Command::call(EMSdevice::DeviceType::BOILER, "wwtapactivated", "true"); doing_cold_shot_ = false; } @@ -117,7 +117,7 @@ void Shower::shower_alert_stop() { // turn off hot water to send a shot of cold void Shower::shower_alert_start() { if (shower_alert_) { - LOG_DEBUG(F("Shower Alert started")); + LOG_DEBUG(("Shower Alert started")); (void)Command::call(EMSdevice::DeviceType::BOILER, "wwtapactivated", "false"); doing_cold_shot_ = true; alert_timer_start_ = uuid::get_uptime(); // timer starts now @@ -144,7 +144,7 @@ void Shower::set_shower_state(bool state, bool force) { // always publish as a string char s[7]; - Mqtt::publish(F("shower_active"), Helpers::render_boolean(s, shower_state_)); // https://github.com/emsesp/EMS-ESP/issues/369 + Mqtt::publish(("shower_active"), Helpers::render_boolean(s, shower_state_)); // https://github.com/emsesp/EMS-ESP/issues/369 // send out HA MQTT Discovery config topic if ((Mqtt::ha_enabled()) && (!ha_configdone_ || force)) { @@ -158,8 +158,8 @@ void Shower::set_shower_state(bool state, bool force) { // always render boolean as strings for HA char result[10]; - doc[F("payload_on")] = Helpers::render_boolean(result, true); - doc[F("payload_off")] = Helpers::render_boolean(result, false); + doc[("payload_on")] = Helpers::render_boolean(result, true); + doc[("payload_off")] = Helpers::render_boolean(result, false); JsonObject dev = doc.createNestedObject("dev"); JsonArray ids = dev.createNestedArray("ids"); diff --git a/src/system.cpp b/src/system.cpp index 27008e1ae..a78044a21 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -77,19 +77,19 @@ bool System::command_fetch(const char * value, const int8_t id) { std::string value_s; if (Helpers::value2string(value, value_s)) { if (value_s == "all") { - LOG_INFO(F("Requesting data from EMS devices")); + LOG_INFO(("Requesting data from EMS devices")); EMSESP::fetch_device_values(); return true; - } else if (value_s == read_flash_string(F_(boiler))) { + } else if (value_s == (F_(boiler))) { EMSESP::fetch_device_values_type(EMSdevice::DeviceType::BOILER); return true; - } else if (value_s == read_flash_string(F_(thermostat))) { + } else if (value_s == (F_(thermostat))) { EMSESP::fetch_device_values_type(EMSdevice::DeviceType::THERMOSTAT); return true; - } else if (value_s == read_flash_string(F_(solar))) { + } else if (value_s == (F_(solar))) { EMSESP::fetch_device_values_type(EMSdevice::DeviceType::SOLAR); return true; - } else if (value_s == read_flash_string(F_(mixer))) { + } else if (value_s == (F_(mixer))) { EMSESP::fetch_device_values_type(EMSdevice::DeviceType::MIXER); return true; } @@ -105,31 +105,31 @@ bool System::command_publish(const char * value, const int8_t id) { if (Helpers::value2string(value, value_s)) { if (value_s == "ha") { EMSESP::publish_all(true); // includes HA - LOG_INFO(F("Publishing all data to MQTT, including HA configs")); + LOG_INFO(("Publishing all data to MQTT, including HA configs")); return true; - } else if (value_s == read_flash_string(F_(boiler))) { + } else if (value_s == (F_(boiler))) { EMSESP::publish_device_values(EMSdevice::DeviceType::BOILER); return true; - } else if (value_s == read_flash_string(F_(thermostat))) { + } else if (value_s == (F_(thermostat))) { EMSESP::publish_device_values(EMSdevice::DeviceType::THERMOSTAT); return true; - } else if (value_s == read_flash_string(F_(solar))) { + } else if (value_s == (F_(solar))) { EMSESP::publish_device_values(EMSdevice::DeviceType::SOLAR); return true; - } else if (value_s == read_flash_string(F_(mixer))) { + } else if (value_s == (F_(mixer))) { EMSESP::publish_device_values(EMSdevice::DeviceType::MIXER); return true; } else if (value_s == "other") { EMSESP::publish_other_values(); // switch and heat pump return true; - } else if ((value_s == read_flash_string(F_(dallassensor))) || (value_s == read_flash_string(F_(analogsensor)))) { + } else if ((value_s == (F_(dallassensor))) || (value_s == (F_(analogsensor)))) { EMSESP::publish_sensor_values(true); return true; } } EMSESP::publish_all(); - LOG_INFO(F("Publishing all data to MQTT")); + LOG_INFO(("Publishing all data to MQTT")); return true; } @@ -166,11 +166,9 @@ bool System::command_watch(const char * value, const int8_t id) { } if (Mqtt::publish_single() && w != EMSESP::watch()) { if (Mqtt::publish_single2cmd()) { - Mqtt::publish(F("system/watch"), - EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(w) : read_flash_string(FL_(list_watch)[w]).c_str()); + Mqtt::publish(("system/watch"), EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(w) : (FL_(list_watch)[w])); } else { - Mqtt::publish(F("system_data/watch"), - EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(w) : read_flash_string(FL_(list_watch)[w]).c_str()); + Mqtt::publish(("system_data/watch"), EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(w) : (FL_(list_watch)[w])); } } EMSESP::watch(w); @@ -178,9 +176,9 @@ bool System::command_watch(const char * value, const int8_t id) { } else if (i) { if (Mqtt::publish_single() && i != EMSESP::watch_id()) { if (Mqtt::publish_single2cmd()) { - Mqtt::publish(F("system/watch"), Helpers::hextoa(i)); + Mqtt::publish(("system/watch"), Helpers::hextoa(i)); } else { - Mqtt::publish(F("system_data/watch"), Helpers::hextoa(i)); + Mqtt::publish(("system_data/watch"), Helpers::hextoa(i)); } } EMSESP::watch_id(i); @@ -194,7 +192,7 @@ bool System::command_watch(const char * value, const int8_t id) { // restart EMS-ESP void System::system_restart() { - LOG_INFO(F("Restarting EMS-ESP...")); + LOG_INFO(("Restarting EMS-ESP...")); Shell::loop_all(); delay(1000); // wait a second #ifndef EMSESP_STANDALONE @@ -204,7 +202,7 @@ void System::system_restart() { // saves all settings void System::wifi_reconnect() { - LOG_INFO(F("WiFi reconnecting...")); + LOG_INFO(("WiFi reconnecting...")); Shell::loop_all(); EMSESP::console_.loop(); delay(1000); // wait a second @@ -214,7 +212,7 @@ void System::wifi_reconnect() { // format the FS. Wipes everything. void System::format(uuid::console::Shell & shell) { - auto msg = F("Formatting file system. This will reset all settings to their defaults"); + auto msg = ("Formatting file system. This will reset all settings to their defaults"); shell.logger().warning(msg); shell.flush(); @@ -243,7 +241,7 @@ void System::syslog_init() { // start & configure syslog if (!was_enabled) { syslog_.start(); - EMSESP::logger().info(F("Starting Syslog")); + EMSESP::logger().info(("Starting Syslog")); } syslog_.log_level((uuid::log::Level)syslog_level_); syslog_.mark_interval(syslog_mark_interval_); @@ -252,12 +250,12 @@ void System::syslog_init() { // register the command // TODO translate this - Command::add(EMSdevice::DeviceType::SYSTEM, F_(syslog), System::command_syslog_level, F("change the syslog level"), CommandFlag::ADMIN_ONLY); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(syslog), System::command_syslog_level, ("change the syslog level"), CommandFlag::ADMIN_ONLY); } else if (was_enabled) { // in case service is still running, this flushes the queue // https://github.com/emsesp/EMS-ESP/issues/496 - EMSESP::logger().info(F("Stopping Syslog")); + EMSESP::logger().info(("Stopping Syslog")); syslog_.log_level((uuid::log::Level)-1); syslog_.mark_interval(0); syslog_.destination(""); @@ -265,23 +263,21 @@ void System::syslog_init() { if (Mqtt::publish_single()) { if (Mqtt::publish_single2cmd()) { - Mqtt::publish(F("system/syslog"), syslog_enabled_ ? read_flash_string(FL_(list_syslog_level)[syslog_level_ + 1]).c_str() : "off"); + Mqtt::publish(("system/syslog"), syslog_enabled_ ? (FL_(list_syslog_level)[syslog_level_ + 1]) : "off"); if (EMSESP::watch_id() == 0 || EMSESP::watch() == 0) { - Mqtt::publish(F("system/watch"), - EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(EMSESP::watch()) - : read_flash_string(FL_(list_watch)[EMSESP::watch()]).c_str()); + Mqtt::publish(("system/watch"), + EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(EMSESP::watch()) : (FL_(list_watch)[EMSESP::watch()])); } else { - Mqtt::publish(F("system/watch"), Helpers::hextoa(EMSESP::watch_id())); + Mqtt::publish(("system/watch"), Helpers::hextoa(EMSESP::watch_id())); } } else { - Mqtt::publish(F("system_data/syslog"), syslog_enabled_ ? read_flash_string(FL_(list_syslog_level)[syslog_level_ + 1]).c_str() : "off"); + Mqtt::publish(("system_data/syslog"), syslog_enabled_ ? (FL_(list_syslog_level)[syslog_level_ + 1]) : "off"); if (EMSESP::watch_id() == 0 || EMSESP::watch() == 0) { - Mqtt::publish(F("system_data/watch"), - EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(EMSESP::watch()) - : read_flash_string(FL_(list_watch)[EMSESP::watch()]).c_str()); + Mqtt::publish(("system_data/watch"), + EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX ? Helpers::itoa(EMSESP::watch()) : (FL_(list_watch)[EMSESP::watch()])); } else { - Mqtt::publish(F("system_data/watch"), Helpers::hextoa(EMSESP::watch_id())); + Mqtt::publish(("system_data/watch"), Helpers::hextoa(EMSESP::watch_id())); } } } @@ -348,7 +344,7 @@ void System::wifi_tweak() { WiFi.setSleep(false); // turn off sleep - WIFI_PS_NONE bool s2 = WiFi.getSleep(); #if defined(EMSESP_DEBUG) - LOG_DEBUG(F("[DEBUG] Adjusting WiFi - Tx power %d->%d, Sleep %d->%d"), p1, p2, s1, s2); + LOG_DEBUG(("[DEBUG] Adjusting WiFi - Tx power %d->%d, Sleep %d->%d"), p1, p2, s1, s2); #endif #endif } @@ -403,7 +399,7 @@ void System::start() { // button single click void System::button_OnClick(PButton & b) { - LOG_DEBUG(F("Button pressed - single click")); + LOG_DEBUG(("Button pressed - single click")); #ifdef EMSESP_DEBUG #ifndef EMSESP_STANDALONE @@ -414,20 +410,20 @@ void System::button_OnClick(PButton & b) { // button double click void System::button_OnDblClick(PButton & b) { - LOG_DEBUG(F("Button pressed - double click - reconnect")); + LOG_DEBUG(("Button pressed - double click - reconnect")); EMSESP::system_.wifi_reconnect(); } // button long press void System::button_OnLongPress(PButton & b) { - LOG_DEBUG(F("Button pressed - long press")); + LOG_DEBUG(("Button pressed - long press")); } // button indefinite press void System::button_OnVLongPress(PButton & b) { - LOG_DEBUG(F("Button pressed - very long press")); + LOG_DEBUG(("Button pressed - very long press")); #ifndef EMSESP_STANDALONE - LOG_WARNING(F("Performing factory reset...")); + LOG_WARNING(("Performing factory reset...")); EMSESP::console_.loop(); EMSESP::esp8266React.factoryReset(); #endif @@ -441,12 +437,12 @@ void System::button_init(bool refresh) { if (is_valid_gpio(pbutton_gpio_)) { if (!myPButton_.init(pbutton_gpio_, HIGH)) { - LOG_DEBUG(F("Multi-functional button not detected")); + LOG_DEBUG(("Multi-functional button not detected")); } else { - LOG_DEBUG(F("Multi-functional button enabled")); + LOG_DEBUG(("Multi-functional button enabled")); } } else { - LOG_WARNING(F("Invalid button GPIO. Check config.")); + LOG_WARNING(("Invalid button GPIO. Check config.")); } myPButton_.onClick(BUTTON_Debounce, button_OnClick); @@ -668,25 +664,25 @@ void System::system_check() { // commands - takes static function pointers void System::commands_init() { - // TODO these should be translated too - Command::add(EMSdevice::DeviceType::SYSTEM, F_(send), System::command_send, F("send a telegram"), CommandFlag::ADMIN_ONLY); - Command::add(EMSdevice::DeviceType::SYSTEM, F_(fetch), System::command_fetch, F("refresh all EMS values"), CommandFlag::ADMIN_ONLY); - Command::add(EMSdevice::DeviceType::SYSTEM, F_(restart), System::command_restart, F("restart EMS-ESP"), CommandFlag::ADMIN_ONLY); - Command::add(EMSdevice::DeviceType::SYSTEM, F_(watch), System::command_watch, F("watch incoming telegrams")); + // TODO translate this + Command::add(EMSdevice::DeviceType::SYSTEM, F_(send), System::command_send, ("send a telegram"), CommandFlag::ADMIN_ONLY); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(fetch), System::command_fetch, ("refresh all EMS values"), CommandFlag::ADMIN_ONLY); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(restart), System::command_restart, ("restart EMS-ESP"), CommandFlag::ADMIN_ONLY); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(watch), System::command_watch, ("watch incoming telegrams")); // register syslog command in syslog init - // Command::add(EMSdevice::DeviceType::SYSTEM, F_(syslog), System::command_syslog_level, F("set syslog level"), CommandFlag::ADMIN_ONLY); + // Command::add(EMSdevice::DeviceType::SYSTEM, F_(syslog), System::command_syslog_level, ("set syslog level"), CommandFlag::ADMIN_ONLY); if (Mqtt::enabled()) { - Command::add(EMSdevice::DeviceType::SYSTEM, F_(publish), System::command_publish, F("force a MQTT publish")); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(publish), System::command_publish, ("force a MQTT publish")); } // these commands will return data in JSON format - Command::add(EMSdevice::DeviceType::SYSTEM, F_(info), System::command_info, F("show system status")); - Command::add(EMSdevice::DeviceType::SYSTEM, F_(commands), System::command_commands, F("fetch system commands")); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(info), System::command_info, ("show system status")); + Command::add(EMSdevice::DeviceType::SYSTEM, F_(commands), System::command_commands, ("fetch system commands")); #if defined(EMSESP_DEBUG) - Command::add(EMSdevice::DeviceType::SYSTEM, F("test"), System::command_test, F("run a specific test")); + Command::add(EMSdevice::DeviceType::SYSTEM, ("test"), System::command_test, ("run a specific test")); #endif // MQTT subscribe "ems-esp/system/#" @@ -776,12 +772,12 @@ int8_t System::wifi_quality(int8_t dBm) { // print users to console void System::show_users(uuid::console::Shell & shell) { - shell.printfln(F("Users:")); + shell.printfln(("Users:")); #ifndef EMSESP_STANDALONE EMSESP::esp8266React.getSecuritySettingsService()->read([&](SecuritySettings & securitySettings) { for (const User & user : securitySettings.users) { - shell.printfln(F(" username: %s, password: %s, is_admin: %s"), user.username.c_str(), user.password.c_str(), user.admin ? F("yes") : F("no")); + shell.printfln((" username: %s, password: %s, is_admin: %s"), user.username.c_str(), user.password.c_str(), user.admin ? ("yes") : ("no")); } }); #endif @@ -791,94 +787,94 @@ void System::show_users(uuid::console::Shell & shell) { void System::show_system(uuid::console::Shell & shell) { shell.println("System:"); - shell.printfln(F(" Board profile: %s"), board_profile().c_str()); - shell.printfln(F(" Uptime: %s"), uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3).c_str()); + shell.printfln((" Board profile: %s"), board_profile().c_str()); + shell.printfln((" Uptime: %s"), uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3).c_str()); #ifndef EMSESP_STANDALONE - shell.printfln(F(" SDK version: %s"), ESP.getSdkVersion()); - shell.printfln(F(" CPU frequency: %lu MHz"), ESP.getCpuFreqMHz()); - shell.printfln(F(" Free heap: %lu KB"), (uint32_t)ESP.getFreeHeap() / 1024); - shell.printfln(F(" App used/free: %lu KB / %lu KB"), appUsed(), appFree()); + shell.printfln((" SDK version: %s"), ESP.getSdkVersion()); + shell.printfln((" CPU frequency: %lu MHz"), ESP.getCpuFreqMHz()); + shell.printfln((" Free heap: %lu KB"), (uint32_t)ESP.getFreeHeap() / 1024); + shell.printfln((" App used/free: %lu KB / %lu KB"), appUsed(), appFree()); uint32_t FSused = LittleFS.usedBytes() / 1024; - shell.printfln(F(" FS used/free: %lu KB / %lu KB"), FSused, FStotal() - FSused); + shell.printfln((" FS used/free: %lu KB / %lu KB"), FSused, FStotal() - FSused); shell.println(); shell.println("Network:"); switch (WiFi.status()) { case WL_IDLE_STATUS: - shell.printfln(F(" Network: Idle")); + shell.printfln((" Network: Idle")); break; case WL_NO_SSID_AVAIL: - shell.printfln(F(" Network: Network not found")); + shell.printfln((" Network: Network not found")); break; case WL_SCAN_COMPLETED: - shell.printfln(F(" Network: Network scan complete")); + shell.printfln((" Network: Network scan complete")); break; case WL_CONNECTED: - shell.printfln(F(" Network: connected")); - shell.printfln(F(" SSID: %s"), WiFi.SSID().c_str()); - shell.printfln(F(" BSSID: %s"), WiFi.BSSIDstr().c_str()); - shell.printfln(F(" RSSI: %d dBm (%d %%)"), WiFi.RSSI(), wifi_quality(WiFi.RSSI())); - shell.printfln(F(" MAC address: %s"), WiFi.macAddress().c_str()); - shell.printfln(F(" Hostname: %s"), WiFi.getHostname()); - shell.printfln(F(" IPv4 address: %s/%s"), uuid::printable_to_string(WiFi.localIP()).c_str(), uuid::printable_to_string(WiFi.subnetMask()).c_str()); - shell.printfln(F(" IPv4 gateway: %s"), uuid::printable_to_string(WiFi.gatewayIP()).c_str()); - shell.printfln(F(" IPv4 nameserver: %s"), uuid::printable_to_string(WiFi.dnsIP()).c_str()); + shell.printfln((" Network: connected")); + shell.printfln((" SSID: %s"), WiFi.SSID().c_str()); + shell.printfln((" BSSID: %s"), WiFi.BSSIDstr().c_str()); + shell.printfln((" RSSI: %d dBm (%d %%)"), WiFi.RSSI(), wifi_quality(WiFi.RSSI())); + shell.printfln((" MAC address: %s"), WiFi.macAddress().c_str()); + shell.printfln((" Hostname: %s"), WiFi.getHostname()); + shell.printfln((" IPv4 address: %s/%s"), uuid::printable_to_string(WiFi.localIP()).c_str(), uuid::printable_to_string(WiFi.subnetMask()).c_str()); + shell.printfln((" IPv4 gateway: %s"), uuid::printable_to_string(WiFi.gatewayIP()).c_str()); + shell.printfln((" IPv4 nameserver: %s"), uuid::printable_to_string(WiFi.dnsIP()).c_str()); if (WiFi.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { - shell.printfln(F(" IPv6 address: %s"), uuid::printable_to_string(WiFi.localIPv6()).c_str()); + shell.printfln((" IPv6 address: %s"), uuid::printable_to_string(WiFi.localIPv6()).c_str()); } break; case WL_CONNECT_FAILED: - shell.printfln(F(" WiFi Network: Connection failed")); + shell.printfln((" WiFi Network: Connection failed")); break; case WL_CONNECTION_LOST: - shell.printfln(F(" WiFi Network: Connection lost")); + shell.printfln((" WiFi Network: Connection lost")); break; case WL_DISCONNECTED: - shell.printfln(F(" WiFi Network: Disconnected")); + shell.printfln((" WiFi Network: Disconnected")); break; case WL_NO_SHIELD: default: - shell.printfln(F(" WiFi Network: Unknown")); + shell.printfln((" WiFi Network: Unknown")); break; } // show Ethernet if connected if (ethernet_connected_) { shell.println(); - shell.printfln(F(" Ethernet Network: connected")); - shell.printfln(F(" MAC address: %s"), ETH.macAddress().c_str()); - shell.printfln(F(" Hostname: %s"), ETH.getHostname()); - shell.printfln(F(" IPv4 address: %s/%s"), uuid::printable_to_string(ETH.localIP()).c_str(), uuid::printable_to_string(ETH.subnetMask()).c_str()); - shell.printfln(F(" IPv4 gateway: %s"), uuid::printable_to_string(ETH.gatewayIP()).c_str()); - shell.printfln(F(" IPv4 nameserver: %s"), uuid::printable_to_string(ETH.dnsIP()).c_str()); + shell.printfln((" Ethernet Network: connected")); + shell.printfln((" MAC address: %s"), ETH.macAddress().c_str()); + shell.printfln((" Hostname: %s"), ETH.getHostname()); + shell.printfln((" IPv4 address: %s/%s"), uuid::printable_to_string(ETH.localIP()).c_str(), uuid::printable_to_string(ETH.subnetMask()).c_str()); + shell.printfln((" IPv4 gateway: %s"), uuid::printable_to_string(ETH.gatewayIP()).c_str()); + shell.printfln((" IPv4 nameserver: %s"), uuid::printable_to_string(ETH.dnsIP()).c_str()); if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { - shell.printfln(F(" IPv6 address: %s"), uuid::printable_to_string(ETH.localIPv6()).c_str()); + shell.printfln((" IPv6 address: %s"), uuid::printable_to_string(ETH.localIPv6()).c_str()); } } shell.println(); shell.println("Syslog:"); if (!syslog_enabled_) { - shell.printfln(F(" Syslog: disabled")); + shell.printfln((" Syslog: disabled")); } else { - shell.printfln(F(" Syslog: %s"), syslog_.started() ? "started" : "stopped"); - shell.print(F(" ")); - shell.printfln(F_(host_fmt), !syslog_host_.isEmpty() ? syslog_host_.c_str() : read_flash_string(F_(unset)).c_str()); - shell.printfln(F(" IP: %s"), uuid::printable_to_string(syslog_.ip()).c_str()); - shell.print(F(" ")); + shell.printfln((" Syslog: %s"), syslog_.started() ? "started" : "stopped"); + shell.print((" ")); + shell.printfln(F_(host_fmt), !syslog_host_.isEmpty() ? syslog_host_.c_str() : (F_(unset))); + shell.printfln((" IP: %s"), uuid::printable_to_string(syslog_.ip()).c_str()); + shell.print((" ")); shell.printfln(F_(port_fmt), syslog_port_); - shell.print(F(" ")); + shell.print((" ")); shell.printfln(F_(log_level_fmt), uuid::log::format_level_lowercase(static_cast(syslog_level_))); - shell.print(F(" ")); + shell.print((" ")); shell.printfln(F_(mark_interval_fmt), syslog_mark_interval_); - shell.printfln(F(" Queued: %d"), syslog_.queued()); + shell.printfln((" Queued: %d"), syslog_.queued()); } #endif @@ -912,10 +908,10 @@ bool System::check_upgrade() { // it's a customization file, just replace it and there's no need to reboot saveSettings(EMSESP_CUSTOMIZATION_FILE, "Customizations", input); } else { - LOG_ERROR(F("Unrecognized file uploaded")); + LOG_ERROR(("Unrecognized file uploaded")); } } else { - LOG_ERROR(F("Unrecognized file uploaded, not json")); + LOG_ERROR(("Unrecognized file uploaded, not json")); } // close (just in case) and remove the temp file @@ -958,7 +954,7 @@ bool System::saveSettings(const char * filename, const char * section, JsonObjec if (section_json) { File section_file = LittleFS.open(filename, "w"); if (section_file) { - LOG_INFO(F("Applying new %s settings"), section); + LOG_INFO(("Applying new %s settings"), section); serializeJson(section_json, section_file); section_file.close(); return true; // reboot required @@ -988,7 +984,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp // Network Status node = output.createNestedObject("Network Status"); if (WiFi.status() == WL_CONNECTED) { - node["connection"] = F("WiFi"); + node["connection"] = ("WiFi"); node["hostname"] = WiFi.getHostname(); // node["SSID"] = WiFi.SSID(); // node["BSSID"] = WiFi.BSSIDstr(); @@ -1001,7 +997,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp node["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6()); } } else if (EMSESP::system_.ethernet_connected()) { - node["connection"] = F("Ethernet"); + node["connection"] = ("Ethernet"); node["hostname"] = ETH.getHostname(); node["MAC"] = ETH.macAddress(); node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); @@ -1115,20 +1111,20 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp node = output.createNestedObject("Bus Status"); switch (EMSESP::bus_status()) { case EMSESP::BUS_STATUS_OFFLINE: - node["bus status"] = (F("disconnected")); + node["bus status"] = (("disconnected")); break; case EMSESP::BUS_STATUS_TX_ERRORS: - node["bus status"] = (F("connected, tx issues - try a different Tx Mode")); + node["bus status"] = (("connected, tx issues - try a different Tx Mode")); break; case EMSESP::BUS_STATUS_CONNECTED: - node["bus status"] = (F("connected")); + node["bus status"] = (("connected")); break; default: - node["bus status"] = (F("unknown")); + node["bus status"] = (("unknown")); break; } if (EMSESP::bus_status() != EMSESP::BUS_STATUS_OFFLINE) { - node["bus protocol"] = EMSbus::is_ht3() ? F("HT3") : F("Buderus"); + node["bus protocol"] = EMSbus::is_ht3() ? ("HT3") : ("Buderus"); node["bus telegrams received (rx)"] = EMSESP::rxservice_.telegram_count(); node["bus reads (tx)"] = EMSESP::txservice_.telegram_read_count(); node["bus writes (tx)"] = EMSESP::txservice_.telegram_write_count(); @@ -1320,7 +1316,7 @@ std::string System::reset_reason(uint8_t cpu) const { // set NTP status void System::ntp_connected(bool b) { if (b != ntp_connected_) { - LOG_INFO(b ? F("NTP connected") : F("NTP disconnected")); + LOG_INFO(b ? ("NTP connected") : ("NTP disconnected")); } ntp_connected_ = b; ntp_last_check_ = b ? uuid::get_uptime_sec() : 0; diff --git a/src/telegram.cpp b/src/telegram.cpp index f96cdf43e..eb02f3b6d 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -120,7 +120,7 @@ std::string Telegram::to_string() const { // returns telegram's message body only, in hex std::string Telegram::to_string_message() const { if (this->message_length == 0) { - return read_flash_string(F("")); + return (("")); } return Helpers::data_to_hex(this->message_data, this->message_length); @@ -150,9 +150,9 @@ void RxService::add(uint8_t * data, uint8_t length) { if (data[length - 1] != crc) { if ((data[0] & 0x7F) != ems_bus_id()) { // do not count echos as errors telegram_error_count_++; - LOG_WARNING(F("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC + LOG_WARNING(("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC } else { - LOG_TRACE(F("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC + LOG_TRACE(("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC } return; } @@ -203,16 +203,16 @@ void RxService::add(uint8_t * data, uint8_t length) { uint16_t trace_watch_id = EMSESP::watch_id(); if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id) || ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) { - LOG_NOTICE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); + LOG_NOTICE(("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); } else if (EMSESP::trace_raw()) { - LOG_TRACE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); + LOG_TRACE(("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); } } else if (EMSESP::trace_raw()) { - LOG_TRACE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); + LOG_TRACE(("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); } #ifdef EMSESP_DEBUG - LOG_DEBUG(F("[DEBUG] New Rx telegram, message length %d"), message_length); + LOG_DEBUG(("[DEBUG] New Rx telegram, message length %d"), message_length); #endif // if we don't have a type_id exit, @@ -262,7 +262,7 @@ void TxService::start() { // sends a 1 byte poll which is our own deviceID void TxService::send_poll() const { - //LOG_DEBUG(F("Ack %02X"),ems_bus_id() ^ ems_mask()); + //LOG_DEBUG(("Ack %02X"),ems_bus_id() ^ ems_mask()); if (tx_mode()) { EMSuart::send_poll(ems_bus_id() ^ ems_mask()); } @@ -363,13 +363,13 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) { // if we're in simulation mode, don't send anything, just quit if (EMSESP::system_.readonly_mode() && (telegram->operation == Telegram::Operation::TX_WRITE)) { - LOG_INFO(F("[readonly] Sending write Tx telegram: %s"), Helpers::data_to_hex(telegram_raw, length - 1).c_str()); + LOG_INFO(("[readonly] Sending write Tx telegram: %s"), Helpers::data_to_hex(telegram_raw, length - 1).c_str()); tx_state(Telegram::Operation::NONE); return; } - LOG_DEBUG(F("Sending %s Tx [#%d], telegram: %s"), - (telegram->operation == Telegram::Operation::TX_WRITE) ? F("write") : F("read"), + LOG_DEBUG(("Sending %s Tx [#%d], telegram: %s"), + (telegram->operation == Telegram::Operation::TX_WRITE) ? ("write") : ("read"), tx_telegram.id_, Helpers::data_to_hex(telegram_raw, length - 1).c_str()); // exclude the last CRC byte @@ -381,7 +381,7 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) { uint16_t status = EMSuart::transmit(telegram_raw, length); if (status == EMS_TX_STATUS_ERR) { - LOG_ERROR(F("Failed to transmit Tx via UART.")); + LOG_ERROR(("Failed to transmit Tx via UART.")); if (telegram->operation == Telegram::Operation::TX_READ) { increment_telegram_read_fail_count(); // another Tx fail } else { @@ -412,7 +412,7 @@ void TxService::send_telegram(const uint8_t * data, const uint8_t length) { uint16_t status = EMSuart::transmit(telegram_raw, length); if (status == EMS_TX_STATUS_ERR) { - LOG_ERROR(F("Failed to transmit Tx via UART.")); + LOG_ERROR(("Failed to transmit Tx via UART.")); increment_telegram_fail_count(); // another Tx fail } } @@ -429,7 +429,7 @@ void TxService::add(const uint8_t operation, auto telegram = std::make_shared(operation, ems_bus_id(), dest, type_id, offset, message_data, message_length); #ifdef EMSESP_DEBUG - LOG_DEBUG(F("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length); + LOG_DEBUG(("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length); #endif // if the queue is full, make room but removing the last one @@ -488,7 +488,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt // if we don't have a type_id or empty data block, exit if ((type_id == 0) || (message_length == 0)) { #ifdef EMSESP_DEBUG - LOG_DEBUG(F("[DEBUG] Tx telegram type %d failed, length %d"), type_id, message_length); + LOG_DEBUG(("[DEBUG] Tx telegram type %d failed, length %d"), type_id, message_length); #endif return; } @@ -511,7 +511,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt } #ifdef EMSESP_DEBUG - LOG_DEBUG(F("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length); + LOG_DEBUG(("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length); #endif if (front) { @@ -528,7 +528,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt // send a Tx telegram to request data from an EMS device void TxService::read_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t length) { - LOG_DEBUG(F("Tx read request to device 0x%02X for type ID 0x%02X"), dest, type_id); + LOG_DEBUG(("Tx read request to device 0x%02X for type ID 0x%02X"), dest, type_id); uint8_t message_data = (type_id > 0xFF) ? (EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2) : EMS_MAX_TELEGRAM_MESSAGE_LENGTH; // if length set, publish result and set telegram to front @@ -593,7 +593,7 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui EMSESP::wait_validate(0); // do not wait for validation if (operation == Telegram::Operation::TX_READ) { if (telegram_last_->offset > 0) { // ignore errors for higher offsets - LOG_DEBUG(F("Last Tx Read operation failed after %d retries. Ignoring request: %s"), MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str()); + LOG_DEBUG(("Last Tx Read operation failed after %d retries. Ignoring request: %s"), MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str()); return; } increment_telegram_read_fail_count(); // another Tx fail @@ -601,8 +601,8 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui increment_telegram_write_fail_count(); // another Tx fail } - LOG_ERROR(F("Last Tx %s operation failed after %d retries. Ignoring request: %s"), - (operation == Telegram::Operation::TX_WRITE) ? F("Write") : F("Read"), + LOG_ERROR(("Last Tx %s operation failed after %d retries. Ignoring request: %s"), + (operation == Telegram::Operation::TX_WRITE) ? ("Write") : ("Read"), MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str()); @@ -613,8 +613,8 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui } #ifdef EMSESP_DEBUG - LOG_DEBUG(F("[DEBUG] Last Tx %s operation failed. Retry #%d. sent message: %s, received: %s"), - (operation == Telegram::Operation::TX_WRITE) ? F("Write") : F("Read"), + LOG_DEBUG(("[DEBUG] Last Tx %s operation failed. Retry #%d. sent message: %s, received: %s"), + (operation == Telegram::Operation::TX_WRITE) ? ("Write") : ("Read"), retry_count_, telegram_last_->to_string().c_str(), Helpers::data_to_hex(data, length - 1).c_str()); @@ -665,7 +665,7 @@ uint16_t TxService::post_send_query() { (this->telegram_last_->type_id > 0xFF) ? (EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2) : EMS_MAX_TELEGRAM_MESSAGE_LENGTH; // request all data, 32 bytes this->add(Telegram::Operation::TX_READ, dest, post_typeid, offset, &message_data, 1, 0, true); // add to top/front of queue // read_request(telegram_last_post_send_query_, dest, 0); // no offset - LOG_DEBUG(F("Sending post validate read, type ID 0x%02X to dest 0x%02X"), post_typeid, dest); + LOG_DEBUG(("Sending post validate read, type ID 0x%02X to dest 0x%02X"), post_typeid, dest); set_post_send_query(0); // reset // delay the request if we have a different type_id for post_send_query delayed_send_ = (this->telegram_last_->type_id == post_typeid) ? 0 : (uuid::get_uptime() + POST_SEND_DELAY); diff --git a/src/test/test.cpp b/src/test/test.cpp index 7652fff36..092a12ca0 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -30,7 +30,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "general") == 0) { - EMSESP::logger().info(F("Testing general. Adding a Boiler and Thermostat")); + EMSESP::logger().info(("Testing general. Adding a Boiler and Thermostat")); add_device(0x08, 123); // Nefit Trendline add_device(0x18, 157); // Bosch CR100 @@ -54,7 +54,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "2thermostats") == 0) { - EMSESP::logger().info(F("Testing with multiple thermostats...")); + EMSESP::logger().info(("Testing with multiple thermostats...")); add_device(0x08, 123); // GB072 add_device(0x10, 158); // RC310 @@ -86,7 +86,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "310") == 0) { - EMSESP::logger().info(F("Adding a GB072/RC310 combo...")); + EMSESP::logger().info(("Adding a GB072/RC310 combo...")); add_device(0x08, 123); // GB072 add_device(0x10, 158); // RC310 @@ -113,7 +113,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "gateway") == 0) { - EMSESP::logger().info(F("Adding a Gateway...")); + EMSESP::logger().info(("Adding a Gateway...")); // add 0x48 KM200, via a version command rx_telegram({0x48, 0x0B, 0x02, 0x00, 0xBD, 0x04, 0x06, 00, 00, 00, 00, 00, 00, 00}); @@ -133,7 +133,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "mixer") == 0) { - EMSESP::logger().info(F("Adding a mixer...")); + EMSESP::logger().info(("Adding a mixer...")); // add controller add_device(0x09, 114); @@ -155,7 +155,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "boiler") == 0) { - EMSESP::logger().info(F("Adding boiler...")); + EMSESP::logger().info(("Adding boiler...")); add_device(0x08, 123); // Nefit Trendline // UBAuptime @@ -172,7 +172,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "thermostat") == 0) { - EMSESP::logger().info(F("Adding thermostat...")); + EMSESP::logger().info(("Adding thermostat...")); add_device(0x10, 192); // FW120 @@ -185,7 +185,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "solar") == 0) { - EMSESP::logger().info(F("Adding solar...")); + EMSESP::logger().info(("Adding solar...")); add_device(0x30, 163); // SM100 @@ -204,7 +204,7 @@ bool Test::run_test(const char * command, int8_t id) { } if (strcmp(command, "heatpump") == 0) { - EMSESP::logger().info(F("Adding heatpump...")); + EMSESP::logger().info(("Adding heatpump...")); add_device(0x38, 200); // Enviline module add_device(0x10, 192); // FW120 thermostat @@ -238,7 +238,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "general") { - shell.printfln(F("Testing adding a general boiler & thermostat...")); + shell.printfln(("Testing adding a general boiler & thermostat...")); run_test("general"); shell.invoke_command("show devices"); shell.invoke_command("show"); @@ -247,7 +247,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "render") { - shell.printfln(F("Testing render...")); + shell.printfln(("Testing render...")); // check read_value to make sure it handles all the data type correctly uint8_t message_data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // message_length is 9 @@ -315,7 +315,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "devices") { - shell.printfln(F("Testing devices...")); + shell.printfln(("Testing devices...")); // A fake response - UBADevices(0x07) rx_telegram({0x08, 0x00, 0x07, 0x00, 0x0B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}); @@ -323,7 +323,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // check for boiler and controller on same product_id if (command == "double") { - shell.printfln(F("Testing double...")); + shell.printfln(("Testing double...")); add_device(0x08, 206); // Nefit Excellent HR30 add_device(0x09, 206); // Nefit Excellent HR30 Controller @@ -333,7 +333,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "620") { - EMSESP::logger().info(F("Testing 620...")); + EMSESP::logger().info(("Testing 620...")); // Version Controller uart_telegram({0x09, 0x0B, 0x02, 0x00, 0x5F, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}); @@ -344,7 +344,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // unknown device if (command == "unknown") { - shell.printfln(F("Testing unknown...")); + shell.printfln(("Testing unknown...")); // add boiler add_device(0x08, 84); @@ -361,19 +361,19 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "unknown2") { - shell.printfln(F("Testing unknown2...")); + shell.printfln(("Testing unknown2...")); // simulate getting version information back from an unknown device rx_telegram({0x09, 0x0B, 0x02, 0x00, 0x5A, 0x01, 0x02}); // productID is 90 which doesn't exist } if (command == "gateway") { - shell.printfln(F("Testing Gateway...")); + shell.printfln(("Testing Gateway...")); run_test("gateway"); } if (command == "310") { - shell.printfln(F("Testing RC310...")); + shell.printfln(("Testing RC310...")); run_test("310"); shell.invoke_command("show devices"); shell.invoke_command("show"); @@ -382,14 +382,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "2thermostats") { - shell.printfln(F("Testing multiple thermostats...")); + shell.printfln(("Testing multiple thermostats...")); run_test("2thermostats"); shell.invoke_command("show"); shell.invoke_command("show devices"); } if (command == "web") { - shell.printfln(F("Testing Web...")); + shell.printfln(("Testing Web...")); Mqtt::enabled(false); // turn off mqtt Mqtt::ha_enabled(false); // turn off ha @@ -438,7 +438,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "board_profile") { - shell.printfln(F("Testing board profile...")); + shell.printfln(("Testing board profile...")); shell.invoke_command("system"); shell.invoke_command("set board_profile wemos"); @@ -447,7 +447,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "boiler") { - shell.printfln(F("Testing boiler...")); + shell.printfln(("Testing boiler...")); // Mqtt::ha_enabled(false); Mqtt::ha_enabled(true); Mqtt::nested_format(1); @@ -475,7 +475,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "shower_alert") { - shell.printfln(F("Testing Shower Alert...")); + shell.printfln(("Testing Shower Alert...")); run_test("boiler"); @@ -484,7 +484,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "fr120") { - shell.printfln(F("Testing adding a thermostat FR120...")); + shell.printfln(("Testing adding a thermostat FR120...")); add_device(0x10, 191); // FR120 thermostat @@ -496,7 +496,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "ha") { - shell.printfln(F("Testing HA mqtt discovery")); + shell.printfln(("Testing HA mqtt discovery")); Mqtt::ha_enabled(true); // Mqtt::ha_enabled(false); @@ -518,7 +518,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "lastcode") { - shell.printfln(F("Testing lastcode")); + shell.printfln(("Testing lastcode")); Mqtt::ha_enabled(false); Mqtt::nested_format(1); @@ -536,7 +536,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "dv") { - shell.printfln(F("Testing device value rendering")); + shell.printfln(("Testing device value rendering")); Mqtt::ha_enabled(true); Mqtt::nested_format(1); @@ -550,12 +550,12 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "dallas") { - shell.printfln(F("Testing adding Dallas sensor")); + shell.printfln(("Testing adding Dallas sensor")); emsesp::EMSESP::dallassensor_.test(); } if (command == "dallas_full") { - shell.printfln(F("Testing adding and changing Dallas sensor")); + shell.printfln(("Testing adding and changing Dallas sensor")); Mqtt::ha_enabled(true); Mqtt::nested_format(1); // Mqtt::nested_format(0); @@ -571,7 +571,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "analog") { - shell.printfln(F("Testing adding Analog sensor")); + shell.printfln(("Testing adding Analog sensor")); Mqtt::ha_enabled(true); // Mqtt::ha_enabled(false); Mqtt::nested_format(1); @@ -597,12 +597,12 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // n=1 = EMSESP::system_.HEALTHCHECK_NO_BUS // n=2 = EMSESP::system_.HEALTHCHECK_NO_NETWORK - shell.printfln(F("Testing healthcheck with %d"), n); + shell.printfln(("Testing healthcheck with %d"), n); EMSESP::system_.healthcheck(n); } if (command == "masked") { - shell.printfln(F("Testing masked entities")); + shell.printfln(("Testing masked entities")); Mqtt::ha_enabled(true); Mqtt::send_response(false); @@ -626,7 +626,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "dv2") { - shell.printfln(F("Testing device value lost")); + shell.printfln(("Testing device value lost")); Mqtt::ha_enabled(true); Mqtt::send_response(false); @@ -647,7 +647,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const if (command == "api_values") { #if defined(EMSESP_STANDALONE) - shell.printfln(F("Testing API getting values")); + shell.printfln(("Testing API getting values")); Mqtt::ha_enabled(false); Mqtt::nested_format(1); Mqtt::send_response(false); @@ -680,7 +680,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "mqtt_post") { - shell.printfln(F("Testing MQTT incoming changes")); + shell.printfln(("Testing MQTT incoming changes")); Mqtt::ha_enabled(false); Mqtt::nested_format(1); Mqtt::send_response(false); @@ -696,7 +696,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const #if defined(EMSESP_STANDALONE) // https://github.com/emsesp/EMS-ESP32/issues/541 if (command == "api_wwmode") { - shell.printfln(F("Testing API wwmode")); + shell.printfln(("Testing API wwmode")); Mqtt::ha_enabled(false); Mqtt::nested_format(1); run_test("310"); @@ -715,7 +715,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const #endif if (command == "api") { - shell.printfln(F("Testing API with MQTT and REST, standalone")); + shell.printfln(("Testing API with MQTT and REST, standalone")); Mqtt::ha_enabled(true); // Mqtt::ha_enabled(false); @@ -990,7 +990,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "mqtt_nested") { - shell.printfln(F("Testing nested MQTT")); + shell.printfln(("Testing nested MQTT")); Mqtt::ha_enabled(false); // turn off HA Discovery to stop the chatter run_test("boiler"); @@ -1010,7 +1010,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "thermostat") { - shell.printfln(F("Testing adding a thermostat FW120...")); + shell.printfln(("Testing adding a thermostat FW120...")); run_test("thermostat"); shell.invoke_command("show"); @@ -1026,7 +1026,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "tc100") { - shell.printfln(F("Testing adding a TC100 thermostat to the EMS bus...")); + shell.printfln(("Testing adding a TC100 thermostat to the EMS bus...")); // add a thermostat add_device(0x18, 202); // Bosch TC100 - https://github.com/emsesp/EMS-ESP/issues/474 @@ -1037,7 +1037,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "solar") { - shell.printfln(F("Testing Solar")); + shell.printfln(("Testing Solar")); run_test("solar"); uart_telegram("30 00 FF 0A 02 6A 04"); // SM100 pump on (1)sh @@ -1050,14 +1050,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "heatpump") { - shell.printfln(F("Testing Heat Pump")); + shell.printfln(("Testing Heat Pump")); run_test("heatpump"); shell.invoke_command("call"); shell.invoke_command("call heatpump info"); } if (command == "solar200") { - shell.printfln(F("Testing Solar SM200")); + shell.printfln(("Testing Solar SM200")); add_device(0x30, 164); // SM200 @@ -1082,7 +1082,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "km") { - shell.printfln(F("Testing KM200 Gateway")); + shell.printfln(("Testing KM200 Gateway")); add_device(0x10, 158); // RC300 add_device(0x48, 189); // KM200 @@ -1140,7 +1140,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "cr100") { - shell.printfln(F("Testing CR100")); + shell.printfln(("Testing CR100")); add_device(0x18, 157); // Bosch CR100 - https://github.com/emsesp/EMS-ESP/issues/355 @@ -1165,14 +1165,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "rx2") { - shell.printfln(F("Testing Rx2...")); + shell.printfln(("Testing Rx2...")); for (uint8_t i = 0; i < 30; i++) { uart_telegram({0x08, 0x0B, 0x33, 0x00, 0x08, 0xFF, 0x34, 0xFB, 0x00, 0x28, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0x00}); } } if (command == "rx") { - shell.printfln(F("Testing Rx...")); + shell.printfln(("Testing Rx...")); // fake telegrams. length includes CRC // Boiler -> Me, UBAMonitorFast(0x18), telegram: 08 00 18 00 00 02 5A 73 3D 0A 10 65 40 02 1A 80 00 01 E1 01 76 0E 3D 48 00 C9 44 02 00 (#data=25) @@ -1229,7 +1229,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "tx") { - shell.printfln(F("Testing Tx...")); + shell.printfln(("Testing Tx...")); // TX queue example - Me -> Thermostat, (0x91), telegram: 0B 17 91 05 44 45 46 47 (#data=4) uint8_t t11[] = {0x44, 0x45, 0x46, 0x47}; @@ -1266,7 +1266,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "poll") { - shell.printfln(F("Testing Poll...")); + shell.printfln(("Testing Poll...")); // simulate sending a read request // uint8_t t16[] = {0x44, 0x45, 0x46, 0x47}; // Me -> Thermostat, (0x91), telegram: 0B 17 91 05 44 45 46 47 (#data=4) @@ -1291,7 +1291,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "cmd") { - shell.printfln(F("Testing Commands...")); + shell.printfln(("Testing Commands...")); // add a thermostat with 3 HCs add_device(0x10, 192); // FW120 @@ -1318,13 +1318,13 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "pin") { - shell.printfln(F("Testing pin...")); + shell.printfln(("Testing pin...")); shell.invoke_command("call system pin"); shell.invoke_command("call system pin 1 true"); } if (command == "mqtt2") { - shell.printfln(F("Testing MQTT large payloads...")); + shell.printfln(("Testing MQTT large payloads...")); DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN); @@ -1339,15 +1339,15 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } doc.shrinkToFit(); JsonObject jo = doc.as(); - shell.printfln(F("Size of JSON payload = %d"), jo.memoryUsage()); - shell.printfln(F("Length of JSON payload = %d"), measureJson(jo)); + shell.printfln(("Size of JSON payload = %d"), jo.memoryUsage()); + shell.printfln(("Length of JSON payload = %d"), measureJson(jo)); Mqtt::publish("test", jo); Mqtt::show_mqtt(shell); // show queue } if (command == "mqtt") { - shell.printfln(F("Testing MQTT...")); + shell.printfln(("Testing MQTT...")); Mqtt::ha_enabled(false); Mqtt::enabled(true); @@ -1422,7 +1422,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "poll2") { - shell.printfln(F("Testing Tx Sending last message on queue...")); + shell.printfln(("Testing Tx Sending last message on queue...")); EMSESP::show_ems(shell); @@ -1433,7 +1433,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "rx2") { - shell.printfln(F("Testing rx2...")); + shell.printfln(("Testing rx2...")); uart_telegram({0x1B, 0x5B, 0xFD, 0x2D, 0x9E, 0x3A, 0xB6, 0xE5, 0x02, 0x20, 0x33, 0x30, 0x32, 0x3A, 0x20, 0x5B, 0x73, 0xFF, 0xFF, 0xCB, 0xDF, 0xB7, 0xA7, 0xB5, 0x67, 0x77, 0x77, 0xE4, 0xFF, 0xFD, 0x77, 0xFF}); @@ -1441,14 +1441,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // https://github.com/emsesp/EMS-ESP/issues/380#issuecomment-633663007 if (command == "rx3") { - shell.printfln(F("Testing rx3...")); + shell.printfln(("Testing rx3...")); uart_telegram({0x21, 0x0B, 0xFF, 0x00}); } // testing the UART tx command, without a queue if (command == "tx2") { - shell.printfln(F("Testing tx2...")); + shell.printfln(("Testing tx2...")); uint8_t t[] = {0x0B, 0x88, 0x18, 0x00, 0x20, 0xD4}; // including CRC EMSuart::transmit(t, sizeof(t)); @@ -1456,14 +1456,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // send read request with offset if (command == "offset") { - shell.printfln(F("Testing offset...")); + shell.printfln(("Testing offset...")); // send_read_request(0x18, 0x08); EMSESP::txservice_.read_request(0x18, 0x08, 27); // no offset } if (command == "mixer") { - shell.printfln(F("Testing Mixer...")); + shell.printfln(("Testing Mixer...")); run_test("mixer"); @@ -1477,13 +1477,13 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const } if (command == "crash") { - shell.printfln(F("Forcing a crash...")); + shell.printfln(("Forcing a crash...")); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdiv-by-zero" #pragma GCC diagnostic ignored "-Wunused-variable" uint8_t a = 2 / 0; - shell.printfln(F("Testing %s"), a); + shell.printfln(("Testing %s"), a); #pragma GCC diagnostic pop } diff --git a/src/web/WebAPIService.cpp b/src/web/WebAPIService.cpp index 0ae29df9b..b0e48b233 100644 --- a/src/web/WebAPIService.cpp +++ b/src/web/WebAPIService.cpp @@ -117,7 +117,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) { emsesp::EMSESP::logger().err(error); api_fails_++; } else { - // emsesp::EMSESP::logger().debug(F("API command called successfully")); + // emsesp::EMSESP::logger().debug(("API command called successfully")); // if there was no json output from the call, default to the output message 'OK'. if (!output.size()) { output["message"] = "OK"; diff --git a/src/web/WebDataService.cpp b/src/web/WebDataService.cpp index 847990edf..38c1146d7 100644 --- a/src/web/WebDataService.cpp +++ b/src/web/WebDataService.cpp @@ -236,9 +236,9 @@ void WebDataService::write_value(AsyncWebServerRequest * request, JsonVariant & // write debug if (return_code != CommandRet::OK) { - EMSESP::logger().err(F("Write command failed %s (%s)"), (const char *)output["message"], Command::return_code_string(return_code).c_str()); + EMSESP::logger().err(("Write command failed %s (%s)"), (const char *)output["message"], Command::return_code_string(return_code).c_str()); } else { - EMSESP::logger().debug(F("Write command successful")); + EMSESP::logger().debug(("Write command successful")); } response->setCode((return_code == CommandRet::OK) ? 200 : 204); diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index e85eb8ccd..4a1ae6352 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -34,13 +34,13 @@ WebStatusService::WebStatusService(AsyncWebServer * server, SecurityManager * se void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { switch (event) { case ARDUINO_EVENT_WIFI_STA_DISCONNECTED: - EMSESP::logger().warning(F("WiFi disconnected. Reason code=%d"), info.wifi_sta_disconnected.reason); // IDF 4.0 + EMSESP::logger().warning(("WiFi disconnected. Reason code=%d"), info.wifi_sta_disconnected.reason); // IDF 4.0 WiFi.disconnect(true); break; case ARDUINO_EVENT_WIFI_STA_GOT_IP: #ifndef EMSESP_STANDALONE - EMSESP::logger().info(F("WiFi connected with IP=%s, hostname=%s"), WiFi.localIP().toString().c_str(), WiFi.getHostname()); + EMSESP::logger().info(("WiFi connected with IP=%s, hostname=%s"), WiFi.localIP().toString().c_str(), WiFi.getHostname()); #endif // EMSESP::system_.send_heartbeat(); // send from mqtt start EMSESP::system_.syslog_init(); @@ -48,7 +48,7 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { break; case ARDUINO_EVENT_ETH_START: - // EMSESP::logger().info(F("Ethernet initialized")); + // EMSESP::logger().info(("Ethernet initialized")); ETH.setHostname(EMSESP::system_.hostname().c_str()); // configure for static IP @@ -64,7 +64,7 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { // prevent double calls if (!EMSESP::system_.ethernet_connected()) { #ifndef EMSESP_STANDALONE - EMSESP::logger().info(F("Ethernet connected with IP=%s, speed %d Mbps"), ETH.localIP().toString().c_str(), ETH.linkSpeed()); + EMSESP::logger().info(("Ethernet connected with IP=%s, speed %d Mbps"), ETH.localIP().toString().c_str(), ETH.linkSpeed()); #endif // EMSESP::system_.send_heartbeat(); EMSESP::system_.syslog_init(); @@ -74,12 +74,12 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { break; case ARDUINO_EVENT_ETH_DISCONNECTED: - EMSESP::logger().warning(F("Ethernet disconnected")); + EMSESP::logger().warning(("Ethernet disconnected")); EMSESP::system_.ethernet_connected(false); break; case ARDUINO_EVENT_ETH_STOP: - EMSESP::logger().info(F("Ethernet stopped")); + EMSESP::logger().info(("Ethernet stopped")); EMSESP::system_.ethernet_connected(false); break; @@ -103,9 +103,9 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { case ARDUINO_EVENT_WIFI_STA_GOT_IP6: case ARDUINO_EVENT_ETH_GOT_IP6: if (EMSESP::system_.ethernet_connected()) { - EMSESP::logger().info(F("Ethernet connected with IPv6=%s, speed %d Mbps"), ETH.localIPv6().toString().c_str(), ETH.linkSpeed()); + EMSESP::logger().info(("Ethernet connected with IPv6=%s, speed %d Mbps"), ETH.localIPv6().toString().c_str(), ETH.linkSpeed()); } else { - EMSESP::logger().info(F("WiFi connected with IPv6=%s, hostname=%s"), WiFi.localIPv6().toString().c_str(), WiFi.getHostname()); + EMSESP::logger().info(("WiFi connected with IPv6=%s, hostname=%s"), WiFi.localIPv6().toString().c_str(), WiFi.getHostname()); } // EMSESP::system_.send_heartbeat(); EMSESP::system_.syslog_init(); @@ -202,7 +202,7 @@ void WebStatusService::mDNS_start() const { EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) { if (networkSettings.enableMDNS) { if (!MDNS.begin(EMSESP::system_.hostname().c_str())) { - EMSESP::logger().warning(F("Failed to start mDNS responder service")); + EMSESP::logger().warning(("Failed to start mDNS responder service")); return; } @@ -214,13 +214,13 @@ void WebStatusService::mDNS_start() const { MDNS.addServiceTxt("http", "tcp", "version", EMSESP_APP_VERSION); MDNS.addServiceTxt("http", "tcp", "address", address_s.c_str()); - EMSESP::logger().info(F("mDNS responder service started")); + EMSESP::logger().info(("mDNS responder service started")); } }); #else EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) { if (networkSettings.enableMDNS) { - EMSESP::logger().info(F("mDNS responder service started")); + EMSESP::logger().info(("mDNS responder service started")); } }); #endif