-
Notifications
You must be signed in to change notification settings - Fork 7
/
test.yaml
71 lines (65 loc) · 2.03 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
esphome:
name: test
platform: ESP8266
board: d1_mini
logger:
level: DEBUG
external_components:
- source: components
text_sensor:
- platform: state_machine
name: On/Off Toggle State Machine
state_machine:
- name: On/Off Toggle State Machine
states:
- name: "OFF"
on_enter:
- output.turn_off: led1
- logger.log: "5. [OFF] on_enter. [ON->OFF] after_transition should be called next"
on_leave:
- logger.log: "3. [OFF] on_leave. [OFF->ON] on_transition should be called next"
- name: "ON"
on_enter:
- output.turn_on: led1
- logger.log: "5. [ON] on_enter. [OFF->ON] after_transition should be called next"
on_leave:
- logger.log: "3. [ON] on_leave. [ON->OFF] on_transition should be called next"
inputs:
- name: TOGGLE
transitions:
- from: "ON"
to: "OFF"
before_transition:
- logger.log: "2. [ON->OFF] before_transition. [ON] on_leave should be called next"
on_transition:
- logger.log: "4. [ON->OFF] on_transition. [OFF] on_enter should be called next"
after_transition:
- logger.log: "6. [ON->OFF] after_transition. done"
- from: "OFF"
to: "ON"
before_transition:
- logger.log: "2. [OFF->ON] before_transition. [OFF] on_leave should be called next"
on_transition:
- logger.log: "4. [OFF->ON] on_transition. [ON] on_enter should be called next"
after_transition:
- logger.log: "6. [OFF->ON] after_transition. done"
on_input:
- logger.log: "1. on_input. before_transition should be called next"
diagram: mermaid
binary_sensor:
- platform: gpio
pin:
number: D6
mode: INPUT_PULLUP
inverted: True
name: "Button"
filters:
- delayed_on: 100ms
on_press:
- state_machine.transition: TOGGLE
output:
- platform: gpio
pin:
number: D4
inverted: True
id: led1