node-miio
Version:
Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
15 lines (11 loc) • 337 B
JavaScript
;
const { Thing } = require('abstract-things');
const { Dimmable } = require('abstract-things/lights');
module.exports = Thing.mixin(Parent => class extends Parent.with(Dimmable) {
propertyUpdated(key, value) {
if(key === 'brightness') {
this.updateBrightness(value);
}
super.propertyUpdated(key, value);
}
});