From 5b68ea604370e691268efc4f986d6b45511bcc23 Mon Sep 17 00:00:00 2001 From: Seyed Amir Hossein Aqajari Date: Mon, 5 Aug 2019 13:43:59 -0700 Subject: [PATCH] Update gideon-smart-home.groovy --- official/gideon-smart-home.groovy | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/official/gideon-smart-home.groovy b/official/gideon-smart-home.groovy index a198d72..a4a6a67 100755 --- a/official/gideon-smart-home.groovy +++ b/official/gideon-smart-home.groovy @@ -78,26 +78,6 @@ preferences { } } -def installed() { - log.debug "Installed with settings: ${settings}" - - initialize() -} - -def updated() { - log.debug "Updated with settings: ${settings}" - - unsubscribe() - initialize() -} - -def initialize() { -} - -private device(it, type) { - it ? [id: it.id, label: it.label, type: type] : null -} - //API Mapping mappings { path("/getalldevices") { @@ -284,6 +264,27 @@ mappings { } } +def installed() { + log.debug "Installed with settings: ${settings}" + + initialize() +} + +def updated() { + log.debug "Updated with settings: ${settings}" + + unsubscribe() + initialize() +} + +def initialize() { +} + +private device(it, type) { + it ? [id: it.id, label: it.label, type: type] : null +} + + //API Methods def getAllDevices() { def locks_list = locks.collect{device(it,"Lock")} @@ -791,4 +792,4 @@ def getTempSensorsStatus(id) { def bat = getBatteryStatus(device.id) return [temperature: device.currentValue('temperature')] + bat } - } \ No newline at end of file + } -- 2.34.1