opengridcc / opengrid-dev

Open source building monitoring, analysis and control
Apache License 2.0
26 stars 21 forks source link

Get last timestamp for sensor #187

Closed JrtPec closed 7 years ago

JrtPec commented 7 years ago

Ported a piece of TMPO code to the houseprint, it should be replaced as soon as the last_timestamp method is pulled there.

Do sensor.last_timestamp() to get the end of the last TMPO-block that is found for that sensor, or device.last_timestamp() to get the last timestamp for the device.

@WolfBerwouts I have also added a last_timestamp() method on the device level, so you can deal with inactive gas sensors by checking if their 'brothers and sisters' are also inactive or not.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.7%) to 68.795% when pulling 1b7a070069a2cffb1b8087610f71f4bdc84c1315 on JrtPec:get-last-timestamp-for-sensor into 2c695474e0b3bb6b19fb766eda315471f5fbe719 on opengridcc:develop.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.7%) to 68.795% when pulling 1b7a070069a2cffb1b8087610f71f4bdc84c1315 on JrtPec:get-last-timestamp-for-sensor into 2c695474e0b3bb6b19fb766eda315471f5fbe719 on opengridcc:develop.