mirror of
https://github.com/ElVit/esphome_components.git
synced 2026-09-29 19:11:29 +02:00
Merge pull request #39 from ElVit/uart/final-validate-schema
fix: replace deprecated check_uart_settings with final validation
This commit is contained in:
@@ -26,6 +26,10 @@ CONFIG_SCHEMA = (
|
|||||||
.extend(cv.COMPONENT_SCHEMA)
|
.extend(cv.COMPONENT_SCHEMA)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
FINAL_VALIDATE_SCHEMA = uart.final_validate_device_schema(
|
||||||
|
"maidesite_desk", baud_rate=9600
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = cg.new_Pvariable(config[CONF_ID])
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ void MaidesiteDeskComponent::dump_config() {
|
|||||||
void MaidesiteDeskComponent::setup() {
|
void MaidesiteDeskComponent::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up Maidesite Desk ...");
|
ESP_LOGCONFIG(TAG, "Setting up Maidesite Desk ...");
|
||||||
delay(10);
|
delay(10);
|
||||||
this->check_uart_settings(9600);
|
|
||||||
this->request_physical_limits();
|
this->request_physical_limits();
|
||||||
this->request_limits();
|
this->request_limits();
|
||||||
this->request_settings();
|
this->request_settings();
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ CONFIG_SCHEMA = (
|
|||||||
.extend(uart.UART_DEVICE_SCHEMA)
|
.extend(uart.UART_DEVICE_SCHEMA)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
FINAL_VALIDATE_SCHEMA = uart.final_validate_device_schema(
|
||||||
|
"panasonic_heatpump",
|
||||||
|
baud_rate=9600,
|
||||||
|
data_bits=8,
|
||||||
|
parity="EVEN",
|
||||||
|
stop_bits=1,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = cg.new_Pvariable(config[CONF_ID])
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ void PanasonicHeatpumpComponent::dump_config() {
|
|||||||
|
|
||||||
void PanasonicHeatpumpComponent::setup() {
|
void PanasonicHeatpumpComponent::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up Panasonic Heatpump ...");
|
ESP_LOGCONFIG(TAG, "Setting up Panasonic Heatpump ...");
|
||||||
this->check_uart_settings(9600, 1, uart::UART_CONFIG_PARITY_EVEN, 8);
|
|
||||||
|
|
||||||
this->response_queue_handle_ = xQueueCreate(8, sizeof(std::vector<uint8_t>*));
|
this->response_queue_handle_ = xQueueCreate(8, sizeof(std::vector<uint8_t>*));
|
||||||
if (this->response_queue_handle_ == nullptr) {
|
if (this->response_queue_handle_ == nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user