You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { TradfriClient/*, more imports */ } from"node-tradfri-client";
113
+
import { discoverGateway, TradfriClient/*, more imports */ } from"node-tradfri-client";
114
+
```
115
+
116
+
### Auto-detect your gateway
117
+
You can automatically discover a Trådfri gateway on the local network with the `discoverGateway` method. Discovery will return the first gateway found, finding multiple ones is not possible yet.
The timeout parameter is the time in milliseconds (default 10000) the discovery will run before returning `null` to indicate that no gateway was found. By passing a negative value or `false` you can instruct the discovery to run *forever*.
126
+
127
+
The return value is of the type `DiscoveredGateway` which looks as follows:
128
+
```ts
129
+
{
130
+
// hostname of the gateway, has the form "gw-abcdef012345"
0 commit comments