Skip to content

Commit 5c96886

Browse files
committed
Merge branch 'develop'
2 parents c4ec71e + 8f117bd commit 5c96886

File tree

210 files changed

+10962
-14952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+10962
-14952
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: "Unittests Plugins"
1+
name: "Unittests Plugins for PRs (disabled)"
22
#on: [workflow_dispatch, push]
33
on:
44
workflow_dispatch:
55
pull_request:
66
branches:
7-
- 'develop'
7+
- '!develop'
88

99
jobs:
1010
build:

.github/workflows/unittests.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
branches:
77
- '*'
88
- '!release_doc'
9-
9+
pull_request:
10+
branches:
11+
- 'develop'
1012
jobs:
1113
build:
1214
runs-on: ubuntu-20.04 #latest
@@ -24,17 +26,37 @@ jobs:
2426
sudo apt-get install gcc --only-upgrade
2527
2628
- name: Get branch name
27-
run: |
28-
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
29-
echo ${GITHUB_REF#refs/heads/}
29+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
3030
id: extract_branch
3131

32-
- name: Checkout core from ${{steps.extract_branch.outputs.branch}} branch
32+
- name: Workflow Information
33+
run: |
34+
echo github.event_name '${{ github.event_name }}'
35+
echo github.workflow '${{ github.workflow }}'
36+
echo github.action_repository '${{ github.action_repository }}'
37+
echo github.actor '${{ github.actor }}'
38+
echo github.ref_name '${{ github.ref_name }}'
39+
echo github.ref '${{ github.ref }}'
40+
echo github.base_ref '${{ github.base_ref }}'
41+
echo github.head_ref '${{ github.head_ref }}'
42+
echo github.pull_request.base.ref '${{ github.pull_request.base.ref }}'
43+
echo steps.extract_branch.outputs.branch '${{ steps.extract_branch.outputs.branch }}'
44+
45+
- name: Checkout core from branch '${{ steps.extract_branch.outputs.branch }}' (for push)
46+
if: github.event_name != 'pull_request'
3347
uses: actions/checkout@v3
3448
with:
3549
repository: smarthomeNG/smarthome
36-
ref: ${{steps.extract_branch.outputs.branch}}
37-
- name: Checkout plugins from ${{steps.extract_branch.outputs.branch}} branch
50+
ref: ${{ steps.extract_branch.outputs.branch }}
51+
52+
- name: Checkout core from branch 'develop' (for pull request)
53+
if: github.event_name == 'pull_request'
54+
uses: actions/checkout@v3
55+
with:
56+
repository: smarthomeNG/smarthome
57+
ref: develop
58+
59+
- name: Checkout plugins from branch '${{steps.extract_branch.outputs.branch}}'
3860
uses: actions/checkout@v3
3961
with:
4062
repository: smarthomeNG/plugins

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def plugin_release():
2-
return '1.9.4'
2+
return '1.9.5'
33

44
def plugin_branch():
55
return 'master'

alexarc4shng/README.md

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AlexaRc4shNG
22

3-
#### Version 1.0.2
3+
#### Version 1.0.3
44

55
The plugin gives the possibilty to control an Alexa-Echo-Device remote by smartHomeNG. So its possible to switch on an TuneIn-Radio Channel, send some messages via Text2Speech when an event happens on the knx-bus or on the Visu. On the Web-Interface you can define your own commandlets (functions). The follwing functions are available on the Web-Interface :
66

@@ -38,7 +38,7 @@ Special thanks to Jonofe from the [Edomi-Forum](https://knx-user-forum.de/forum/
3838
- Pause (pauses the actual media)
3939
- Text2Speech (sends a Text to the echo, echo will speak it)
4040
- StartTuneInStation (starts a TuneInRadiostation with the guideID you send)
41-
- SSML (Speak to Text with[Speech Synthesis Markup Language](https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html))
41+
- SSML (Speak to Text with [Speech Synthesis Markup Language](https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html))
4242
- VolumeAdj (adjusts the volume during playing some media not working from webinterface test functions)
4343
- VolumeSet (sets the volume to value from 0-100 percent)
4444

@@ -47,7 +47,7 @@ Special thanks to Jonofe from the [Edomi-Forum](https://knx-user-forum.de/forum/
4747
```yaml
4848
<mValue> = Value to send as alpha
4949
<nValue> = Value to send as numeric
50-
#item.path/# = item-path of the value that should be inserted into text or ssml
50+
"#item.path/#" = item-path of the value that should be inserted into text or ssml
5151
<serialNumber> = SerialNo. of the device where the command should go to
5252
<familiy> = device family
5353
<deviceType> = deviceType
@@ -57,6 +57,14 @@ Special thanks to Jonofe from the [Edomi-Forum](https://knx-user-forum.de/forum/
5757

5858
## ChangeLog<a name="changelog"/>
5959

60+
#### 2021.02.10 Version 1.0.3
61+
62+
- added MFA for Auto-Login
63+
- <strong>added new Parameter (mfa_secret) in the etc/plugin.yaml</strong>
64+
- added Step by Step Setup in Web-IF for MFA
65+
- added public function to get the ToDo-List
66+
- added public function to get the Shopping-List
67+
6068
#### 2020.03.20 Version 1.0.2
6169

6270
- <strong>changed public function "send_cmd_by_curl" to "send_cmd"</strong>
@@ -160,7 +168,7 @@ Item2EnableAlexaRC->Item controlled by UZSU or something else which enables the
160168
alexa_credentials-> user:pwd (base64 encoded)<br>
161169
item_2_enable_alexa_rc -> Item to allow smarthomeNG to send Commands to Echo's<br>
162170
login_update_cycle->seconds to wait for automatic Login in to refresh the cookie
163-
171+
mfa_secret-> The MFA-Secret you got from Amazon-Website (fill it out with the Web-Interface)
164172

165173

166174
```yaml
@@ -171,6 +179,7 @@ AlexaRc4shNG:
171179
item_2_enable_alexa_rc: Item_to_enable_Alexaremote
172180
alexa_credentials: <USER>:<PWD>
173181
login_update_cycle: 432000
182+
mfa_secret: <YOUR MFA-Secret>
174183
```
175184
176185
@@ -203,12 +212,15 @@ alexa_cmd_01: True:EchoDotKueche:StartTuneInStation:s96141
203212
Value = <20.0 - send command when value of the item becomes less then 20.0
204213
EchodotKueche = Devicename where the Command should be send to
205214
Text2Speech = Name of the Commandlet
206-
Value_to_Send = Die Temperatur in der Kueche ist niedriger als 20 Grad Die Temperatur ist jetzt #test.testzimmer.temperature.actual/# Grad #test.testzimmer.temperature.actual/# = item-path of the value that should be inserted
215+
Value_to_Send = Die Temperatur in der Kueche ist niedriger als 20 Grad Die Temperatur ist jetzt #test.testzimmer.temperature.actual/# Grad
207216
```
208217

218+
```yaml
219+
#test.testzimmer.temperature.actual/# = item-path of the value that should be inserted
220+
```
209221
<strong>example:<br></strong>
210222
`
211-
alexa_cmd_01: <20.0:EchoDotKueche:Text2Speech:Die Temperatur in der Kueche ist niedriger als 20 Grad Die Temperatur ist jetzt \#test.testzimmer.temperature.actual/\# Grad
223+
alexa_cmd_01: <20.0:EchoDotKueche:Text2Speech:Die Temperatur in der Kueche ist niedriger als 20 Grad Die Temperatur ist jetzt #test.testzimmer.temperature.actual/# Grad
212224
`
213225

214226
You can find the paths of the items on the backend-WebInterface - section items.
@@ -266,12 +278,13 @@ Example for settings in an item.conf file :
266278
alexa_cmd_01 = '"True:EchoDotKueche:StartTuneInStation:s96141"
267279
alexa_cmd_02 ="True:EchoDotKueche:Text2Speech:Hallo das Licht im Buero ist eingeschalten"
268280
alexa_cmd_03 = "False:EchoDotKueche:Text2Speech:Hallo das Licht im Buero ist aus"
269-
alexa_cmd_04 = "False:EchoDotKueche:Pause: "
281+
alexa_cmd_04 = "False:EchoDotKueche:Pause:"
270282
visu_acl = rw
271283
knx_dpt = 1
272284
knx_listen = 1/1/105
273285
knx_send = 1/1/105
274-
enforce_updates = truey_attr: setting
286+
enforce_updates = true
287+
275288
```
276289

277290
### logic.yaml
@@ -282,7 +295,7 @@ Right now no logics are implemented. But you can trigger the functions by your o
282295

283296
The plugin provides the following publich functions. You can use it for example in logics.
284297

285-
### send_cmd(dvName, cmdName, mValue)
298+
### send_cmd(dvName:str, cmdName:str, mValue:str)
286299

287300
example how to use in logics:
288301

@@ -293,7 +306,7 @@ sh.AlexaRc4shNG.send_cmd('Kueche','Text2Speech','Der Sensor der Hebenlage signal
293306
```
294307
Sends a command to the device. "dvName" is the name of the device, "cmdName" is the name of the CommandLet, mValue is the value you would send.
295308
You can find all this informations on the Web-Interface.
296-
You can also user the [placeholders](#placeholders)
309+
You can also use the [placeholders](#placeholders)
297310

298311
- the result will be the HTTP-Status of the request as string (str)
299312

@@ -305,11 +318,68 @@ This function returns the Device-Name of the last Echo Device which got a voice
305318
myLastDevice = sh.AlexaRc4shNG.get_last_alexa()
306319

307320
```
321+
322+
### get_list(type:str)
323+
324+
This function returns the ToDo or the Shopping list - depending on "type" as dict<br>
325+
326+
valid types are :
327+
```yaml
328+
'SHOPPING_LIST'
329+
'TO_DO'
330+
```
331+
332+
333+
```yaml
334+
sh.AlexaRc4shNG.get_list(type:str)
335+
```
336+
## Example logic to fill Items with List-Infos
337+
338+
<pre>
339+
<code>
340+
from datetime import datetime
341+
# get the Todo-List
342+
myList=sh.AlexaRc4shNG.get_list('TO_DO')
343+
for entry in myList:
344+
if entry['completed'] == True:
345+
entry['icon'] = 'control_clear'
346+
else:
347+
entry['icon'] = 'control_home'
348+
entry['date'] = datetime.fromtimestamp((entry['updatedDateTime']/1000)).strftime("%d.%m.%Y, %H:%M:%S")
349+
# Write list to Item - type should be list
350+
sh.Alexa_Lists.list.todo(myList)
351+
# get the shopping-List
352+
myList=sh.AlexaRc4shNG.get_list('SHOPPING_LIST')
353+
for entry in myList:
354+
if entry['completed'] == True:
355+
entry['icon'] = 'control_clear'
356+
else:
357+
entry['icon'] = 'jquery_shop'
358+
entry['date'] = datetime.fromtimestamp((entry['updatedDateTime']/1000)).strftime("%d.%m.%Y, %H:%M:%S")
359+
# Write list to Item - type should be list
360+
sh.Alexa_Lists.list.shopping(myList)
361+
</code>
362+
</pre>
363+
364+
## Example to show lists in smartVisu with status.activelist
365+
<pre>
366+
<code>
367+
status.activelist('','Alexa_Lists.list.todo','value','date','value','info')
368+
369+
status.activelist('','Alexa_Lists.list.shopping','value','date','value','info')
370+
</code>
371+
</pre>
372+
373+
### Ergebnis :
374+
![PlaceHolder](./assets/Alexa_lists.jpg "jpg")
375+
376+
377+
308378
# Web-Interface <a name="webinterface"/></a>
309379

310380
The Webinterface is reachable on you smarthomeNG server here :<br>
311381

312-
<strong>yourserver:8383/alexarc4shng/</strong>
382+
<strong>http://yourserver:8383/plugins/alexarc4shng/</strong>
313383

314384
## Cookie-Handling
315385

0 commit comments

Comments
 (0)