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 #17 from rlisle/SmartThings
MQTT support.
- Loading branch information
Showing
9 changed files
with
140 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,5 +72,5 @@ | |
} | ||
} | ||
], | ||
"version": 3 | ||
"version": 4 | ||
} |
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,22 @@ | ||
Copyright 2018 Ron Lisle | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the | ||
following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following | ||
disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote | ||
products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. | ||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,67 @@ | ||
# PatriotSmartThings | ||
|
||
A Patriot plugin to support SmartThings devices. | ||
|
||
This library is used to support SmartThings devices. | ||
It requires that the SmartThings MQTT Bridge be installed and working. | ||
|
||
## Usage | ||
|
||
Include this library in any Photon sketch that needs to support | ||
SmartThings devices. | ||
|
||
|
||
``` | ||
#include <IoT.h> | ||
#include <PatriotSmartThings.h> | ||
IoT *iot; | ||
void setup() { | ||
iot = IoT::getInstance(); | ||
iot->begin(); | ||
// Create your device | ||
SmartThingsDevice *deskLamp = new SmartThingsDevice("<SmartThingsName>", "<PatriotDeviceName>"); | ||
// Add it to IoT | ||
iot->addDevice(deskLamp); | ||
// Add any behaviors if appropriate | ||
iot->addBehavior(new Behavior(deskLamp, "Work at desk", '>', 0, 100)); | ||
... | ||
} | ||
void loop() { | ||
iot->loop(); | ||
} | ||
``` | ||
|
||
## Documentation | ||
|
||
Refer to the Patriot Github repository and documentation for more | ||
information. | ||
|
||
|
||
## Contributing | ||
|
||
Here's how you can make changes to this library and eventually contribute those changes back. | ||
|
||
To get started, [clone the library from GitHub to your local machine](https://help.github.com/articles/cloning-a-repository/). | ||
|
||
Change the name of the library in `library.properties` to something different. You can add your name at then end. | ||
|
||
Modify the sources in <src> and <examples> with the new behavior. | ||
|
||
To compile an example, use `particle compile examples/usage` command in [Particle CLI](https://docs.particle.io/guide/tools-and-features/cli#update-your-device-remotely) or use our [Desktop IDE](https://docs.particle.io/guide/tools-and-features/dev/#compiling-code). | ||
|
||
After your changes are done you can upload them with `particle library upload` or `Upload` command in the IDE. This will create a private (only visible by you) library that you can use in other projects. Do `particle library add IoT_myname` to add the library to a project on your machine or add the IoT_myname library to a project on the Web IDE or Desktop IDE. | ||
|
||
At this point, you can create a [GitHub pull request](https://help.github.com/articles/about-pull-requests/) with your changes to the original library. | ||
|
||
If you wish to make your library public, use `particle library publish` or `Publish` command. | ||
|
||
## LICENSE | ||
Copyright 2018 Ron Lisle | ||
|
||
Refer to the included LICENSE file. |
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,11 @@ | ||
name=PatriotSmartThings | ||
version=2.1.0 | ||
author=Ron Lisle | ||
license=MIT | ||
sentence=Extend Patriot IoT to support SmartThings devices. | ||
paragraph=Patriot provides support for controlling IoT devices using Alexa and iOS devices. This plugin adds the ability to add SmartThings devices. It requires the MQTT SmartThings Bridge. | ||
url=Lisles.net | ||
repository=https://github.com/rlisle/Patriot | ||
architectures=particle-photon | ||
# Update dependencies to the latest, or the version that you've tested with. | ||
dependencies.IoT=2.2.1 |
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 @@ | ||
../../../IoTlib/src/device.h |