mirror of
https://github.com/esphome/esphome.git
synced 2025-09-01 19:02:18 +01:00
Add some components to the new testing framework (L) (#6195)
This commit is contained in:
36
tests/components/lock/test.esp32-c3-idf.yaml
Normal file
36
tests/components/lock/test.esp32-c3-idf.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
- lock.lock: test_lock1
|
||||
- lock.unlock: test_lock1
|
||||
- lock.open: test_lock1
|
||||
|
||||
output:
|
||||
- platform: gpio
|
||||
id: test_binary
|
||||
pin: 4
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: test_lock1
|
||||
name: Template Lock
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return LOCK_STATE_LOCKED;
|
||||
} else {
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
}
|
||||
optimistic: true
|
||||
assumed_state: false
|
||||
on_unlock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
on_lock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_LOCKED;"
|
||||
- platform: output
|
||||
name: Generic Output Lock
|
||||
id: test_lock2
|
||||
output: test_binary
|
36
tests/components/lock/test.esp32-c3.yaml
Normal file
36
tests/components/lock/test.esp32-c3.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
- lock.lock: test_lock1
|
||||
- lock.unlock: test_lock1
|
||||
- lock.open: test_lock1
|
||||
|
||||
output:
|
||||
- platform: gpio
|
||||
id: test_binary
|
||||
pin: 4
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: test_lock1
|
||||
name: Template Lock
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return LOCK_STATE_LOCKED;
|
||||
} else {
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
}
|
||||
optimistic: true
|
||||
assumed_state: false
|
||||
on_unlock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
on_lock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_LOCKED;"
|
||||
- platform: output
|
||||
name: Generic Output Lock
|
||||
id: test_lock2
|
||||
output: test_binary
|
36
tests/components/lock/test.esp32-idf.yaml
Normal file
36
tests/components/lock/test.esp32-idf.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
- lock.lock: test_lock1
|
||||
- lock.unlock: test_lock1
|
||||
- lock.open: test_lock1
|
||||
|
||||
output:
|
||||
- platform: gpio
|
||||
id: test_binary
|
||||
pin: 4
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: test_lock1
|
||||
name: Template Lock
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return LOCK_STATE_LOCKED;
|
||||
} else {
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
}
|
||||
optimistic: true
|
||||
assumed_state: false
|
||||
on_unlock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
on_lock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_LOCKED;"
|
||||
- platform: output
|
||||
name: Generic Output Lock
|
||||
id: test_lock2
|
||||
output: test_binary
|
36
tests/components/lock/test.esp32.yaml
Normal file
36
tests/components/lock/test.esp32.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
- lock.lock: test_lock1
|
||||
- lock.unlock: test_lock1
|
||||
- lock.open: test_lock1
|
||||
|
||||
output:
|
||||
- platform: gpio
|
||||
id: test_binary
|
||||
pin: 4
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: test_lock1
|
||||
name: Template Lock
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return LOCK_STATE_LOCKED;
|
||||
} else {
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
}
|
||||
optimistic: true
|
||||
assumed_state: false
|
||||
on_unlock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
on_lock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_LOCKED;"
|
||||
- platform: output
|
||||
name: Generic Output Lock
|
||||
id: test_lock2
|
||||
output: test_binary
|
36
tests/components/lock/test.esp8266.yaml
Normal file
36
tests/components/lock/test.esp8266.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
- lock.lock: test_lock1
|
||||
- lock.unlock: test_lock1
|
||||
- lock.open: test_lock1
|
||||
|
||||
output:
|
||||
- platform: gpio
|
||||
id: test_binary
|
||||
pin: 4
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: test_lock1
|
||||
name: Template Lock
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return LOCK_STATE_LOCKED;
|
||||
} else {
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
}
|
||||
optimistic: true
|
||||
assumed_state: false
|
||||
on_unlock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
on_lock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_LOCKED;"
|
||||
- platform: output
|
||||
name: Generic Output Lock
|
||||
id: test_lock2
|
||||
output: test_binary
|
36
tests/components/lock/test.rp2040.yaml
Normal file
36
tests/components/lock/test.rp2040.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
- lock.lock: test_lock1
|
||||
- lock.unlock: test_lock1
|
||||
- lock.open: test_lock1
|
||||
|
||||
output:
|
||||
- platform: gpio
|
||||
id: test_binary
|
||||
pin: 4
|
||||
|
||||
lock:
|
||||
- platform: template
|
||||
id: test_lock1
|
||||
name: Template Lock
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return LOCK_STATE_LOCKED;
|
||||
} else {
|
||||
return LOCK_STATE_UNLOCKED;
|
||||
}
|
||||
optimistic: true
|
||||
assumed_state: false
|
||||
on_unlock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_UNLOCKED;"
|
||||
on_lock:
|
||||
- lock.template.publish:
|
||||
id: test_lock1
|
||||
state: !lambda "return LOCK_STATE_LOCKED;"
|
||||
- platform: output
|
||||
name: Generic Output Lock
|
||||
id: test_lock2
|
||||
output: test_binary
|
Reference in New Issue
Block a user