We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3149a80 + 97dacb6 commit 36ebcb5Copy full SHA for 36ebcb5
1 file changed
tools/wled-tools
@@ -141,8 +141,16 @@ discover_devices() {
141
exit 1
142
fi
143
144
- # Map avahi responses to strings seperated by 0x1F (unit separator)
145
- mapfile -t raw_devices < <(avahi-browse _wled._tcp --terminate -r -p | awk -F';' '/^=/ {print $7"\x1F"$8"\x1F"$9}')
+ # Map avahi responses to strings separated by 0x1F (unit separator), deduplicated
+ mapfile -t raw_devices < <(
146
+ avahi-browse _wled._tcp --terminate -r -p |
147
+ awk -F';' '
148
+ /^=/ {
149
+ key = $7 "\x1F" $8 "\x1F" $9
150
+ if (!seen[key]++) print key
151
+ }
152
+ '
153
+ )
154
155
local devices_array=()
156
for device in "${raw_devices[@]}"; do
0 commit comments