Skip to content

Commit

Permalink
Merge pull request #2150 from proddy/dev
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
proddy authored Oct 28, 2024
2 parents 65e0ae1 + a41ded6 commit fcf8432
Show file tree
Hide file tree
Showing 15 changed files with 10,313 additions and 10,400 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Changelog

For more details go to [www.emsesp.org](https://www.emsesp.org/).

## [3.7.1]

## **IMPORTANT! BREAKING CHANGES with 3.7.0**

For more details go to [www.emsesp.org](https://www.emsesp.org/).

## Added

- Include HA "unit_of_meas", "stat_cla" and "dev_cla" attributes for Number sensors [#2149](https://github.com/emsesp/EMS-ESP32/issues/2149)

## Fixed

- Modbus integration in 3.7.0 missing offset [#2148](https://github.com/emsesp/EMS-ESP32/issues/2148)

## Changed
10,196 changes: 5,098 additions & 5,098 deletions docs/Modbus-Entity-Registers.md

Large diffs are not rendered by default.

10,196 changes: 5,098 additions & 5,098 deletions dump_entities.csv → docs/dump_entities.csv

Large diffs are not rendered by default.

File renamed without changes.
9 changes: 0 additions & 9 deletions scripts/dump_entities.sh

This file was deleted.

9 changes: 0 additions & 9 deletions scripts/dump_telegrams.sh

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/generate-modbus-register-doc.sh

This file was deleted.

30 changes: 17 additions & 13 deletions scripts/generate_csv_and_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,24 @@ EOL
make clean
make ARGS=-DEMSESP_STANDALONE

# Generate Modbus entity parameters
# One to build the modbus_entity_parameters.hpp header file
# And then run entity_dump test again to create the dump_entities.csv file with the correct modbus counts
rm -f ./src/modbus_entity_parameters.hpp
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py | python3 ./scripts/update_modbus_registers.py >./src/modbus_entity_parameters.hpp
ls -al ./src/modbus_entity_parameters.hpp

# dump_entities.csv
rm -f dump_entities.csv
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py >dump_entities.csv
ls -al dump_entities.csv
make ARGS=-DEMSESP_STANDALONE
rm -f ./docs/dump_entities.csv
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py >./docs/dump_entities.csv
ls -al ./docs/dump_entities.csv

# dump_telegrams.csv
rm -f dump_telegrams.csv
echo "test telegram_dump" | ./emsesp | python3 ./scripts/strip_csv.py >dump_telegrams.csv
ls -al dump_telegrams.csv

# generate ./src/modbus_entity_parameters.hpp
rm -f ./src/modbus_entity_parameters.hpp
cat dump_entities.csv | python3 ./scripts/update_modbus_registers.py >./src/modbus_entity_parameters.hpp
ls -al ./src/modbus_entity_parameters.hpp
rm -f ./docs/dump_telegrams.csv
echo "test telegram_dump" | ./emsesp | python3 ./scripts/strip_csv.py >./docs/dump_telegrams.csv
ls -al ./docs/dump_telegrams.csv

# generate doc - Modbus-Entity-Registers.md used in the emsesp.org documentation.
cat dump_entities.csv | python3 ./scripts/generate-modbus-register-doc.py >./docs/Modbus-Entity-Registers.md
# generate doc - Modbus-Entity-Registers.md used in the emsesp.org documentation
rm -f ./docs/Modbus-Entity-Registers.md
cat ./docs/dump_entities.csv | python3 ./scripts/generate-modbus-register-doc.py >./docs/Modbus-Entity-Registers.md
Binary file removed scripts/partitions.bin
Binary file not shown.
64 changes: 0 additions & 64 deletions scripts/update_modbus_registers.sh

This file was deleted.

9 changes: 7 additions & 2 deletions src/emsdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1982,9 +1982,14 @@ void EMSdevice::read_command(const uint16_t type_id, const uint8_t offset, const
// returns either default or custom name
std::string EMSdevice::name() {
if (custom_name_.empty()) {
return default_name_;
// return default name prefixed with a model if exists
if (model().empty()) {
return default_name();
}
return model() + "/" + default_name();
}
return custom_name_;

return custom_name();
}

// copy a raw value (i.e. without applying the numeric_operator) to the output buffer.
Expand Down
Loading

0 comments on commit fcf8432

Please sign in to comment.