mirror of
https://github.com/syssi/esphome-votronic.git
synced 2025-07-22 12:10:34 +02:00
Rename uart0 to uart_0 (#37)
This commit is contained in:
committed by
GitHub
parent
3022e2184c
commit
c8b4959c63
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@@ -125,6 +125,8 @@ jobs:
|
||||
git commit -a -m "Add external component"
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
||||
- name: Add missing requirements
|
||||
run: pip3 install setuptools wheel
|
||||
- name: Set up python environment
|
||||
run: VIRTUAL_ENV=false script/setup
|
||||
working-directory: ${{ env.esphome_directory }}
|
||||
|
@@ -337,18 +337,18 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) {
|
||||
case 0xD: // int12.
|
||||
case 0xE: // int16.
|
||||
if (length > 2) {
|
||||
return (float) ((int16_t)(value[1] << 8) + (int16_t) value[2]);
|
||||
return (float) ((int16_t) (value[1] << 8) + (int16_t) value[2]);
|
||||
}
|
||||
// fall through
|
||||
case 0xF: // int24.
|
||||
if (length > 3) {
|
||||
return (float) ((int32_t)(value[1] << 16) + (int32_t)(value[2] << 8) + (int32_t)(value[3]));
|
||||
return (float) ((int32_t) (value[1] << 16) + (int32_t) (value[2] << 8) + (int32_t) (value[3]));
|
||||
}
|
||||
// fall through
|
||||
case 0x10: // int32.
|
||||
if (length > 4) {
|
||||
return (float) ((int32_t)(value[1] << 24) + (int32_t)(value[2] << 16) + (int32_t)(value[3] << 8) +
|
||||
(int32_t)(value[4]));
|
||||
return (float) ((int32_t) (value[1] << 24) + (int32_t) (value[2] << 16) + (int32_t) (value[3] << 8) +
|
||||
(int32_t) (value[4]));
|
||||
}
|
||||
}
|
||||
ESP_LOGW(TAG, "[%d] [%s] Cannot parse characteristic value of type 0x%x length %d", this->connection_index_,
|
||||
|
@@ -44,10 +44,11 @@ class BLEClientBase : public espbt::ESPBTClient, public Component {
|
||||
memset(this->remote_bda_, 0, sizeof(this->remote_bda_));
|
||||
this->address_str_ = "";
|
||||
} else {
|
||||
this->address_str_ = str_snprintf("%02X:%02X:%02X:%02X:%02X:%02X", 17, (uint8_t)(this->address_ >> 40) & 0xff,
|
||||
(uint8_t)(this->address_ >> 32) & 0xff, (uint8_t)(this->address_ >> 24) & 0xff,
|
||||
(uint8_t)(this->address_ >> 16) & 0xff, (uint8_t)(this->address_ >> 8) & 0xff,
|
||||
(uint8_t)(this->address_ >> 0) & 0xff);
|
||||
this->address_str_ =
|
||||
str_snprintf("%02X:%02X:%02X:%02X:%02X:%02X", 17, (uint8_t) (this->address_ >> 40) & 0xff,
|
||||
(uint8_t) (this->address_ >> 32) & 0xff, (uint8_t) (this->address_ >> 24) & 0xff,
|
||||
(uint8_t) (this->address_ >> 16) & 0xff, (uint8_t) (this->address_ >> 8) & 0xff,
|
||||
(uint8_t) (this->address_ >> 0) & 0xff);
|
||||
}
|
||||
}
|
||||
void set_pin_code(uint32_t pin_code) { pin_code_ = pin_code; }
|
||||
|
@@ -18,7 +18,7 @@ logger:
|
||||
api: INFO
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
@@ -40,14 +40,14 @@ mqtt:
|
||||
# api:
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
||||
votronic:
|
||||
- id: votronic0
|
||||
uart_id: uart0
|
||||
uart_id: uart_0
|
||||
rx_timeout: ${rx_timeout}
|
||||
throttle: 2s
|
||||
|
||||
|
@@ -18,7 +18,7 @@ logger:
|
||||
api: INFO
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
@@ -40,14 +40,14 @@ mqtt:
|
||||
# api:
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
||||
votronic:
|
||||
- id: votronic0
|
||||
uart_id: uart0
|
||||
uart_id: uart_0
|
||||
rx_timeout: ${rx_timeout}
|
||||
throttle: 2s
|
||||
|
||||
|
@@ -18,7 +18,7 @@ logger:
|
||||
api: INFO
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
@@ -37,14 +37,14 @@ mqtt:
|
||||
id: mqtt_client
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
||||
votronic:
|
||||
- id: votronic0
|
||||
uart_id: uart0
|
||||
uart_id: uart_0
|
||||
rx_timeout: ${rx_timeout}
|
||||
throttle: 2s
|
||||
|
||||
|
@@ -18,7 +18,7 @@ logger:
|
||||
api: INFO
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
@@ -40,14 +40,14 @@ mqtt:
|
||||
# api:
|
||||
|
||||
uart:
|
||||
- id: uart0
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
||||
votronic:
|
||||
- id: votronic0
|
||||
uart_id: uart0
|
||||
uart_id: uart_0
|
||||
rx_timeout: ${rx_timeout}
|
||||
throttle: 2s
|
||||
|
||||
|
Reference in New Issue
Block a user