UNPKG

@trusthab/composable-resources

Version:

migrating https://github.com/knetikmedia/hab-api/tree/integration/app/resources/composable

28 lines (20 loc) 501 B
const composer = require('../../mixin_loader'); module.exports = (App) => { const { underscore } = require('inflected'); class DevicesConfigErrorsResource { static mixins() { return ['Kpi']; } getMetricId() { return 'devices_config_errors'; } getMetricType() { return 'gauge'; } getValue() { if (this.get('obj').device_type !== 'thermostat') { return 0; } return 1; } } return composer(DevicesConfigErrorsResource, App); };