From e22b191a48765bf789d92a831bb5eef8e0e5bad7 Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 24 Jul 2021 11:56:39 +0200 Subject: [PATCH] comments, fix typos, prep for v3.2 --- src/command.h | 12 ++++++------ src/devices/boiler.cpp | 5 +---- src/devices/boiler.h | 2 +- src/devices/solar.cpp | 2 +- src/devices/solar.h | 2 +- src/emsdevice.cpp | 2 +- src/system.cpp | 2 +- src/system.h | 2 +- src/version.h | 2 +- 9 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/command.h b/src/command.h index c68a6fd7b..653758ff7 100644 --- a/src/command.h +++ b/src/command.h @@ -45,13 +45,13 @@ enum CommandFlag : uint8_t { }; -// returns 0 if the command errored, 1 (TRUE) if ok, 2 if not found, 3 if error or 4 if not allowed -enum CommandRet: uint8_t { +// return status after calling a Command +enum CommandRet : uint8_t { ERRORED = 0, - OK, - NOT_FOUND, - ERROR, - NOT_ALLOWED + OK, // 1 or TRUE + NOT_FOUND, // 2 + ERROR, // 3 + NOT_ALLOWED // needs authentication }; diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index b5e216e66..538ef90e8 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -468,9 +468,6 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr telegram 17)); // can be 0 if no sensor, handled in export_values has_update(telegram->read_value(sysPress_, 21)); - //has_update(telegram->read_value(temperatur_, 13)); // unknown temperature - //has_update(telegram->read_value(temperatur_, 27)); // unknown temperature - // read 3 char service code / installation status as appears on the display if ((telegram->message_length > 3) && (telegram->offset == 0)) { serviceCode_[0] = (serviceCode_[0] == '~') ? 0xF0 : serviceCode_[0]; @@ -540,7 +537,7 @@ void Boiler::process_UBAMonitorSlowPlus(std::shared_ptr telegram /* * UBAParametersPlus - type 0xE6 - * parameters originaly taken from + * parameters originally taken from * https://github.com/Th3M3/buderus_ems-wiki/blob/master/Einstellungen%20des%20Regelger%C3%A4ts%20MC110.md * 88 0B E6 00 01 46 00 00 46 0A 00 01 06 FA 0A 01 02 64 01 00 00 1E 00 3C 01 00 00 00 01 00 9A * from: issue #732 diff --git a/src/devices/boiler.h b/src/devices/boiler.h index f2ed15c0d..766e7ebd8 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -49,7 +49,7 @@ class Boiler : public EMSdevice { static constexpr uint8_t EMS_TYPE_UBAParameters = 0x16; static constexpr uint8_t EMS_TYPE_UBAParametersPlus = 0xE6; static constexpr uint8_t EMS_TYPE_UBAParameterWWPlus = 0xEA; - static constexpr uint16_t EMS_TYPE_UBAInfomration = 0x495; + static constexpr uint16_t EMS_TYPE_UBAInformation = 0x495; static constexpr uint16_t EMS_TYPE_UBAEnergySupplied = 0x494; static constexpr uint8_t EMS_BOILER_SELFLOWTEMP_HEATING = 20; // was originally 70, changed to 30 for issue #193, then to 20 with issue #344 diff --git a/src/devices/solar.cpp b/src/devices/solar.cpp index 96020aa2d..2339c61c8 100644 --- a/src/devices/solar.cpp +++ b/src/devices/solar.cpp @@ -340,7 +340,7 @@ void Solar::process_SM100Monitor(std::shared_ptr telegram) { has_update(telegram->read_value(heatExchangerTemp_, 20)); // is *10 - TS6: Heat exchanger temperature sensor } -// SM100wwTemperatur - 0x07D6 +// SM100wwTemperature - 0x07D6 // Solar Module(0x2A) -> (0x00), (0x7D6), data: 01 C1 00 00 02 5B 01 AF 01 AD 80 00 01 90 void Solar::process_SM100wwTemperature(std::shared_ptr telegram) { has_update(telegram->read_value(wwTemp_1_, 0)); diff --git a/src/devices/solar.h b/src/devices/solar.h index 502cd249e..b0a68d0ea 100644 --- a/src/devices/solar.h +++ b/src/devices/solar.h @@ -87,7 +87,7 @@ class Solar : public EMSdevice { // SM10Config - 0x96 uint8_t wwMinTemp_; - uint8_t maxFlow_; // set this to caltulate power + uint8_t maxFlow_; // set this to calculate power uint32_t solarPower_; // calculated from maxFlow std::deque energy; diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 6762abad3..e36e04594 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -989,7 +989,7 @@ void EMSdevice::publish_mqtt_ha_sensor() { void EMSdevice::ha_config_clear() { for (auto & dv : devicevalues_) { - // dv.ha &= ~DeviceValueHA::HA_DONE; // repubish all with values + // dv.ha &= ~DeviceValueHA::HA_DONE; // republish all with values dv.ha = DeviceValueHA::HA_NONE; // also wait for new value } ha_config_done(false); diff --git a/src/system.cpp b/src/system.cpp index e20124b18..42a4719a4 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -511,7 +511,7 @@ void System::measure_analog() { if (!measure_last_ || (uint32_t)(uuid::get_uptime() - measure_last_) >= SYSTEM_MEASURE_ANALOG_INTERVAL) { measure_last_ = uuid::get_uptime(); #if defined(ESP32) - uint16_t a = analogRead(36); + uint16_t a = analogRead(ADC_CH0_GPIO); #else uint16_t a = 0; // standalone #endif diff --git a/src/system.h b/src/system.h index 300baec68..74cce4a7e 100644 --- a/src/system.h +++ b/src/system.h @@ -113,7 +113,6 @@ class System { bool network_connected() { #ifndef EMSESP_STANDALONE - // return (ethernet_connected_ || WiFi.isConnected()); return network_connected_; #else return true; @@ -144,6 +143,7 @@ class System { static constexpr uint32_t SYSTEM_HEARTBEAT_INTERVAL = 60000; // in milliseconds, how often the MQTT heartbeat is sent (1 min) static constexpr uint32_t SYSTEM_MEASURE_ANALOG_INTERVAL = 500; static constexpr uint8_t LED_ON = HIGH; // LED + static constexpr uint8_t ADC_CH0_GPIO = 36; #ifndef EMSESP_STANDALONE static uuid::syslog::SyslogService syslog_; diff --git a/src/version.h b/src/version.h index 141b1482d..838811571 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.1.2b6" +#define EMSESP_APP_VERSION "3.2.0b0"