rzr / generic-sensors-lite

Naive implementation of w3c specs for IoT.js
https://purl.org/rzr/sensors
Apache License 2.0
10 stars 6 forks source link

Add simulators #5

Closed rzr closed 5 years ago

rzr commented 5 years ago

They could return random values like done https://github.com/SamsungInternet/color-sensor-js/blob/master/lib/simulator.js

It should be trivial to implement, then once done I suggest to set simulator as default controllers for all sensors type then I will update: https://github.com/rzr/mozilla-iot-generic-sensors-adapter/

Relate-to: https://github.com/SamsungInternet/webthings-webapp/issues/4 CC: @Utopiah

rzr commented 5 years ago

Thanks to @MatonAnthony for your contribution based on @Vinnl works

Now simulator for temperature is remaining to close this issue, other w3c sensors are also welcome (ie: orientation, proximity ... )

Feel free to inspire from: https://github.com/SamsungInternet/color-sensor-js/blob/master/lib/simulator.js