Skip to content

Commit 87b6715

Browse files
committed
Handle incorrect mac address reporting
1 parent d6a9631 commit 87b6715

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

smartapps/smartthings/hue-connect.src/hue-connect.groovy

+5
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,11 @@ private getBridgeIP() {
722722
if (host == null || host == "") {
723723
def serialNumber = selectedHue
724724
def bridge = getHueBridges().find { it?.value?.serialNumber?.equalsIgnoreCase(serialNumber) }?.value
725+
if (!bridge) {
726+
//failed because mac address sent from hub is wrong and doesn't match the hue's real mac address and serial number
727+
//in this case we will look up the bridge by comparing the incorrect mac addresses
728+
bridge = getHueBridges().find { it?.value?.mac?.equalsIgnoreCase(serialNumber) }?.value
729+
}
725730
if (bridge?.ip && bridge?.port) {
726731
if (bridge?.ip.contains("."))
727732
host = "${bridge?.ip}:${bridge?.port}"

0 commit comments

Comments
 (0)