Skip to content

Commit

Permalink
Update rabbit-hutch.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
crjeder authored Oct 18, 2024
1 parent 3972318 commit 7e896d4
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions rabbit-hutch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ state_machine:
transitions:
- ERROR -> CLOSED
- OPEN -> CLOSED
- WAITING -> CLOSED
on_input:
- number.set:
id: nr_inhabitants
Expand All @@ -97,13 +98,15 @@ state_machine:
- logger.log: Time open
- name: ENTER
transitions:
- OPEN -> OPEN
- on_transition:
- from: OPEN
to: OPEN
on_transition:
- number.increment:
id: nr_inhabitants
cycle: false
- WAITING -> WAITING
- on_transition:
- from: WAITING
to: WAITING
on_transition:
- number.increment:
id: nr_inhabitants
cycle: false
Expand Down Expand Up @@ -225,11 +228,23 @@ sun:
longitude: 11.96109°

on_sunrise:
- then:
- logger.log: Good morning! I'll open the huch door!
- state_machine.transition: TIME_OPEN
- elevation:
then:
- logger.log: Good morning! I'll open the huch door!
- state_machine.transition: TIME_OPEN

on_sunset:
then:
- logger.log: Good evening! I'll close the huch door!
- state_machine.transition: TIME_CLOSE
- elevation:
then:
- logger.log: Good evening! I'll close the huch door!
- state_machine.transition: TIME_CLOSE
- elevation:
then:
- if:
condition:
state_machine.state:
value: "WAITING"
value: "ERROR"
then:
- logger.log: "Danger! Rabits are not in the hutch at dawn!"
- state_machine.transition: ERROR

0 comments on commit 7e896d4

Please sign in to comment.