UNPKG

node-miio

Version:

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

14 lines (10 loc) 291 B
'use strict'; const { Thing, SwitchableMode } = require('abstract-things'); module.exports = Thing.mixin(Parent => class extends Parent.with(SwitchableMode) { propertyUpdated(key, value) { if(key === 'mode') { this.updateMode(value); } super.propertyUpdated(key, value); } });