{"action":"created","issue":{"url":"https://api.github.com/repos/aholstenson/miio/issues/145","repository_url":"https://api.github.com/repos/aholstenson/miio","labels_url":"https://api.github.com/repos/aholstenson/miio/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/aholstenson/miio/issues/145/comments","events_url":"https://api.github.com/repos/aholstenson/miio/issues/145/events","html_url":"https://github.com/aholstenson/miio/issues/145","id":315615506,"node_id":"MDU6SXNzdWUzMTU2MTU1MDY=","number":145,"title":"Philips Eyecare 2: this.setModes is not a function","user":{"login":"jghaanstra","id":4710062,"node_id":"MDQ6VXNlcjQ3MTAwNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/4710062?v=4","gravatar_id":"","url":"https://api.github.com/users/jghaanstra","html_url":"https://github.com/jghaanstra","followers_url":"https://api.github.com/users/jghaanstra/followers","following_url":"https://api.github.com/users/jghaanstra/following{/other_user}","gists_url":"https://api.github.com/users/jghaanstra/gists{/gist_id}","starred_url":"https://api.github.com/users/jghaanstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jghaanstra/subscriptions","organizations_url":"https://api.github.com/users/jghaanstra/orgs","repos_url":"https://api.github.com/users/jghaanstra/repos","events_url":"https://api.github.com/users/jghaanstra/events{/privacy}","received_events_url":"https://api.github.com/users/jghaanstra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-18T19:40:34Z","updated_at":"2019-01-02T11:45:42Z","closed_at":null,"author_association":"NONE","body":"There seems to be a bug in the driver for the Philips Eyecare 2 lamp. This code generates the following error.\r\n```\r\nconst miio = require('./node_modules/miio/lib');\r\n\r\n// Create a new device over the given address\r\nmiio.device({\r\n\taddress: '192.168.0.1',\r\n  token: 'xxxxxxxxxxxxxxxxxxxxxxx'\r\n}).then(device => {\r\n  const getData = async () => {\r\n      try {\r\n          const power = await device.power();\r\n          const brightness = await device.brightness()\r\n          const mode = await device.mode();\r\n          const eyecare = await device.eyeCareMode();\r\n\r\n          let result = {\r\n              onoff: power,\r\n              brightness: brightness,\r\n              mode: mode,\r\n              eyecare: eyecare\r\n          }\r\n\r\n          console.log(result)\r\n      } catch (error) {\r\n          console.log(error);\r\n      }\r\n  }\r\n  getData();\r\n}).catch(err => console.log('Error occurred:', err));\r\n```\r\n\r\n```\r\npi@iobroker:~ $ node miio.js\r\nError occurred: { TypeError: this.setModes is not a function\r\nat new EyecareLamp2 (/usr/lib/node_modules/miio/lib/devices/eyecare-lamp2.js:68:8)\r\nat network.findDeviceViaAddress.then.device (/usr/lib/node_modules/miio/lib/connectToDevice.js:25:12)\r\nat device: null }\r\n```"},"comment":{"url":"https://api.github.com/repos/aholstenson/miio/issues/comments/450844242","html_url":"https://github.com/aholstenson/miio/issues/145#issuecomment-450844242","issue_url":"https://api.github.com/repos/aholstenson/miio/issues/145","id":450844242,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDg0NDI0Mg==","user":{"login":"Eternity-again","id":10754229,"node_id":"MDQ6VXNlcjEwNzU0MjI5","avatar_url":"https://avatars0.githubusercontent.com/u/10754229?v=4","gravatar_id":"","url":"https://api.github.com/users/Eternity-again","html_url":"https://github.com/Eternity-again","followers_url":"https://api.github.com/users/Eternity-again/followers","following_url":"https://api.github.com/users/Eternity-again/following{/other_user}","gists_url":"https://api.github.com/users/Eternity-again/gists{/gist_id}","starred_url":"https://api.github.com/users/Eternity-again/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eternity-again/subscriptions","organizations_url":"https://api.github.com/users/Eternity-again/orgs","repos_url":"https://api.github.com/users/Eternity-again/repos","events_url":"https://api.github.com/users/Eternity-again/events{/privacy}","received_events_url":"https://api.github.com/users/Eternity-again/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T11:45:42Z","updated_at":"2019-01-02T11:45:42Z","author_association":"NONE","body":"Still no solution :-("}}
{"actor":{"display_login":"Eternity-again"}}