1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Cleanup dashboard JS (#491)

* Cleanup dashboard JS

* Add vscode

* Save start_mark/end_mark

* Updates

* Updates

* Remove need for cv.nameable

It's a bit hacky but removes so much bloat from integrations

* Add enum helper

* Document APIs, and Improvements

* Fixes

* Fixes

* Update PULL_REQUEST_TEMPLATE.md

* Updates

* Updates

* Updates
This commit is contained in:
Otto Winter
2019-04-22 21:56:30 +02:00
committed by GitHub
parent 6682c43dfa
commit 8e75980ebd
359 changed files with 4395 additions and 4223 deletions

View File

@@ -92,6 +92,9 @@ mqtt:
if (x.containsKey("effect"))
effect = x["effect"];
return effect;
- light.control:
id: living_room_lights
brightness: !lambda 'return id(living_room_lights).current_values.get_brightness() + 0.5;'
i2c:
sda: 21
@@ -211,6 +214,8 @@ sensor:
payload: Hello
qos: 2
retain: True
- platform: esp32_hall
name: ESP32 Hall Sensor
- platform: ads1115
multiplexer: 'A0_A1'
gain: 1.024
@@ -433,6 +438,9 @@ sensor:
resolution: 4
min_value: -10
max_value: 30
- platform: pulse_width
name: Pulse Width
pin: GPIO12
- platform: sht3xd
temperature:
name: "Living Room Temperature 8"
@@ -1141,7 +1149,7 @@ cover:
id: template_cover
lambda: |-
if (id(binary_sensor1).state) {
return cover::COVER_OPEN;
return COVER_OPEN;
} else {
return {};
}

View File

@@ -128,6 +128,10 @@ sensor:
time:
- platform: homeassistant
on_time:
- at: '16:00:00'
then:
- logger.log: It's 16:00
apds9960:
address: 0x20
@@ -198,6 +202,10 @@ text_sensor:
return id(version_sensor).state;
my_variable_str: |-
return "Hello World";
- homeassistant.service:
service: light.turn_on
data:
entity_id: light.my_light
- platform: template
name: "Template Text Sensor"
lambda: |-

View File

@@ -1,13 +1,47 @@
esphome:
name: $devicename
platform: ESP8266
board: esp07
board: d1_mini
build_path: build/test3
on_boot:
- wait_until:
- api.connected
- wifi.connected
substitutions:
devicename: test3
api:
port: 8000
password: 'pwd'
reboot_timeout: 0min
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: 'Hello World %s!'
args:
- name.c_str()
- service: empty_service
then:
- logger.log: 'Service Called'
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: 'Something happened'
- stepper.set_target:
id: my_stepper2
target: !lambda 'return int_;'
wifi:
ssid: 'MySSID'
password: 'password1'
i2c:
sda: 4
@@ -57,6 +91,37 @@ sensor:
- platform: homeassistant
entity_id: sensor.hello_world
id: ha_hello_world
- platform: adc
pin: VCC
id: my_sensor
filters:
- offset: 5.0
- multiply: 2.0
- filter_out: NAN
- sliding_window_moving_average:
- exponential_moving_average:
- lambda: 'return 0;'
- delta: 100
- throttle: 100ms
- debounce: 500s
- calibrate_linear:
- 0 -> 0
- 100 -> 100
- platform: tcs34725
red_channel:
name: Red Channel
green_channel:
name: Green Channel
blue_channel:
name: Blue Channel
clear_channel:
name: Clear Channel
illuminance:
name: Illuminance
color_temperature:
name: Color Temperature
integration_time: 700ms
gain: 60x
time:
- platform: homeassistant
@@ -73,6 +138,15 @@ binary_sensor:
- platform: apds9960
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: 'return false;'
on_state:
- logger.log: New state
id: my_binary_sensor
- platform: apds9960
direction: down
name: APDS9960 Down
@@ -85,7 +159,6 @@ binary_sensor:
- platform: homeassistant
entity_id: binary_sensor.hello_world
id: ha_hello_world_binary
#mpr121
- platform: mpr121
id: touchkey0
channel: 0
@@ -102,6 +175,9 @@ binary_sensor:
on_press:
then:
- switch.toggle: mpr121_toggle
- platform: ttp229_lsf
channel: 1
name: TTP229 LSF Test
remote_receiver:
pin: GPIO12
@@ -146,6 +222,17 @@ switch:
name: "mpr121_toggle"
id: mpr121_toggle
optimistic: True
- platform: gpio
id: gpio_switch1
pin:
mcp23017: mcp
number: 0
mode: OUTPUT
interlock: &interlock [gpio_switch1, gpio_switch2]
- platform: gpio
id: gpio_switch2
pin: GPIO1
interlock: *interlock
stepper:
- platform: uln2003
@@ -157,12 +244,111 @@ stepper:
sleep_when_done: no
step_mode: HALF_STEP
max_speed: 250 steps/s
# Optional:
acceleration: inf
deceleration: inf
- platform: a4988
id: my_stepper2
step_pin: GPIO1
dir_pin: GPIO2
max_speed: 0.1 steps/s
acceleration: 10 steps/s^2
deceleration: 10 steps/s^2
interval:
interval: 5s
then:
- logger.log: "Interval Run"
- stepper.set_target:
id: my_stepper2
target: 500
- stepper.set_target:
id: my_stepper
target: !lambda 'return 0;'
- stepper.report_position:
id: my_stepper2
position: 0
- stepper.report_position:
id: my_stepper
position: !lambda 'return 50/100.0;'
climate:
- platform: bang_bang
name: Bang Bang Climate
sensor: ha_hello_world
default_target_temperature_low: 18°C
default_target_temperature_high: 24°C
idle_action:
- switch.turn_on: gpio_switch1
cool_action:
- switch.turn_on: gpio_switch2
heat_action:
- switch.turn_on: gpio_switch1
away_config:
default_target_temperature_low: 16°C
default_target_temperature_high: 20°C
cover:
- platform: endstop
name: Endstop Cover
stop_action:
- switch.turn_on: gpio_switch1
open_endstop: my_binary_sensor
open_action:
- switch.turn_on: gpio_switch1
open_duration: 5min
close_endstop: my_binary_sensor
close_action:
- switch.turn_on: gpio_switch2
- output.set_level:
id: out
level: 50%
- output.esp8266_pwm.set_frequency:
id: out
frequency: 500.0Hz
- output.esp8266_pwm.set_frequency:
id: out
frequency: !lambda 'return 500.0;'
- servo.write:
id: my_servo
level: -100%
- servo.write:
id: my_servo
level: !lambda 'return -1.0;'
- delay: 2s
- servo.detach: my_servo
close_duration: 4.5min
max_duration: 10min
- platform: time_based
name: Time Based Cover
stop_action:
- switch.turn_on: gpio_switch1
open_action:
- switch.turn_on: gpio_switch1
open_duration: 5min
close_action:
- switch.turn_on: gpio_switch2
close_duration: 4.5min
output:
- platform: esp8266_pwm
id: out
pin: D3
frequency: 50Hz
mcp23017:
id: mcp
light:
- platform: neopixelbus
name: Neopixelbus Light
pin: GPIO1
type: GRBW
variant: SK6812
method: ESP8266_UART0
num_leds: 100
servo:
id: my_servo
output: out
ttp229_lsf: