forked from SmartThingsCommunity/SmartThingsPublic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request SmartThingsCommunity#975 from SmartThingsCommunity…
…/staging Rolling up staging to production
- Loading branch information
Showing
33 changed files
with
926 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
devicetypes/smartthings/hue-white-ambiance-bulb/hue-white-ambiance-bulb.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/** | ||
* Hue White Ambiance Bulb | ||
* | ||
* Philips Hue Type "Color Temperature Light" | ||
* | ||
* Author: SmartThings | ||
*/ | ||
|
||
// for the UI | ||
metadata { | ||
// Automatically generated. Make future change here. | ||
definition (name: "Hue White Ambiance Bulb", namespace: "smartthings", author: "SmartThings") { | ||
capability "Switch Level" | ||
capability "Actuator" | ||
capability "Color Temperature" | ||
capability "Switch" | ||
capability "Refresh" | ||
|
||
command "refresh" | ||
} | ||
|
||
simulator { | ||
// TODO: define status and reply messages here | ||
} | ||
|
||
tiles (scale: 2){ | ||
multiAttributeTile(name:"rich-control", type: "lighting", width: 6, height: 4, canChangeIcon: true){ | ||
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { | ||
attributeState "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff" | ||
attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn" | ||
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff" | ||
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn" | ||
} | ||
tileAttribute ("device.level", key: "SLIDER_CONTROL") { | ||
attributeState "level", action:"switch level.setLevel", range:"(0..100)" | ||
} | ||
} | ||
|
||
controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") { | ||
state "colorTemperature", action:"color temperature.setColorTemperature" | ||
} | ||
|
||
valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { | ||
state "colorTemperature", label: '${currentValue} K' | ||
} | ||
|
||
standardTile("refresh", "device.refresh", height: 2, width: 2, inactiveLabel: false, decoration: "flat") { | ||
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" | ||
} | ||
|
||
main(["rich-control"]) | ||
details(["rich-control", "colorTempSliderControl", "colorTemp", "refresh"]) | ||
} | ||
} | ||
|
||
// parse events into attributes | ||
def parse(description) { | ||
log.debug "parse() - $description" | ||
def results = [] | ||
|
||
def map = description | ||
if (description instanceof String) { | ||
log.debug "Hue Ambience Bulb stringToMap - ${map}" | ||
map = stringToMap(description) | ||
} | ||
|
||
if (map?.name && map?.value) { | ||
results << createEvent(name: "${map?.name}", value: "${map?.value}") | ||
} | ||
results | ||
} | ||
|
||
// handle commands | ||
void on() { | ||
log.trace parent.on(this) | ||
sendEvent(name: "switch", value: "on") | ||
} | ||
|
||
void off() { | ||
log.trace parent.off(this) | ||
sendEvent(name: "switch", value: "off") | ||
} | ||
|
||
void setLevel(percent) { | ||
log.debug "Executing 'setLevel'" | ||
if (percent != null && percent >= 0 && percent <= 100) { | ||
parent.setLevel(this, percent) | ||
sendEvent(name: "level", value: percent) | ||
sendEvent(name: "switch", value: "on") | ||
} else { | ||
log.warn "$percent is not 0-100" | ||
} | ||
} | ||
|
||
void setColorTemperature(value) { | ||
if (value) { | ||
log.trace "setColorTemperature: ${value}k" | ||
parent.setColorTemperature(this, value) | ||
sendEvent(name: "colorTemperature", value: value) | ||
sendEvent(name: "switch", value: "on") | ||
} else { | ||
log.warn "Invalid color temperature" | ||
} | ||
} | ||
|
||
void refresh() { | ||
log.debug "Executing 'refresh'" | ||
parent.manualRefresh() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
devicetypes/smartthings/smartsense-motion-sensor.src/.st-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.st-ignore | ||
README.md |
30 changes: 30 additions & 0 deletions
30
devicetypes/smartthings/smartsense-motion-sensor.src/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Smartsense Motion Sensor | ||
|
||
|
||
|
||
Works with: | ||
|
||
* [Samsung SmartThings Motion Sensor](https://shop.smartthings.com/#!/products/samsung-smartthings-motion-sensor) | ||
|
||
## Table of contents | ||
|
||
* [Capabilities](#capabilities) | ||
* [Health]($health) | ||
|
||
## Capabilities | ||
|
||
* **Configuration** - _configure()_ command called when device is installed or device preferences updated | ||
* **Motion Sensor** - can detect motion | ||
* **Battery** - defines device uses a battery | ||
* **Refresh** - _refresh()_ command for status updates | ||
* **Health Check** - indicates ability to get device health notifications | ||
|
||
## Device Health | ||
|
||
A Category C2 motion sensor that has 120min check-in interval | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Device Tiles Examples and Reference | ||
|
||
This package contains examples of Device tiles, organized by tile type. | ||
|
||
## Purpose | ||
|
||
Each Device Handler shows example usages of a specific tile, and is meant to represent the variety of permutations that a tile can be configured. | ||
|
||
The various tiles can be used by QA to test tiles on all supported mobile devices, and by developers as a reference implementation. | ||
|
||
## Installation | ||
|
||
1. Self-publish the Device Handlers in this package. | ||
2. Self-publish the Device Tile Controller SmartApp. The SmartApp can be found [here](https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/smartapps/smartthings/tile-ux/device-tile-controller.src/device-tile-controller.groovy). | ||
3. Install the SmartApp from the Marketplace, under "My Apps". | ||
4. Select the simulated devices you want to install and press "Done". | ||
|
||
The simulated devices can then be found in the "Things" view of "My Home" in the mobile app. | ||
You may wish to create a new room for these simulated devices for easy access. | ||
|
||
## Usage | ||
|
||
Each simulated device can be interacted with like other devices. | ||
You can use the mobile app to interact with the tiles to see how they look and behave. | ||
|
||
## Troubleshooting | ||
|
||
If you get an error when installing the simulated devices using the controller SmartApp, ensure that you have published all the Device Handlers for yourself. | ||
Also check live logging to see if there is a specific tile that is causing installation issues. | ||
|
||
## FAQ | ||
|
||
*Question: A tile isn't behaving as expected. What should I do?* | ||
|
||
QA should create a JIRA ticket for any issues or inconsistencies of tiles across devices. | ||
|
||
Developers may file a support ticket, and reference the specific tile and issue observed. | ||
|
||
*Question: I'd like to contribute an example tile usage that would be helpful for testing and reference purposes. Can I do that?* | ||
|
||
We recommend that you open an issue in the SmartThingsPublic repository describing the example tile and usage. | ||
That way we can discuss with you the proposed change, and then if appropriate you can create a PR associated to the issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.