There seems to be a bug in the driver for the Philips Eyecare 2 lamp. This code generates the following error.
const miio = require('./node_modules/miio/lib');
// Create a new device over the given address
miio.device({
address: '192.168.0.1',
token: 'xxxxxxxxxxxxxxxxxxxxxxx'
}).then(device => {
const getData = async () => {
try {
const power = await device.power();
const brightness = await device.brightness()
const mode = await device.mode();
const eyecare = await device.eyeCareMode();
let result = {
onoff: power,
brightness: brightness,
mode: mode,
eyecare: eyecare
}
console.log(result)
} catch (error) {
console.log(error);
}
}
getData();
}).catch(err => console.log('Error occurred:', err));
pi@iobroker:~ $ node miio.js
Error occurred: { TypeError: this.setModes is not a function
at new EyecareLamp2 (/usr/lib/node_modules/miio/lib/devices/eyecare-lamp2.js:68:8)
at network.findDeviceViaAddress.then.device (/usr/lib/node_modules/miio/lib/connectToDevice.js:25:12)
at device: null }
There seems to be a bug in the driver for the Philips Eyecare 2 lamp. This code generates the following error.