-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[amazonechocontrol] Initial contribution for the Amazon Echo Control Binding (#3083) #3087
Changes from 2 commits
7d97f67
c73afb9
3812b09
92a04d7
7cc41ba
a14859c
6e1941e
dffe04c
adec353
7f5cfa1
5e5b913
3d2dfe2
7acb509
d42b52e
b3148a8
a48e1fa
9229be2
0664c0e
d31595b
cbdcf76
e83e845
6fbf8ea
2ca24c8
e90b9f4
87bfddb
011734a
b0d7cc5
52ca33e
0752d68
c7dd651
6945fdd
5cae50f
edc38e3
339b5e3
563bdba
e8d8f2f
bf57fac
0246673
ae0346e
05978c1
53046c2
6d590f0
d0b21f3
19c7d53
cf8b5dc
c2dfa61
90fc5d3
b7332a8
5a95a10
4d7c603
e53330e
8c3913c
296dbf4
7103e62
19a430f
c93df72
22bdc27
eede1de
d03fdb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.binding.amazonechocontrol</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ds.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<binding:binding id="amazonechocontrol" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> | ||
|
||
<name>Amazon Echo Control Binding</name> | ||
<description>Binding for controlling Amazon Echo (Alexa). This binding enables openhab to control the volume, playing state, bluetooth connection of your amazon echo devices. | ||
</description> | ||
<author>Michael Geramb</author> | ||
|
||
|
||
</binding:binding> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# FIXME: please substitute the xx_XX with a proper locale, ie. de_DE | ||
# FIXME: please do not add the file to the repo if you add or change no content | ||
# binding | ||
binding.amazonechocontrol.name = <Your localized Binding name> | ||
binding.amazonechocontrol.description = <Your localized Binding description> | ||
|
||
# thing types | ||
thing-type.amazonechocontrol.sample.label = <Your localized Thing label> | ||
thing-type.amazonechocontrol.sample.description = <Your localized Thing description> | ||
|
||
# channel types | ||
channel-type.amazonechocontrol.sample-channel.label = <Your localized Channel label> | ||
channel-type.amazonechocontrol.sample-channel.description = <Your localized Channel description> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<thing:thing-descriptions bindingId="amazonechocontrol" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> | ||
|
||
|
||
<bridge-type id="account"> | ||
<label>Amazon Account</label> | ||
<description>Amazon Account where your amazon echo is registered.</description> | ||
|
||
<config-description> | ||
<parameter name="amazonSite" type="text" required="true"> | ||
<default></default> | ||
<label>Amazon site</label> | ||
<default></default> | ||
<limitToOptions>false</limitToOptions> | ||
<options> | ||
<option value="amazon.de">amazon.de</option> | ||
<option value="amazon.com">amazon.com</option> | ||
<option value="amazon.ca">amazon.ca</option> | ||
<option value="amazon.it">amazon.it</option> | ||
<option value="amazon.fr">amazon.fr</option> | ||
<option value="amazon.co.uk">amazon.co.uk</option> | ||
</options> | ||
<description>Select the site where your amazon account is created.</description> | ||
</parameter> | ||
|
||
<parameter name="email" type="text" required="true"> | ||
<default></default> | ||
<label>Amazon account email</label> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the bridge is called "Amazon Account", I would think that "Email address" would be better here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
<description>Enter the email address of the amazon account which is used for the amazon echo devices. Note: 2 factor authentication is currently not supported.</description> | ||
</parameter> | ||
<parameter name="password" type="text" required="true"> | ||
<default></default> | ||
<context>password</context> | ||
<label>Amazon account password</label> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -> Password There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
<description>Enter the password of the amazon account which is used for the amazon echo devices.</description> | ||
</parameter> | ||
<parameter name="pollingIntervalInSeconds" type="integer" min="10" max="65535" required="true" unit="s"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not required as you have a default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it save to remove the required? I though the default is only the default value for the user and the value can be removed. |
||
<default>60</default> | ||
<label>Refresh state interval</label> | ||
<description>Refresh state interval in seconds. Lower time causes more network traffic.</description> | ||
<unitLabel>Seconds</unitLabel> | ||
</parameter> | ||
|
||
|
||
</config-description> | ||
|
||
</bridge-type> | ||
|
||
|
||
|
||
<thing-type id="echo"> | ||
<supported-bridge-type-refs> | ||
<bridge-type-ref id="account" /> | ||
</supported-bridge-type-refs> | ||
|
||
|
||
<label>Amazon Echo</label> | ||
<description>Amazon Echo device (Amazon Echo, Amazon Echo Dot, Amazon Echo Plus...)</description> | ||
|
||
|
||
<channels> | ||
<channel id="player" typeId="player"/> | ||
<channel id="volume" typeId="volume"/> | ||
<channel id="shuffle" typeId="shuffle"/> | ||
<channel id="imageUrl" typeId="imageUrl"/> | ||
<channel id="title" typeId="title"/> | ||
<channel id="subtitle1" typeId="subtitle1"/> | ||
<channel id="subtitle2" typeId="subtitle2"/> | ||
<channel id="providerDisplayName" typeId="providerDisplayName"/> | ||
<channel id="bluetoothId" typeId="bluetoothId"/> | ||
<channel id="bluetooth" typeId="bluetooth"/> | ||
<channel id="bluetoothDeviceName" typeId="bluetoothDeviceName"/> | ||
<channel id="radioStationId" typeId="radioStationId"/> | ||
<channel id="radio" typeId="radio"/> | ||
</channels> | ||
|
||
|
||
<representation-property>serialNumber</representation-property> | ||
|
||
<config-description> | ||
<parameter name="serialNumber" type="text" required="true"> | ||
<label>Serial Number</label> | ||
<description>You will find the serial number of your device in the Alexa app</description> | ||
</parameter> | ||
</config-description> | ||
|
||
</thing-type> | ||
|
||
|
||
<channel-type id="bluetoothDeviceName"> | ||
<item-type>String</item-type> | ||
<label>Bluetooth device</label> | ||
<description>Connected bluetooth device</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
<channel-type id="radioStationId"> | ||
<item-type>String</item-type> | ||
<label>Radio station id</label> | ||
<description>Id of the radio station</description> | ||
</channel-type> | ||
|
||
<channel-type id="name"> | ||
<item-type>String</item-type> | ||
<label>Name</label> | ||
<description>Name of Alexa</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
<channel-type id="providerDisplayName"> | ||
<item-type>String</item-type> | ||
<label>Provider Name</label> | ||
<description>Name of music provider</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
|
||
<channel-type id="bluetoothId"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this channel be written or is it read only? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @htreu There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What does it mean if you write a MAC address to this channel? What will happen? Isn't rather the bluetoothIdSelection the writable channel? |
||
<item-type>String</item-type> | ||
<label>Bluetooth connection</label> | ||
<description>Id of the bluethooth connected device</description> | ||
</channel-type> | ||
|
||
<channel-type id="imageUrl"> | ||
<item-type>String</item-type> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nicer to have a Image type here instead of a url. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, because I would have to download every image of every song which was played on any echo. But only very view of them are really used, but the user opens the UI. But it would be nice to have an attribute for it in the xml to mark it as image url, so that the paper UI can display it as image in the same way as it is done in the sitemap. |
||
<label>Image url</label> | ||
<description>Url of the album image or radio station logo</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
<channel-type id="title"> | ||
<item-type>String</item-type> | ||
<label>Title</label> | ||
<description>Title</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
<channel-type id="subtitle1"> | ||
<item-type>String</item-type> | ||
<label>Subtitle 1</label> | ||
<description>Subtitle 1</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
<channel-type id="subtitle2"> | ||
<item-type>String</item-type> | ||
<label>Subtitle 2</label> | ||
<description>Subtitle 2</description> | ||
<state readOnly="true"></state> | ||
</channel-type> | ||
|
||
<channel-type id="radio"> | ||
<item-type>Switch</item-type> | ||
<label>Radio</label> | ||
<description>Alexa plays radio</description> | ||
</channel-type> | ||
|
||
<channel-type id="bluetooth"> | ||
<item-type>Switch</item-type> | ||
<label>Bluetooth Connection</label> | ||
<description>Connect to last used device</description> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is also a candidate for trigger actions, see eclipse-archived/smarthome#5099 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly, there a lot of such channels in my binding! I have attributed these channels as write only in my readme. |
||
</channel-type> | ||
|
||
<channel-type id="loop"> | ||
<item-type>Switch</item-type> | ||
<label>Loop</label> | ||
<description>Loop</description> | ||
</channel-type> | ||
|
||
<channel-type id="shuffle"> | ||
<item-type>Switch</item-type> | ||
<label>Shuffle</label> | ||
<description>Shuffle play</description> | ||
</channel-type> | ||
|
||
<channel-type id="player"> | ||
<item-type>Player</item-type> | ||
<label>Player</label> | ||
<description>Content Playing</description> | ||
</channel-type> | ||
|
||
|
||
<channel-type id="volume"> | ||
<item-type>Dimmer</item-type> | ||
<label>Volume</label> | ||
<description>Volume of the sound</description> | ||
</channel-type> | ||
|
||
</thing:thing-descriptions> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ActivationPolicy: lazy | ||
Bundle-ClassPath: . | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: AmazonEchoControl Binding | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "Amazon Echo Control Binding" |
||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-SymbolicName: org.openhab.binding.amazonechocontrol;singleton:=true | ||
Bundle-Vendor: openHAB | ||
Bundle-Version: 2.3.0.qualifier | ||
Export-Package: | ||
org.openhab.binding.amazonechocontrol, | ||
org.openhab.binding.amazonechocontrol.handler | ||
Import-Package: | ||
org.apache.commons.lang.time;version="2.6.0", | ||
org.eclipse.jdt.annotation;resolution:=optional, | ||
org.eclipse.smarthome.config.core, | ||
org.eclipse.smarthome.config.discovery, | ||
org.eclipse.smarthome.core.library.types, | ||
org.eclipse.smarthome.core.thing, | ||
org.eclipse.smarthome.core.thing.binding, | ||
org.eclipse.smarthome.core.thing.binding.builder, | ||
org.eclipse.smarthome.core.thing.type, | ||
org.eclipse.smarthome.core.types, | ||
org.openhab.binding.amazonechocontrol, | ||
org.openhab.binding.amazonechocontrol.handler, | ||
org.openhab.core.library.types, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This dependency causes problems, please refactor to no be dependent on it anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Martin, I do not what you mean with remove these dependencies, because the are used, but I have copied now the dependencies from the icloud binding (I only changed the names from icloud with amazonechocontrol). Now Jenkis is green again. But the build goes red again, but it has produced my binding: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.amazonechocontrol/2.3.0-SNAPSHOT/ |
||
org.osgi.framework;version="1.8.0", | ||
org.slf4j | ||
Service-Component: OSGI-INF/*.xml | ||
Require-Bundle: com.google.gson |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.xml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing newline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have not created this file? Is it part of the template? Anyway I have added the newline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected tabs in that file - could you re-apply the auto formatter, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok