mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-16 21:03:28 +00:00
Compare commits
19 Commits
PROD_2017.
...
PROD_2017.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f752a01906 | ||
|
|
505ec4ff0f | ||
|
|
fe0f555f10 | ||
|
|
42353044e6 | ||
|
|
78f06a0b9d | ||
|
|
7f13dd356d | ||
|
|
4042bbbf98 | ||
|
|
20407441d9 | ||
|
|
52925d6d99 | ||
|
|
e6c17131af | ||
|
|
cc70865fbf | ||
|
|
e53d9c910c | ||
|
|
c13014936b | ||
|
|
d6b0f6a8ed | ||
|
|
62c810ba90 | ||
|
|
0b81793b0f | ||
|
|
fb8e4a2416 | ||
|
|
320c8918f8 | ||
|
|
0f3656cd12 |
18
build.gradle
18
build.gradle
@@ -9,7 +9,7 @@ apply plugin: 'smartthings-slack'
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.smartthings.deployment:executable-deployment-scripts:1.0.11"
|
classpath "com.smartthings.deployment:executable-deployment-scripts:1.0.12"
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@@ -19,7 +19,7 @@ buildscript {
|
|||||||
username smartThingsArtifactoryUserName
|
username smartThingsArtifactoryUserName
|
||||||
password smartThingsArtifactoryPassword
|
password smartThingsArtifactoryPassword
|
||||||
}
|
}
|
||||||
url "https://artifactory.smartthings.com/libs-release-local"
|
url "https://smartthings.jfrog.io/smartthings/libs-release-local"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ repositories {
|
|||||||
username smartThingsArtifactoryUserName
|
username smartThingsArtifactoryUserName
|
||||||
password smartThingsArtifactoryPassword
|
password smartThingsArtifactoryPassword
|
||||||
}
|
}
|
||||||
url "https://artifactory.smartthings.com/libs-release-local"
|
url "https://smartthings.jfrog.io/smartthings/libs-release-local"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,10 +51,10 @@ sourceSets {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
devicetypesCompile 'org.codehaus.groovy:groovy-all:2.4.7'
|
devicetypesCompile 'org.codehaus.groovy:groovy-all:2.4.7'
|
||||||
devicetypesCompile 'smartthings:appengine-z-wave:0.1.2'
|
devicetypesCompile 'smartthings:appengine-z-wave:0.1.3'
|
||||||
devicetypesCompile 'smartthings:appengine-zigbee:0.1.11'
|
devicetypesCompile 'smartthings:appengine-zigbee:0.1.12'
|
||||||
smartappsCompile 'org.codehaus.groovy:groovy-all:2.4.7'
|
smartappsCompile 'org.codehaus.groovy:groovy-all:2.4.7'
|
||||||
smartappsCompile 'smartthings:appengine-common:0.1.8'
|
smartappsCompile 'smartthings:appengine-common:0.1.9'
|
||||||
smartappsCompile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
|
smartappsCompile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
|
||||||
smartappsCompile 'org.grails:grails-web:2.3.11'
|
smartappsCompile 'org.grails:grails-web:2.3.11'
|
||||||
smartappsCompile 'org.json:json:20140107'
|
smartappsCompile 'org.json:json:20140107'
|
||||||
@@ -74,19 +74,19 @@ slackSendMessage {
|
|||||||
String username
|
String username
|
||||||
switch (branch) {
|
switch (branch) {
|
||||||
case 'master':
|
case 'master':
|
||||||
username = 'Hickory'
|
username = 'DEV'
|
||||||
iconUrl = wolverine
|
iconUrl = wolverine
|
||||||
color = '#35D0F2'
|
color = '#35D0F2'
|
||||||
messageText = 'Began deployment of _SmartThingsPublic[master]_ branch to the _Dev_ environments.'
|
messageText = 'Began deployment of _SmartThingsPublic[master]_ branch to the _Dev_ environments.'
|
||||||
break
|
break
|
||||||
case 'staging':
|
case 'staging':
|
||||||
username = 'Dickory'
|
username = 'STG'
|
||||||
iconUrl = beach
|
iconUrl = beach
|
||||||
color = '#FFDE20'
|
color = '#FFDE20'
|
||||||
messageText = 'Began deployment of _SmartThingsPublic[staging]_ branch to the _Staging_ environments.'
|
messageText = 'Began deployment of _SmartThingsPublic[staging]_ branch to the _Staging_ environments.'
|
||||||
break
|
break
|
||||||
case 'production':
|
case 'production':
|
||||||
username = 'Dock'
|
username = 'PRD'
|
||||||
iconUrl = drinks
|
iconUrl = drinks
|
||||||
color = '#FF1D23'
|
color = '#FF1D23'
|
||||||
messageText = 'Began deployment of _SmartThingsPublic[production]_ branch to the _Prod_ environments.'
|
messageText = 'Began deployment of _SmartThingsPublic[production]_ branch to the _Prod_ environments.'
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ metadata {
|
|||||||
|
|
||||||
// tile definitions
|
// tile definitions
|
||||||
tiles(scale: 2) {
|
tiles(scale: 2) {
|
||||||
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
||||||
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
|
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
|
||||||
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
||||||
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
|
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC"
|
||||||
@@ -48,14 +48,16 @@ metadata {
|
|||||||
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "valve"
|
main "contact"
|
||||||
details(["valve","refresh"])
|
details(["contact","refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def installed(){
|
def installed(){
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
||||||
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|
||||||
|
response(refresh())
|
||||||
}
|
}
|
||||||
|
|
||||||
def updated(){
|
def updated(){
|
||||||
@@ -85,11 +87,17 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def open() {
|
def open() {
|
||||||
zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format()
|
delayBetween([
|
||||||
|
zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format(),
|
||||||
|
zwave.switchBinaryV1.switchBinaryGet().format()
|
||||||
|
], 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
def close() {
|
def close() {
|
||||||
zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format()
|
delayBetween([
|
||||||
|
zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format(),
|
||||||
|
zwave.switchBinaryV1.switchBinaryGet().format()
|
||||||
|
], 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,6 +113,6 @@ def refresh() {
|
|||||||
|
|
||||||
def createEventWithDebug(eventMap) {
|
def createEventWithDebug(eventMap) {
|
||||||
def event = createEvent(eventMap)
|
def event = createEvent(eventMap)
|
||||||
log.debug "Event created with ${event?.descriptionText}"
|
log.debug "Event created with ${event?.name}:${event?.value} - ${event?.descriptionText}"
|
||||||
return event
|
return event
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ def arrived() {
|
|||||||
|
|
||||||
|
|
||||||
def departed() {
|
def departed() {
|
||||||
log.trace "Executing 'arrived'"
|
log.trace "Executing 'departed'"
|
||||||
sendEvent(name: "presence", value: "not present")
|
sendEvent(name: "presence", value: "not present")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ metadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tiles(scale: 2) {
|
tiles(scale: 2) {
|
||||||
multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4, canChangeIcon: true){
|
||||||
tileAttribute ("device.valve", key: "PRIMARY_CONTROL") {
|
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
|
||||||
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening"
|
||||||
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing"
|
||||||
@@ -58,8 +58,8 @@ metadata {
|
|||||||
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
|
||||||
main(["valve"])
|
main(["contact"])
|
||||||
details(["valve", "battery", "refresh"])
|
details(["contact", "battery", "refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,10 @@ def registerDeviceChange() {
|
|||||||
state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt])
|
state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt])
|
||||||
log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}"
|
log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}"
|
||||||
} else if (!state.deviceSubscriptionMap[deviceId].contains(subscriptionEndpt)) {
|
} else if (!state.deviceSubscriptionMap[deviceId].contains(subscriptionEndpt)) {
|
||||||
state.deviceSubscriptionMap[deviceId] << subscriptionEndpt
|
// state.deviceSubscriptionMap[deviceId] << subscriptionEndpt
|
||||||
|
// For now, we will only have one subscription endpoint per device
|
||||||
|
state.deviceSubscriptionMap.remove(deviceId)
|
||||||
|
state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt])
|
||||||
log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}"
|
log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user