@trusthab/composable-resources
Version:
migrating https://github.com/knetikmedia/hab-api/tree/integration/app/resources/composable
30 lines (21 loc) • 523 B
JavaScript
const composer = require('../../mixin_loader');
module.exports = (App) => {
const { underscore } = require('inflected');
class ThermostatsTotalResource {
static mixins() {
return ['Kpi'];
}
getMetricId() {
return 'thermostats_total';
}
getMetricType() {
return 'gauge';
}
getValue() {
const { device_type } = this.get('obj');
if (device_type !== 'thermostat') { return 0; }
return 1;
}
}
return composer(ThermostatsTotalResource, App);
};