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
feat: Added support for user defined host UDP port and IP address
Modified discover function signatures so that `options` is the first parameter and it can also be a number (`timeout`) to provide backwards compatibility
fix#20
Tries to discover all available HEOS devices in the network. When `timeout` milliseconds have passed the search will end. Every time a HEOS device is discovered `onDiscover(address)` will be triggered, where `address` is the ip-address of the device found. When the search ends `onTimeout(addresses[])` will be triggered with an array with all the devices found.
85
+
Tries to discover all available HEOS devices in the network. `port` and `address` of `options` is for connecting to a user specified network interface. When `options.timeout` or `options` (type `number`) milliseconds have passed the search will end. Every time a HEOS device is discovered `onDiscover(address)` will be triggered, where `address` is the ip-address of the device found. When the search ends `onTimeout(addresses[])` will be triggered with an array with all the devices found.
86
86
87
87
The function does not return a value.
88
88
89
89
```js
90
-
heos.discoverDevices(5000, console.log)
91
-
// Logs out the addresses of every HEOS device in the network
Finds one HEOS device in the network. A promise is returned that will resolve when the first device is found, or reject if no devices are found before `timeout` milliseconds have passed. If the function resolves it will resolve with the address of the HEOS device found.
98
+
Finds one HEOS device in the network. `port` and `address` of `options` is for connecting to a user specified network interface. A promise is returned that will resolve when the first device is found, or reject if no devices are found before `options.timeout` or `options` (type `number`) milliseconds have passed. If the function resolves it will resolve with the address of the HEOS device found.
Finds one HEOS device in the network, and connects to it. A promise is returned that will resolve when the first device is found, or reject if no devices are found before `timeout` milliseconds have passed. If the function resolves it will resolve with a HeosConnection.
111
+
Finds one HEOS device in the network, and connects to it. `port` and `address` of `options` is for connecting to a user specified network interface. A promise is returned that will resolve when the first device is found, or reject if no devices are found before `options.timeout` or `options` (type `number`) milliseconds have passed. If the function resolves it will resolve with a HeosConnection.
@@ -65,10 +75,12 @@ export function discoverDevices(
65
75
66
76
/**
67
77
* Finds one HEOS device in the network.
68
-
* @paramtimeout Will stop searching for a HEOS device when `timeout` milliseconds has ellapsed.
78
+
* @paramoptions Options for discovering a device.
69
79
* @returns A promise that will resolve when the first device is found, or reject if no devices are found before `timeout` milliseconds have passed. If the function resolves it will resolve with the address of the HEOS device found.
* Finds one HEOS device in the network, and connects to it.
97
-
* @paramtimeout Will stop searching for a HEOS device when `timeout` milliseconds has ellapsed.
109
+
* @paramoptions Options for discovering a device.
98
110
* @returns A promise that will resolve when the first device is found, or reject if no devices are found before `timeout` milliseconds have passed. If the function resolves it will resolve with a HeosConnection.
0 commit comments