MastodonC/kixi.hecuba — pull request #34 by apawlicka (2014-06-09 08:36:49+00:00)
Title: Feature/co2

- vol -> kWh is now an automatic job
- Added kWh -> co2 calculation
- Added new jobs to scheduler and made rollups and difference series calculation trigger every 15/20 minutes

Whenever new device is added, or new synthetic sensor created, a set of default sensors should be created, e.g. m^3 sensor should have also sensorType_kWh and sensorType_co2 added (for automatic calculations)
At the moment this is done by having calculated-sensor function in devices.clj:
https://github.com/MastodonC/kixi.hecuba/blob/feature/co2/src/kixi/hecuba/api/devices.clj#L47
which is called when new device is created and when new synthetic sensor is added:
https://github.com/MastodonC/kixi.hecuba/blob/feature/co2/src/kixi/hecuba/api/datasets.clj#L61
This doesn't seem quite right and any suggestions on how to improve it will be appreciated.