mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-27 21:04:15 +00:00
@@ -35,23 +35,11 @@ preferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def mainPage() {
|
def mainPage() {
|
||||||
if(canInstallLabs()) {
|
def bridges = bridgesDiscovered()
|
||||||
def bridges = bridgesDiscovered()
|
if (state.username && bridges) {
|
||||||
if (state.username && bridges) {
|
return bulbDiscovery()
|
||||||
return bulbDiscovery()
|
|
||||||
} else {
|
|
||||||
return bridgeDiscovery()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
def upgradeNeeded = """To use SmartThings Labs, your Hub should be completely up to date.
|
return bridgeDiscovery()
|
||||||
|
|
||||||
To update your Hub, access Location Settings in the Main Menu (tap the gear next to your location name), select your Hub, and choose "Update Hub"."""
|
|
||||||
|
|
||||||
return dynamicPage(name:"bridgeDiscovery", title:"Upgrade needed!", nextPage:"", install:false, uninstall: true) {
|
|
||||||
section("Upgrade") {
|
|
||||||
paragraph "$upgradeNeeded"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -765,10 +753,6 @@ private String convertHexToIP(hex) {
|
|||||||
[convertHexToInt(hex[0..1]),convertHexToInt(hex[2..3]),convertHexToInt(hex[4..5]),convertHexToInt(hex[6..7])].join(".")
|
[convertHexToInt(hex[0..1]),convertHexToInt(hex[2..3]),convertHexToInt(hex[4..5]),convertHexToInt(hex[6..7])].join(".")
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean canInstallLabs() {
|
|
||||||
return hasAllHubsOver("000.011.00603")
|
|
||||||
}
|
|
||||||
|
|
||||||
private Boolean hasAllHubsOver(String desiredFirmware) {
|
private Boolean hasAllHubsOver(String desiredFirmware) {
|
||||||
return realHubFirmwareVersions.every { fw -> fw >= desiredFirmware }
|
return realHubFirmwareVersions.every { fw -> fw >= desiredFirmware }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user