jiecang_desk_controller: revisited example
This commit is contained in:
@@ -2,37 +2,22 @@ esphome:
|
||||
name: jiecang-desk-controller
|
||||
friendly_name: Jiecang Desk Controller
|
||||
on_boot:
|
||||
# This script is required to initialize the following sensors:
|
||||
# height_pct, height_min, height_max, position1 - position4
|
||||
# You can skip this if you don't use those.
|
||||
priority: 0 # when mostly everything else is done
|
||||
then:
|
||||
- lambda: "id(my_desk).request_physical_limits();"
|
||||
- delay: 0.1s
|
||||
- delay: 0.1s # give controller a chance to handle the response before sending the next command
|
||||
- lambda: "id(my_desk).request_limits();"
|
||||
- delay: 0.1s
|
||||
- lambda: "id(my_desk).request_settings();"
|
||||
|
||||
esp8266:
|
||||
board: esp01_1m
|
||||
|
||||
logger:
|
||||
level: WARN
|
||||
baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller
|
||||
|
||||
api:
|
||||
|
||||
ota:
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "esphome-desk"
|
||||
password: "9ebc6eac0b4e0e26b8d3b955ec660557"
|
||||
|
||||
captive_portal:
|
||||
|
||||
|
||||
external_components:
|
||||
- source:
|
||||
type: git
|
||||
url: https://github.com/Rocka84/esphome_components/
|
||||
components: [ jiecang_desk_controller ]
|
||||
|
||||
uart:
|
||||
id: uart_bus
|
||||
@@ -40,11 +25,8 @@ uart:
|
||||
rx_pin: RX
|
||||
baud_rate: 9600
|
||||
|
||||
external_components:
|
||||
- source:
|
||||
type: git
|
||||
url: https://github.com/Rocka84/esphome_components/
|
||||
components: [ jiecang_desk_controller ]
|
||||
logger:
|
||||
baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller
|
||||
|
||||
jiecang_desk_controller:
|
||||
id: my_desk
|
||||
@@ -106,3 +88,22 @@ jiecang_desk_controller:
|
||||
# on_press:
|
||||
# lambda: "id(my_desk).goto_position(4);"
|
||||
|
||||
|
||||
# the usual stuff
|
||||
|
||||
esp8266:
|
||||
board: esp01_1m
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
ap:
|
||||
ssid: "esphome-desk"
|
||||
password: "9ebc6eac0b4e0e26b8d3b955ec660557"
|
||||
|
||||
captive_portal:
|
||||
api:
|
||||
encryption:
|
||||
key: !secret encryption_key
|
||||
ota:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user