replace deprecated hexencode (#2240)

This commit is contained in:
Samuel Sieb 2022-10-24 16:06:07 -07:00 committed by GitHub
parent 1dad7e4a57
commit 444ca70937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ nearby COVID-19 exposure notification bluetooth messages sent by phones running
then: then:
- lambda: | - lambda: |
ESP_LOGD("main", "Got notification:"); ESP_LOGD("main", "Got notification:");
ESP_LOGD("main", " RPI: %s", hexencode(x.rolling_proximity_identifier).c_str()); ESP_LOGD("main", " RPI: %s", format_hex_pretty(x.rolling_proximity_identifier).c_str());
ESP_LOGD("main", " RSSI: %d", x.rssi); ESP_LOGD("main", " RSSI: %d", x.rssi);
Configuration variables: Configuration variables:
@ -67,7 +67,7 @@ minute, the indicator will be on.
then: then:
- lambda: | - lambda: |
ESP_LOGD("main", "Got notification:"); ESP_LOGD("main", "Got notification:");
ESP_LOGD("main", " RPI: %s", hexencode(x.rolling_proximity_identifier).c_str()); ESP_LOGD("main", " RPI: %s", format_hex_pretty(x.rolling_proximity_identifier).c_str());
ESP_LOGD("main", " RSSI: %d", x.rssi); ESP_LOGD("main", " RSSI: %d", x.rssi);
# Stop existing timer so that turn_off doesn't get called # Stop existing timer so that turn_off doesn't get called

View File

@ -107,7 +107,7 @@ The type of ``x`` variable is depending on ``datapoint_type`` configuration vari
datapoint_type: raw datapoint_type: raw
then: then:
- lambda: |- - lambda: |-
ESP_LOGD("main", "on_datapoint_update %s", hexencode(x).c_str()); ESP_LOGD("main", "on_datapoint_update %s", format_hex_pretty(x).c_str());
id(voltage).publish_state((x[0] << 8 | x[1]) * 0.1); id(voltage).publish_state((x[0] << 8 | x[1]) * 0.1);
id(current).publish_state((x[3] << 8 | x[4]) * 0.001); id(current).publish_state((x[3] << 8 | x[4]) * 0.001);
id(power).publish_state((x[6] << 8 | x[7]) * 0.1); id(power).publish_state((x[6] << 8 | x[7]) * 0.1);
@ -126,7 +126,7 @@ The type of ``x`` variable is depending on ``datapoint_type`` configuration vari
then: then:
- lambda: |- - lambda: |-
if (x.type == tuya::TuyaDatapointType::RAW) { if (x.type == tuya::TuyaDatapointType::RAW) {
ESP_LOGD("main", "on_datapoint_update %s", hexencode(x.value_raw).c_str()); ESP_LOGD("main", "on_datapoint_update %s", format_hex_pretty(x.value_raw).c_str());
} else { } else {
ESP_LOGD("main", "on_datapoint_update %hhu", x.type); ESP_LOGD("main", "on_datapoint_update %hhu", x.type);
} }