A web based talking coffee machine simulator
This is a simulator of an imaginary coffee machine with web API service. This machine only can serve one person at the same time. Multiple users at the same time can confuse the current version.
The current version of coffee machine understands two features for coffee: density and size.
The state of this coffee machine is stored in coffee_machine.json
and all of it's funcitonality are implemented in as CoffeeMachine
class in models.py
. The run.py
will fire the web interface and all web services.
/
It will retrun the functioning machine user interface.
/cm
It will respond the coffe machine status in JSON format such as:
{
"_valid_size": [1, 2, 3],
"density": 3,
"_valid_density": [1, 2, 3],
"size": 1,
"status": "ready"
}
/cm/<size>/<density>
/cm/size/<size>
/cm/density/<density>
/cm/size
/cm/density
/cm/turn_on
It resets all parameters then it sets status
to ready
.
/cm/reset
It resets all parameters then it sets status
to standby
.
/cm/serve
It sets status
to serve
then it resets all parameters.