mirror of
https://github.com/syssi/esphome-votronic.git
synced 2025-07-23 04:23:02 +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"
|
git commit -a -m "Add external component"
|
||||||
working-directory: ${{ env.esphome_directory }}
|
working-directory: ${{ env.esphome_directory }}
|
||||||
|
|
||||||
|
- name: Add missing requirements
|
||||||
|
run: pip3 install setuptools wheel
|
||||||
- name: Set up python environment
|
- name: Set up python environment
|
||||||
run: VIRTUAL_ENV=false script/setup
|
run: VIRTUAL_ENV=false script/setup
|
||||||
working-directory: ${{ env.esphome_directory }}
|
working-directory: ${{ env.esphome_directory }}
|
||||||
|
@@ -337,18 +337,18 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) {
|
|||||||
case 0xD: // int12.
|
case 0xD: // int12.
|
||||||
case 0xE: // int16.
|
case 0xE: // int16.
|
||||||
if (length > 2) {
|
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
|
// fall through
|
||||||
case 0xF: // int24.
|
case 0xF: // int24.
|
||||||
if (length > 3) {
|
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
|
// fall through
|
||||||
case 0x10: // int32.
|
case 0x10: // int32.
|
||||||
if (length > 4) {
|
if (length > 4) {
|
||||||
return (float) ((int32_t)(value[1] << 24) + (int32_t)(value[2] << 16) + (int32_t)(value[3] << 8) +
|
return (float) ((int32_t) (value[1] << 24) + (int32_t) (value[2] << 16) + (int32_t) (value[3] << 8) +
|
||||||
(int32_t)(value[4]));
|
(int32_t) (value[4]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "[%d] [%s] Cannot parse characteristic value of type 0x%x length %d", this->connection_index_,
|
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_));
|
memset(this->remote_bda_, 0, sizeof(this->remote_bda_));
|
||||||
this->address_str_ = "";
|
this->address_str_ = "";
|
||||||
} else {
|
} else {
|
||||||
this->address_str_ = str_snprintf("%02X:%02X:%02X:%02X:%02X:%02X", 17, (uint8_t)(this->address_ >> 40) & 0xff,
|
this->address_str_ =
|
||||||
(uint8_t)(this->address_ >> 32) & 0xff, (uint8_t)(this->address_ >> 24) & 0xff,
|
str_snprintf("%02X:%02X:%02X:%02X:%02X:%02X", 17, (uint8_t) (this->address_ >> 40) & 0xff,
|
||||||
(uint8_t)(this->address_ >> 16) & 0xff, (uint8_t)(this->address_ >> 8) & 0xff,
|
(uint8_t) (this->address_ >> 32) & 0xff, (uint8_t) (this->address_ >> 24) & 0xff,
|
||||||
(uint8_t)(this->address_ >> 0) & 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; }
|
void set_pin_code(uint32_t pin_code) { pin_code_ = pin_code; }
|
||||||
|
@@ -18,7 +18,7 @@ logger:
|
|||||||
api: INFO
|
api: INFO
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
@@ -40,14 +40,14 @@ mqtt:
|
|||||||
# api:
|
# api:
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
|
||||||
votronic:
|
votronic:
|
||||||
- id: votronic0
|
- id: votronic0
|
||||||
uart_id: uart0
|
uart_id: uart_0
|
||||||
rx_timeout: ${rx_timeout}
|
rx_timeout: ${rx_timeout}
|
||||||
throttle: 2s
|
throttle: 2s
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ logger:
|
|||||||
api: INFO
|
api: INFO
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
@@ -40,14 +40,14 @@ mqtt:
|
|||||||
# api:
|
# api:
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
|
||||||
votronic:
|
votronic:
|
||||||
- id: votronic0
|
- id: votronic0
|
||||||
uart_id: uart0
|
uart_id: uart_0
|
||||||
rx_timeout: ${rx_timeout}
|
rx_timeout: ${rx_timeout}
|
||||||
throttle: 2s
|
throttle: 2s
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ logger:
|
|||||||
api: INFO
|
api: INFO
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
@@ -37,14 +37,14 @@ mqtt:
|
|||||||
id: mqtt_client
|
id: mqtt_client
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
|
||||||
votronic:
|
votronic:
|
||||||
- id: votronic0
|
- id: votronic0
|
||||||
uart_id: uart0
|
uart_id: uart_0
|
||||||
rx_timeout: ${rx_timeout}
|
rx_timeout: ${rx_timeout}
|
||||||
throttle: 2s
|
throttle: 2s
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ logger:
|
|||||||
api: INFO
|
api: INFO
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
@@ -40,14 +40,14 @@ mqtt:
|
|||||||
# api:
|
# api:
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
- id: uart0
|
- id: uart_0
|
||||||
baud_rate: 1000
|
baud_rate: 1000
|
||||||
tx_pin: ${tx_pin}
|
tx_pin: ${tx_pin}
|
||||||
rx_pin: ${rx_pin}
|
rx_pin: ${rx_pin}
|
||||||
|
|
||||||
votronic:
|
votronic:
|
||||||
- id: votronic0
|
- id: votronic0
|
||||||
uart_id: uart0
|
uart_id: uart_0
|
||||||
rx_timeout: ${rx_timeout}
|
rx_timeout: ${rx_timeout}
|
||||||
throttle: 2s
|
throttle: 2s
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user