UNPKG

@trusthab/composable-resources

Version:

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

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