I have difficulty to wrap my head around how to use stateless to model a simple case.
Let's say I want a state machine to control if a lamp should be turned on or off. A home automation case, when there are sensors that can detect conditions.
It should be turned on if I am home and it is dark outside, and it should turned off otherwise. So if I am home and it becomes evening, it should turn on, but if I leave, it should turn off.
So there are two conditions that need to be evaluated together if to transition.
I have difficulty to wrap my head around how to use stateless to model a simple case.
Let's say I want a state machine to control if a lamp should be turned on or off. A home automation case, when there are sensors that can detect conditions.
It should be turned on if I am home and it is dark outside, and it should turned off otherwise. So if I am home and it becomes evening, it should turn on, but if I leave, it should turn off.
So there are two conditions that need to be evaluated together if to transition.
How would this best be modelled with stateless?