Compare commits

..

5 Commits

6 changed files with 67 additions and 38 deletions

View File

@@ -120,15 +120,6 @@ def configure() {
return cmd
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 4)
}

View File

@@ -109,15 +109,6 @@ def configure() {
return cmds
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 4)
}

View File

@@ -183,15 +183,6 @@ def updateState(String name, String value) {
device.updateDataValue(name, value)
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 3)
}

View File

@@ -57,7 +57,6 @@ def parse(String description) {
private Map parseBasicMessage(description) {
def name = parseName(description)
def results = [:]
if (name != null) {
def value = parseValue(description)
def linkText = getLinkText(device)
@@ -65,7 +64,7 @@ private Map parseBasicMessage(description) {
def handlerName = value
def isStateChange = isStateChange(device, name, value)
results = [
def results = [
name : name,
value : value,
linkText : linkText,
@@ -74,6 +73,8 @@ private Map parseBasicMessage(description) {
isStateChange : isStateChange,
displayed : displayed(description, isStateChange)
]
} else {
results = [:]
}
log.debug "Parse returned $results.descriptionText"
return results

View File

@@ -126,15 +126,6 @@ private hold(button) {
sendEvent(name: "button", value: "held", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was held", isStateChange: true)
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 4)
}

View File

@@ -0,0 +1,64 @@
/**
* Ventilation Guru
*
* Copyright 2016 Tom Lawson
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
*/
definition(
name: "Ventilation Guru",
namespace: "LawsonAutomation",
author: "Tom Lawson",
description: "This was a mistaken publication.",
category: "Green Living",
iconUrl: "https://raw.githubusercontent.com/lawsonautomation/icons/master/guru-60.png",
iconX2Url: "https://raw.githubusercontent.com/lawsonautomation/icons/master/guru-120.png",
iconX3Url: "https://raw.githubusercontent.com/lawsonautomation/icons/master/guru-120.png")
preferences {
page(name: "mainPage")
}
def mainPage() {
state.debugMode = false
dynamicPage(name: "mainPage", install: true, uninstall: true) {
}
}
def installed() {
LOG "Installed with settings: ${settings}"
initialize()
}
def updated() {
LOG "Updated with settings: ${settings}"
unschedule()
unsubscribe()
initialize()
}
// initiallization methods
def initialize() {
}
def LOG(String text) {
if (state.debugMode) {
log.debug(text)
}
}