El codigo intenta procesar una 'request' proveniente de la skill y devolver una 'response' acorde. Pasea el objeto que recibe buscando el tipo de consulta que se esta haciendo para resolver el tipo de respuesta.
Se crea un objeto AlexaResponse para armar una respuesta para alexa usando el formato esperado.
- ToggleController: Spa.Lights, Spa.Jets
- TemperatureController: Spa.Temp
miniconda installation: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html#
once miniconda is installed and you are in base environment, create a new one:
conda create --name <env>
conda activate --name <env>
Install dependencies for testing:
conda install pytest
conda install -c conda-forge bottle
Stand in root directory and run
pytest
ssh to milonet
$ ssh username@milonet.duckdns.org
clone repo (create ssh keys with ssh-keygen if necessary)
Install python 3.8, if not installed already, and dependencies (bottle and pytest)
Set nginx to listen to port 3434 and assign route /spa
run server and test it with curl from another terminal
curl -kvvv https://milonet.duckdns.org/spa/discovery/0101
Copy test/spa-test-server.service file into /etc/systemd/system/spa-test-server.service
Start/stop/restart the service:
sudo systemctl start spa-test-server
sudo systemctl stop spa-test-server
sudo systemctl restart spa-test-server
Restart with every new update from remote.