rename dump functions

This commit is contained in:
proddy
2024-11-07 21:29:14 +01:00
parent e7334a2492
commit fdf7ab1aa7
4 changed files with 9 additions and 12 deletions

View File

@@ -1271,7 +1271,7 @@ void EMSdevice::getCustomizationEntities(std::vector<std::string> & entity_ids)
// pipe symbols (|) are escaped so they can be converted to Markdown in the Wiki // pipe symbols (|) are escaped so they can be converted to Markdown in the Wiki
// format is: device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4, discovery entityid // format is: device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4, discovery entityid
#if defined(EMSESP_STANDALONE) #if defined(EMSESP_STANDALONE)
void EMSdevice::dump_value_info() { void EMSdevice::dump_devicevalue_info() {
for (auto & dv : devicevalues_) { for (auto & dv : devicevalues_) {
if (dv.fullname != nullptr) { if (dv.fullname != nullptr) {
Serial.print('\"'); Serial.print('\"');
@@ -1287,7 +1287,7 @@ void EMSdevice::dump_value_info() {
Serial.print(dv.short_name); Serial.print(dv.short_name);
Serial.print(','); Serial.print(',');
Serial.print(dv.fullname[0]); Serial.print(dv.fullname[0]); // TODO why german?
Serial.print(','); Serial.print(',');
// per type // per type
@@ -1438,8 +1438,6 @@ void EMSdevice::dump_value_info() {
Serial.print(","); Serial.print(",");
// modbus specific infos // modbus specific infos
Serial.print(device_type()); Serial.print(device_type());
Serial.print(','); Serial.print(',');

View File

@@ -483,7 +483,7 @@ class EMSdevice {
} }
}; };
void dump_telegram_info(std::vector<TelegramFunctionDump> & telegram_functions_dump); void dump_telegram_info(std::vector<TelegramFunctionDump> & telegram_functions_dump);
void dump_value_info(); void dump_devicevalue_info();
#endif #endif
private: private:
@@ -518,13 +518,12 @@ class EMSdevice {
} }
}; };
std::vector<TelegramFunction> telegram_functions_; // each EMS device has its own set of registered telegram types
std::vector<uint16_t> handlers_ignored_; std::vector<uint16_t> handlers_ignored_;
#if defined(EMSESP_STANDALONE) || defined(EMSESP_TEST) #if defined(EMSESP_STANDALONE) || defined(EMSESP_TEST)
public: // so we can call it from WebCustomizationService::test() public: // so we can call it from WebCustomizationService::test() and EMSESP::dump_all_entities()
#endif #endif
std::vector<TelegramFunction> telegram_functions_; // each EMS device has its own set of registered telegram types
std::vector<DeviceValue> devicevalues_; // all the device values std::vector<DeviceValue> devicevalues_; // all the device values
}; };

View File

@@ -332,7 +332,7 @@ void EMSESP::show_ems(uuid::console::Shell & shell) {
// Dump all entities to Serial out // Dump all entities to Serial out
// this is intended to run within the OS with lots of available memory! // this is intended to run within the OS with lots of available memory!
#if defined(EMSESP_STANDALONE) #if defined(EMSESP_STANDALONE)
void EMSESP::dump_all_values(uuid::console::Shell & shell) { void EMSESP::dump_all_entities(uuid::console::Shell & shell) {
Serial.println("---- CSV START ----"); // marker use by py script Serial.println("---- CSV START ----"); // marker use by py script
// add header for CSV // add header for CSV
Serial.println("device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4,discovery " Serial.println("device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4,discovery "
@@ -361,7 +361,7 @@ void EMSESP::dump_all_values(uuid::console::Shell & shell) {
// for testing the mixer use ... if (device.product_id == 69) { // for testing the mixer use ... if (device.product_id == 69) {
emsdevices.push_back( emsdevices.push_back(
EMSFactory::add(device.device_type, device_id, device.product_id, "1.0", device.default_name, device.flags, EMSdevice::Brand::NO_BRAND)); EMSFactory::add(device.device_type, device_id, device.product_id, "1.0", device.default_name, device.flags, EMSdevice::Brand::NO_BRAND));
emsdevices.back()->dump_value_info(); emsdevices.back()->dump_devicevalue_info();
} }
} }
} }

View File

@@ -442,7 +442,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
if (command == "entity_dump") { if (command == "entity_dump") {
System::test_set_all_active(true); System::test_set_all_active(true);
EMSESP::dump_all_values(shell); EMSESP::dump_all_entities(shell);
ok = true; ok = true;
} }