Built with Deno and Opine to comunicate with a OneM2M CSE.
Our SmartApp is responsible for coordinating sensors and actuators in our project. It finds the closest sensor to any actuator and calculates the AQI (Air Quality Index) every time a new reading is available. Once the AQI for a sensor has been calculated, the app will send its value to the appropriate actuators.
The app also fetches and parses data from the CSE to send it to the ROTehc frontend in order to plot all sensors.
deno run --allow-net --allow-read src/main.ts
Run all tests:
deno test
Run specific tests:
deno test tests/NAME.test.ts
{
"SCHEMA": "http",
"ADDR": "x.x.x.x",
"PORT": port
}
{
"SCHEMA": "http",
"ADDR": "x.x.x.x",
"PORT": port
}
📦SmartApp
┣ 📂config
┃ ┣ 📜ae.config.json
┃ ┗ 📜cse.config.json
┣ 📂src
┃ ┣ 📜cse-com.ts
┃ ┣ 📜log.ts
┃ ┣ 📜logic.ts
┃ ┣ 📜main.ts
┃ ┗ 📜types.ts
┣ 📂tests
┃ ┣ 📜aqi.test.ts
┃ ┣ 📜closest.test.ts
┃ ┗ 📜distance.test.ts
┣ 📜.gitignore
┣ 📜LICENSE
┗ 📜README.md