1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-28 05:33:53 +00:00

Introduce hex parsing & formatting helper functions (#2882)

This commit is contained in:
Oxan van Leeuwen
2021-12-12 21:15:23 +01:00
committed by GitHub
parent b2f05faee0
commit beeb0c7c5a
20 changed files with 186 additions and 109 deletions

View File

@@ -61,7 +61,7 @@ void ModbusSwitch::write_state(bool state) {
}
}
if (!data.empty()) {
ESP_LOGV(TAG, "Modbus Switch write raw: %s", hexencode(data).c_str());
ESP_LOGV(TAG, "Modbus Switch write raw: %s", format_hex_pretty(data).c_str());
cmd = ModbusCommandItem::create_custom_command(
this->parent_, data,
[this, cmd](ModbusRegisterType register_type, uint16_t start_address, const std::vector<uint8_t> &data) {