aboutsummaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2018-04-08 17:09:55 +0100
committerJames Barnett <noreply@jamesbarnett.xyz>2018-04-08 17:09:55 +0100
commitc72ea6660d06ac347feafd6cbb8b3dc3c0f95c43 (patch)
tree181c687d429aca4dab6efc8c07e3f94a6a4283df /services
parent0bbe22dd69bbb149e9fed74c87e7fc75e181483e (diff)
downloadtplink-energy-monitor-c72ea6660d06ac347feafd6cbb8b3dc3c0f95c43.tar.xz
tplink-energy-monitor-c72ea6660d06ac347feafd6cbb8b3dc3c0f95c43.zip
Improve layout on mobile devices and tablets
Diffstat (limited to 'services')
-rw-r--r--services/device-manager.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/device-manager.js b/services/device-manager.js
index d1d81a1..e4d18f3 100644
--- a/services/device-manager.js
+++ b/services/device-manager.js
@@ -3,7 +3,10 @@ const { Client } = require('tplink-smarthome-api');
const client = new Client();
var devices = [];
-client.startDiscovery({deviceTypes: ['plug']}).on('plug-new', plug => {
+client.startDiscovery({
+ deviceTypes: ['plug'],
+ discoveryTimeout: 20000
+ }).on('plug-new', plug => {
console.log('Found device: ' + plug.alias + ' [' + plug.deviceId + ']');
devices.push(plug);
});