UNPKG

node-miio

Version:

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

15 lines (10 loc) 319 B
'use strict'; const { Thing, SwitchablePower } = require('abstract-things'); module.exports = Thing.mixin(Parent => class extends Parent.with(SwitchablePower) { propertyUpdated(key, value) { if(key === 'power' && value !== undefined) { this.updatePower(value); } super.propertyUpdated(key, value); } });