forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[twitter] rename binding to X (openhab#15809)
Signed-off-by: Leo Siepel <[email protected]>
- Loading branch information
Showing
19 changed files
with
228 additions
and
274 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
bundles/org.openhab.binding.twitter/src/main/resources/OH-INF/i18n/twitter.properties
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
bundles/org.openhab.binding.twitter/src/main/resources/OH-INF/i18n/twitter_fr.properties
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
bundles/org.openhab.binding.twitter/src/main/resources/OH-INF/i18n/twitter_ru.properties
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,60 @@ | ||
# X Binding | ||
|
||
The X (formerly known as Twitter) binding allows your home to post 280 characters at a time. It also supports direct messages and posting with media. | ||
|
||
## Supported Things | ||
|
||
```text | ||
account - X Account. | ||
``` | ||
|
||
## Thing Configuration | ||
|
||
The X Account Thing requires you to create a X App in the X Developer Page. | ||
|
||
| Property | Default | Required | Description | | ||
|-------------------|---------|:--------:|-----------------------------------| | ||
| consumerKey | | Yes | Consumer API Key | | ||
| consumerSecret | | Yes | Consumer API Secret | | ||
| accessToken | | Yes | Access Token | | ||
| accessTokenSecret | | Yes | Access Token Secret | | ||
| refresh | 30 | No | Post refresh interval in minutes | | ||
|
||
## Channels | ||
|
||
| channel | type | description | | ||
|----------|--------|-----------------------------------------------| | ||
| lastpost | String | This channel provides the Latest post message | | ||
|
||
## Full Example | ||
|
||
x.things: | ||
|
||
```java | ||
Thing x:account:sampleaccount [ consumerKey="11111", consumerSecret="22222", accessToken="33333", accessTokenSecret="444444" ] | ||
``` | ||
|
||
x.items: | ||
|
||
```java | ||
String sample_post "Latest post: [%s]" { channel="x:account:sampleaccount:lastpost" } | ||
``` | ||
|
||
## Rule Action | ||
|
||
This binding includes rule actions for sending posts and direct messages. | ||
|
||
- `boolean success = sendPost(String text)` | ||
- `boolean success = sendPostWithAttachment(String text, String URL)` | ||
- `boolean success = sendDirectMessage(String recipientID, String text)` | ||
|
||
Examples: | ||
|
||
```java | ||
val postActions = getActions("x","x:account:sampleaccount") | ||
val success = postActions.sendPost("This is A Post") | ||
val success2 = postActions.sendPostWithAttachment("This is A Post with a Pic", file:///tmp/201601011031.jpg) | ||
val success3 = postActions.sendPostWithAttachment("Windows Picture", "D:\\Test.png" ) | ||
val success4 = postActions.sendPostWithAttachment("HTTP Picture", "http://www.mywebsite.com/Test.png" ) | ||
val success5 = postActions.sendDirectMessage("1234567", "Wake Up" ) | ||
``` |
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
6 changes: 3 additions & 3 deletions
6
...ding.twitter/src/main/feature/feature.xml → ...ab.binding.x/src/main/feature/feature.xml
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.binding.twitter-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"> | ||
<features name="org.openhab.binding.x-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"> | ||
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> | ||
|
||
<feature name="openhab-binding-twitter" description="Twitter Binding" version="${project.version}"> | ||
<feature name="openhab-binding-x" description="X Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.twitter/${project.version}</bundle> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.x/${project.version}</bundle> | ||
</feature> | ||
</features> |
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.