Code by Scott שאול בן ישוע
Verified Commit ab9c817b authored by Sha'ul ben Yeshua's avatar Sha'ul ben Yeshua 🎗
Browse files

fix for hub restarts

parent 22887244
......@@ -8,12 +8,15 @@
* Code re-use permission given by Stephan Hackett @stephack
*
* Modified for Inovelli Scene control by Scott Grayban (Scott_Inovelli)
************************************************************************
*
* 02/26/20 - Forced initialization on hub restart to avoid delays on "first activation". Thank you @ogiewon for the suggestion.
*
*/
import hubitat.helper.RMUtils
def version(){"v1.0"}
def version(){"v1.1"}
definition(
name: "Inovelli Scene Creator Child",
......@@ -270,6 +273,7 @@ def initialize() {
if(logEnable) log.debug "INITIALIZED with settings: ${settings}"
if(logEnable) log.debug app.label
if(!app.label || app.label == "default")app.updateLabel(defaultLabel())
subscribe(location, "systemStart", hubRestartHandler)
subscribe(buttonDevice, "pushed", buttonEvent)
subscribe(buttonDevice, "held", buttonEvent)
subscribe(buttonDevice, "doubleTapped", buttonEvent)
......@@ -279,7 +283,7 @@ def initialize() {
}
def defaultLabel() {
return "${buttonDevice} Mapping"
return "${buttonDevice} Scene"
}
def getPrefDetails(){
......@@ -349,6 +353,10 @@ def checkForUpdate(){
}
}
def hubRestartHandler(evt) {
if(logEnable) log.debug "ABC [$app.label]Initialized: Hub Restart"
}
def buttonEvent(evt) {
if(allOk) {
def buttonNumber = evt.value
......@@ -558,7 +566,7 @@ def changeMode(mode) {
if (location.mode != mode && location.modes?.find { it.name == mode}) setLocationMode(mode)
}
def cycleFan(devices) { //all fans will sync speeds with fisrt fan in the list
def cycleFan(devices) { //all fans will sync speeds with first fan in the list
log.info "Cycling: $devices"
def mySpeed = devices[0].currentSpeed
if(mySpeed == "off") devices.setSpeed("low")
......
......@@ -8,7 +8,7 @@
* Modified for Inovelli Scene control by Scott Grayban (Scott_Inovelli)
*
*/
def version(){"v1.0"}
def version(){"v1.1"}
definition(
name: "Inovelli Scene Creator",
......
{
"currVersion": "v1.0",
"currVersion": "v1.1",
"rawCode":
"<small><a href='http://sgrayban.borgnet.online:8081/inovelli-scene-creator/apps/Inovelli-Scene-Creator/Inovelli-Scene-Creator-Child.groovy' target='_blank'> [Raw Code]</a></small>",
......
{
"currVersion": "v1.0",
"currVersion": "v1.1",
"rawCode":
"<small><a href='http://sgrayban.borgnet.online:8081/inovelli-scene-creator/apps/Inovelli-Scene-Creator/Inovelli-Scene-Creator.groovy' target='_blank'> [Raw Code]</a></small>",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment