mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-15 21:03:23 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3dbc37d96 | ||
|
|
48b5d0703e |
@@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* SCANNER SMARTTHINGS APPS
|
||||||
|
*
|
||||||
|
* Copyright 2015 kathiresan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
definition(
|
||||||
|
name: "SCANNER SMARTTHINGS APPS",
|
||||||
|
namespace: "NetworkScanner",
|
||||||
|
author: "kathiresan",
|
||||||
|
description: "Network Scanner Smartthings Apps",
|
||||||
|
category: "My Apps",
|
||||||
|
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
||||||
|
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||||
|
iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||||
|
oauth: true)
|
||||||
|
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
section("Title") {
|
||||||
|
// TODO: put inputs here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
log.debug "Installed with settings: ${settings}"
|
||||||
|
def hub = location.hubs[0]
|
||||||
|
initialize()
|
||||||
|
log.debug "id: ${hub.id}"
|
||||||
|
log.debug "zigbeeId: ${hub.zigbeeId}"
|
||||||
|
log.debug "zigbeeEui: ${hub.zigbeeEui}"
|
||||||
|
|
||||||
|
// PHYSICAL or VIRTUAL
|
||||||
|
log.debug "type: ${hub.type}"
|
||||||
|
|
||||||
|
log.debug "name: ${hub.name}"
|
||||||
|
log.debug "firmwareVersionString: ${hub.firmwareVersionString}"
|
||||||
|
log.debug "localIp: ${hub.localIP}"
|
||||||
|
log.debug "localSrvPortTCP: ${hub.localSrvPortTCP}"
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "Updated with settings: ${settings}"
|
||||||
|
|
||||||
|
unsubscribe()
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
def initialize() {
|
||||||
|
// TODO: subscribe to attributes, devices, locations, etc.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mappings {
|
||||||
|
path("/HubInfo") {
|
||||||
|
action: [
|
||||||
|
GET: "hubInfo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// returns a list like
|
||||||
|
// [[name: "kitchen lamp", value: "off"], [name: "bathroom", value: "on"]]
|
||||||
|
def hubInfo() {
|
||||||
|
|
||||||
|
def hub = location.hubs[0]
|
||||||
|
return "localIp: ${hub.localIP}"
|
||||||
|
}
|
||||||
|
// TODO: implement event handlers
|
||||||
Reference in New Issue
Block a user