mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-25 17:17:54 +01:00
replace deprecated hexencode (#2240)
This commit is contained in:
parent
1dad7e4a57
commit
444ca70937
@ -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
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user