mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
show device info on Web
This commit is contained in:
@@ -127,7 +127,7 @@ uint8_t EMSdevice::decode_brand(uint8_t value) {
|
||||
}
|
||||
}
|
||||
|
||||
// print human friendly description of the EMS device
|
||||
// returns string of a human friendly description of the EMS device
|
||||
std::string EMSdevice::to_string() const {
|
||||
std::string str(160, '\0');
|
||||
|
||||
@@ -153,6 +153,17 @@ std::string EMSdevice::to_string() const {
|
||||
return str;
|
||||
}
|
||||
|
||||
// returns out brand + device name
|
||||
std::string EMSdevice::to_string_short() const {
|
||||
std::string str(160, '\0');
|
||||
if (brand_ == Brand::NO_BRAND) {
|
||||
snprintf_P(&str[0], str.capacity() + 1, PSTR("%s: %s"), device_type_name().c_str(), name_.c_str());
|
||||
} else {
|
||||
snprintf_P(&str[0], str.capacity() + 1, PSTR("%s: %s %s"), device_type_name().c_str(), brand_to_string().c_str(), name_.c_str());
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// prints the header for the section
|
||||
void EMSdevice::show_values(uuid::console::Shell & shell) {
|
||||
shell.printfln(F("%s: %s"), device_type_name().c_str(), to_string().c_str());
|
||||
|
||||
Reference in New Issue
Block a user