1
0
mirror of https://github.com/esphome/esphome.git synced 2024-10-04 18:27:06 +02:00

Add some components to the new testing framework (A part 2) (#6162)

This commit is contained in:
Keith Burzinski 2024-02-06 13:05:04 -06:00 committed by GitHub
parent 164b42f5aa
commit 9dbbc80c74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
88 changed files with 2622 additions and 0 deletions

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 6
mosi_pin: 7
miso_pin: 5
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 8
dc_pin: 9
reset_pin: 10
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 6
mosi_pin: 7
miso_pin: 5
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 8
dc_pin: 9
reset_pin: 10
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 16
mosi_pin: 17
miso_pin: 15
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 12
dc_pin: 13
reset_pin: 21
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 16
mosi_pin: 17
miso_pin: 15
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 12
dc_pin: 13
reset_pin: 21
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 14
mosi_pin: 13
miso_pin: 12
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 5
dc_pin: 15
reset_pin: 16
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 2
mosi_pin: 3
miso_pin: 4
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 20
dc_pin: 21
reset_pin: 22
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
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
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
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
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
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
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
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
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
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
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
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
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
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
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
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
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
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