aioamazondevices 3.5.3__py3-none-any.whl → 3.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  """aioamazondevices library."""
2
2
 
3
- __version__ = "3.5.3"
3
+ __version__ = "3.6.0"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
aioamazondevices/api.py CHANGED
@@ -22,6 +22,7 @@ from langcodes import Language
22
22
  from multidict import MultiDictProxy
23
23
  from yarl import URL
24
24
 
25
+ from . import __version__
25
26
  from .const import (
26
27
  _LOGGER,
27
28
  AMAZON_APP_BUNDLE_ID,
@@ -105,6 +106,7 @@ class AmazonSequenceType(StrEnum):
105
106
  Sound = "Alexa.Sound"
106
107
  Music = "Alexa.Music.PlaySearchPhrase"
107
108
  TextCommand = "Alexa.TextCommand"
109
+ LaunchSkill = "Alexa.Operation.SkillConnections.Launch"
108
110
 
109
111
 
110
112
  class AmazonMusicSource(StrEnum):
@@ -158,7 +160,8 @@ class AmazonEchoApi:
158
160
  self._language = f"{lang_maximized.language}-{lang_maximized.region}"
159
161
 
160
162
  _LOGGER.debug(
161
- "Initialize library: domain <amazon.%s>, language <%s>, market: <%s>",
163
+ "Initialize library v%s: domain <amazon.%s>, language <%s>, market: <%s>",
164
+ __version__,
162
165
  self._domain,
163
166
  self._language,
164
167
  self._market,
@@ -1019,6 +1022,17 @@ class AmazonEchoApi:
1019
1022
  "skillId": "amzn1.ask.1p.tellalexa",
1020
1023
  "text": message_body,
1021
1024
  }
1025
+ elif message_type == AmazonSequenceType.LaunchSkill:
1026
+ payload = {
1027
+ **base_payload,
1028
+ "targetDevice": {
1029
+ "deviceType": device.device_type,
1030
+ "deviceSerialNumber": device.serial_number,
1031
+ },
1032
+ "connectionRequest": {
1033
+ "uri": "connection://AMAZON.Launch/" + message_body,
1034
+ },
1035
+ }
1022
1036
  else:
1023
1037
  raise ValueError(f"Message type <{message_type}> is not recognised")
1024
1038
 
@@ -1099,6 +1113,16 @@ class AmazonEchoApi:
1099
1113
  device, AmazonSequenceType.TextCommand, message_body
1100
1114
  )
1101
1115
 
1116
+ async def call_alexa_skill(
1117
+ self,
1118
+ device: AmazonDevice,
1119
+ message_body: str,
1120
+ ) -> None:
1121
+ """Call Alexa.LaunchSkill to launch a skill."""
1122
+ return await self._send_message(
1123
+ device, AmazonSequenceType.LaunchSkill, message_body
1124
+ )
1125
+
1102
1126
  async def set_do_not_disturb(self, device: AmazonDevice, state: bool) -> None:
1103
1127
  """Set do_not_disturb flag."""
1104
1128
  payload = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aioamazondevices
3
- Version: 3.5.3
3
+ Version: 3.6.0
4
4
  Summary: Python library to control Amazon devices
5
5
  License: Apache-2.0
6
6
  Author: Simone Chemelli
@@ -134,6 +134,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
134
134
  <sub><b>Ivan F. Martinez</b></sub>
135
135
  </a>
136
136
  </td>
137
+ <td align="center">
138
+ <a href="https://github.com/AzonInc">
139
+ <img src="https://avatars.githubusercontent.com/u/11911587?v=4" width="100;" alt="AzonInc"/>
140
+ <br />
141
+ <sub><b>Flo</b></sub>
142
+ </a>
143
+ </td>
137
144
  <td align="center">
138
145
  <a href="https://github.com/lchavezcuu">
139
146
  <img src="https://avatars.githubusercontent.com/u/22165856?v=4" width="100;" alt="lchavezcuu"/>
@@ -141,6 +148,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
141
148
  <sub><b>Luis Chavez</b></sub>
142
149
  </a>
143
150
  </td>
151
+ </tr>
152
+ <tr>
144
153
  <td align="center">
145
154
  <a href="https://github.com/tronikos">
146
155
  <img src="https://avatars.githubusercontent.com/u/9987465?v=4" width="100;" alt="tronikos"/>
@@ -1,11 +1,11 @@
1
- aioamazondevices/__init__.py,sha256=2EB7o4F2e4tdN6o5I1LSPqtKZxF_xUEu3M_bzBJzRQ4,276
2
- aioamazondevices/api.py,sha256=kFdkvBHlGI1OITnRt1j8eASdVOzPLuftSF4U5jb6j28,40686
1
+ aioamazondevices/__init__.py,sha256=meR55asFNEBoOVMLbrsU3ixXgFy1gYg-SF8njvQbGck,276
2
+ aioamazondevices/api.py,sha256=Z65R_DSUQnHci0_gs1PB4dwm2K_bqaaYBbPBc6GfLcU,41525
3
3
  aioamazondevices/const.py,sha256=nI-2bz91WYzSJCUP-M9NLJ7KY0yx1r5IY3VBjFIlRNs,11235
4
4
  aioamazondevices/exceptions.py,sha256=CfOFKDvE_yl5BFoFcpTOuDfgRi_2oAtKk-nNJgfWBAs,726
5
5
  aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  aioamazondevices/sounds.py,sha256=01pVCDFIuhrLypXInw4JNuHsC6zjMLsuKocet1R6we8,13409
7
7
  aioamazondevices/utils.py,sha256=RzuKRhnq_8ymCoJMoQJ2vBYyuew06RSWpqQWmqdNczE,2019
8
- aioamazondevices-3.5.3.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
9
- aioamazondevices-3.5.3.dist-info/METADATA,sha256=s9mOApOTX9QtZF6Pyzrgp4OIdtlV9iMp_-Pg9c0MNBU,6929
10
- aioamazondevices-3.5.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
- aioamazondevices-3.5.3.dist-info/RECORD,,
8
+ aioamazondevices-3.6.0.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
9
+ aioamazondevices-3.6.0.dist-info/METADATA,sha256=XRQUDmSXK_3SromTucPO4RmvJ26gpcb7uqtN0OpgJ_A,7251
10
+ aioamazondevices-3.6.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
+ aioamazondevices-3.6.0.dist-info/RECORD,,