Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Dec 30, 2022
2 parents b728827 + 2db99a3 commit 275ac35
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 169 deletions.
2 changes: 1 addition & 1 deletion pio_local.ini_example
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extra_scripts =
; options for debugging are: EMSESP_DEBUG EMSESP_UART_DEBUG EMSESP_DEBUG_SENSOR
[env:debug]
board = esp32dev
platform = espressif32
platform = espressif32@5.2.0
board_build.partitions = esp32_partition_debug.csv
upload_protocol = esptool
build_type = debug
Expand Down
12 changes: 6 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ check_flags =
[env:ci]
extra_scripts = scripts/rename_fw.py
board = esp32dev
platform = espressif32
platform = espressif32@5.2.0
board_build.partitions = esp32_partition_4M.csv
board_build.filesystem = littlefs
build_flags = ${common.build_flags}
Expand All @@ -67,7 +67,7 @@ extra_scripts =
pre:scripts/build_interface.py
scripts/rename_fw.py
board = esp32dev
platform = espressif32
platform = espressif32@5.2.0
board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags}
Expand All @@ -78,7 +78,7 @@ extra_scripts =
pre:scripts/build_interface.py
scripts/rename_fw.py
board = esp32dev
platform = espressif32
platform = espressif32@5.2.0
board_upload.flash_size = 16MB
board_build.partitions = esp32_partition_16M.csv
build_flags = ${common.build_flags}
Expand All @@ -89,7 +89,7 @@ extra_scripts =
pre:scripts/build_interface.py
scripts/rename_fw.py
board = lolin_c3_mini
platform = espressif32
platform = espressif32@5.2.0
board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags}
Expand All @@ -102,7 +102,7 @@ extra_scripts =
pre:scripts/build_interface.py
scripts/rename_fw.py
board = lolin_c3_mini
platform = espressif32
platform = espressif32@5.2.0
board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags} -DBOARD_C3_MINI_V1
Expand All @@ -113,7 +113,7 @@ extra_scripts =
pre:scripts/build_interface.py
scripts/rename_fw.py
board = lolin_s2_mini
platform = espressif32
platform = espressif32@5.2.0
board_upload.flash_size = 4MB
board_build.partitions = esp32_partition_4M.csv
build_flags = ${common.build_flags}
Expand Down
1 change: 1 addition & 0 deletions src/devices/boiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
99);
}
*/

// heatpump info
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
Expand Down
12 changes: 10 additions & 2 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ uuid::log::Logger Thermostat::logger_{F_(thermostat), uuid::log::Facility::CONSO

Thermostat::Thermostat(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) {
uint8_t model = this->model();

// 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, "RFTemp", false, MAKE_PF_CB(process_RemoteTemp));
Expand All @@ -48,6 +46,9 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
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));

uint8_t model = this->model();

// RC10
if (model == EMSdevice::EMS_DEVICE_FLAG_RC10) {
monitor_typeids = {0xB1};
Expand Down Expand Up @@ -3384,6 +3385,7 @@ void Thermostat::register_device_values() {
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &errorCode_, DeviceValueType::STRING, FL_(errorCode), DeviceValueUOM::NONE);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &lastCode_, DeviceValueType::STRING, FL_(lastCode), DeviceValueUOM::NONE);


switch (this->model()) {
case EMS_DEVICE_FLAG_RC100:
case EMS_DEVICE_FLAG_RC300:
Expand Down Expand Up @@ -4008,6 +4010,11 @@ void Thermostat::register_device_values() {
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE); // can't set datetime
break;
}

#if defined(EMSESP_STANDALONE_DUMP)
// if we're just dumping out values, create a single dummy hc
register_device_values_hc(std::make_shared<emsesp::Thermostat::HeatingCircuit>(1, this->model())); // hc=1
#endif
}

// registers the values for a heating circuit
Expand All @@ -4031,6 +4038,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
seltemp_divider = DeviceValueNumOp::DV_NUMOP_DIV2;
roomtemp_divider = DeviceValueNumOp::DV_NUMOP_DIV10;
}

if (has_flags(EMS_DEVICE_FLAG_NO_WRITE)) {
register_device_value(tag, &hc->selTemp, DeviceValueType::SHORT, seltemp_divider, FL_(selRoomTemp), DeviceValueUOM::DEGREES);
} else {
Expand Down
Loading

0 comments on commit 275ac35

Please sign in to comment.