Closed miso-develop closed 3 years ago
Getting the same trying to connect to a bulb. const bulb = client.getBulb({host: '192.168.1.244'})
Uncaught TypeError: Cannot read property 'alias' of undefined
at Bulb.setSysInfo (C:\Users\joe\WebstormProjects\untitled\node_modules\tplink-smarthome-api\lib\device\index.js:98:59)
at Bulb.setSysInfo (C:\Users\joe\WebstormProjects\untitled\node_modules\tplink-smarthome-api\lib\bulb\index.js:123:15)
at new Bulb (C:\Users\joe\WebstormProjects\untitled\node_modules\tplink-smarthome-api\lib\bulb\index.js:109:14)
at Client.getBulb (C:\Users\joe\WebstormProjects\untitled\node_modules\tplink-smarthome-api\lib\client.js:166:16)
Since v3, using getPlug or getBulb require you to pass in the sysinfo for the device. Its preferred to use client#getDevice which does not have that requirement. I've corrected the example that was broken since v3.
When running examples/plug-turn-on-off.js on Smart Plug HS105, the following error occurs.
Version
Execution environment
case1
case2
Workaround
Install v2.0.0
etc
CLI(
npx tplink-smarthome-api search
) also worked with v3.1.0.