reorganize examples

This commit is contained in:
GrKoR
2021-04-22 22:05:06 +03:00
parent e893e5a2e4
commit a5e58580ce
7 changed files with 98 additions and 6 deletions

9
.gitignore vendored
View File

@@ -1,12 +1,13 @@
# Gitignore settings for ESPHome # Gitignore settings for ESPHome
# This is an example and may include too much for your use-case. # This is an example and may include too much for your use-case.
# You can modify this file to suit your needs. # You can modify this file to suit your needs.
/.esphome/ **/.esphome/
**/.pioenvs/ **/.pioenvs/
**/.piolibdeps/ **/.piolibdeps/
**/lib/ **/lib/
**/src/ **/src/
**/platformio.ini **/platformio.ini
/secrets.yaml **/secrets.yaml
/livingroom_ac/ **/livingroom_ac/
/kitchen_ac/ **/kitchen_ac/
/examples/*/*.h

10
examples/advanced/.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
**/.pioenvs/
**/.piolibdeps/
**/lib/
**/src/
**/platformio.ini
/secrets.yaml

View File

@@ -25,8 +25,7 @@ debug:
logger: logger:
level: DEBUG level: DEBUG
# important: for avoiding collisions logger works with UART1 (for esp8266 tx = GPIO2, rx = None) baud_rate: 0
hardware_uart: UART1
api: api:
password: !secret api_pass password: !secret api_pass

10
examples/simple/.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
**/.pioenvs/
**/.piolibdeps/
**/lib/
**/src/
**/platformio.ini
/secrets.yaml

View File

@@ -0,0 +1,72 @@
esphome:
name: aux_air_conditioner
platform: ESP8266
board: esp12e
includes:
- aux_ac_custom_component.h
# don't forget to set your's wifi settings!
wifi:
ssid: "WIFI SSID"
password: "seCRETpassWORD"
manual_ip:
static_ip: 192.168.0.2
gateway: 192.168.0.1
subnet: 255.255.255.0
ap:
ssid: AUX Hotspot
password: "seCREThotSPOTpassWORD"
captive_portal:
debug:
logger:
level: DEBUG
baud_rate: 0
api:
ota:
# UART0 configuration for AUX air conditioner communication
uart:
id: ac_uart_bus
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 4800
data_bits: 8
parity: EVEN
stop_bits: 1
climate:
# register custom AC climate
- platform: custom
lambda: |-
extern AirCon acAirCon;
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
App.register_component(&acAirCon);
return {&acAirCon};
climates:
- name: AUX hvac
sensor:
- platform: custom
lambda: |-
extern AirCon acAirCon;
if (!acAirCon.get_initialized()) acAirCon.initAC(id(ac_uart_bus));
App.register_component(&acAirCon);
return {acAirCon.sensor_ambient_temperature};
sensors:
- name: AUX ambient temperature
unit_of_measurement: "°C"
accuracy_decimals: 1
text_sensor:
- platform: custom
lambda: |-
auto aircon_firmware_version = new AirConFirmwareVersion();
App.register_component(aircon_firmware_version);
return {aircon_firmware_version};
text_sensors:
name: AUX firmware version
icon: "mdi:chip"