Closed berenteb closed 2 years ago
Nearly all the commands return a promise. You would either use .catch() or try-catch with await. If you're specifically referring to startDiscovery it emits an "error" event as listed in the documentation: https://plasticrake.github.io/tplink-smarthome-api/classes/client.html#startdiscovery
I couldn't find any documentation related to error/timeout handling. I'm writing a Homebridge plugin with this API (I know TP-Link plugin already exists, I'm creating a TV accessory). Homebridge will probably freeze if the selected device is offline or not found. I'll add a config field to set the plug mac of the TV, so I've set the mac address filter in the startDiscovery function.