rename folder
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
```yaml
|
||||
# example configuration:
|
||||
|
||||
empty_uart_component:
|
||||
id: empty_uart_component_1
|
||||
|
||||
uart:
|
||||
tx_pin: D0
|
||||
rx_pin: D1
|
||||
baud_rate: 9600
|
||||
```
|
||||
@@ -0,0 +1,18 @@
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.components import uart
|
||||
from esphome.const import CONF_ID
|
||||
|
||||
DEPENDENCIES = ['uart']
|
||||
|
||||
empty_uart_component_ns = cg.esphome_ns.namespace('empty_uart_component')
|
||||
EmptyUARTComponent = empty_uart_component_ns.class_('EmptyUARTComponent', cg.Component, uart.UARTDevice)
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema({
|
||||
cv.GenerateID(): cv.declare_id(EmptyUARTComponent)
|
||||
}).extend(cv.COMPONENT_SCHEMA).extend(uart.UART_DEVICE_SCHEMA)
|
||||
|
||||
def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
yield cg.register_component(var, config)
|
||||
yield uart.register_uart_device(var, config)
|
||||
@@ -0,0 +1,22 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "empty_uart_component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace empty_uart_component {
|
||||
|
||||
static const char *TAG = "empty_uart_component.component";
|
||||
|
||||
void EmptyUARTComponent::setup() {
|
||||
|
||||
}
|
||||
|
||||
void EmptyUARTComponent::loop() {
|
||||
|
||||
}
|
||||
|
||||
void EmptyUARTComponent::dump_config(){
|
||||
ESP_LOGCONFIG(TAG, "Empty UART component");
|
||||
}
|
||||
|
||||
} // namespace empty_uart_component
|
||||
} // namespace esphome
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/components/uart/uart.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace empty_uart_component {
|
||||
|
||||
class EmptyUARTComponent : public uart::UARTDevice, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void loop() override;
|
||||
void dump_config() override;
|
||||
};
|
||||
|
||||
|
||||
} // namespace empty_uart_component
|
||||
} // namespace esphome
|
||||
Reference in New Issue
Block a user