UNPKG

node-miio

Version:

Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more

17 lines (13 loc) 325 B
'use strict'; const { Thing, BatteryLevel } = require('abstract-things'); module.exports = Thing.mixin( (Parent) => class extends Parent.with(BatteryLevel) { propertyUpdated(key, value) { if (key === 'batteryLevel') { this.updateBatteryLevel(value); } super.propertyUpdated(key, value); } } );