aioamazondevices 3.5.0__tar.gz → 3.5.2__tar.gz

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
  Metadata-Version: 2.3
2
2
  Name: aioamazondevices
3
- Version: 3.5.0
3
+ Version: 3.5.2
4
4
  Summary: Python library to control Amazon devices
5
5
  License: Apache-2.0
6
6
  Author: Simone Chemelli
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aioamazondevices"
3
- version = "3.5.0"
3
+ version = "3.5.2"
4
4
  requires-python = ">=3.12"
5
5
  description = "Python library to control Amazon devices"
6
6
  authors = [
@@ -98,5 +98,5 @@ module = "tests.*"
98
98
  allow_untyped_defs = true
99
99
 
100
100
  [build-system]
101
- requires = ["poetry-core>=1.0.0"]
101
+ requires = ["poetry-core>=2.0"]
102
102
  build-backend = "poetry.core.masonry.api"
@@ -1,6 +1,6 @@
1
1
  """aioamazondevices library."""
2
2
 
3
- __version__ = "3.5.0"
3
+ __version__ = "3.5.2"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
@@ -129,19 +129,19 @@ class AmazonEchoApi:
129
129
  # Force country digits as lower case
130
130
  country_code = login_country_code.lower()
131
131
 
132
- locale = DOMAIN_BY_ISO3166_COUNTRY.get(country_code)
133
- domain = locale["domain"] if locale else country_code
132
+ locale = DOMAIN_BY_ISO3166_COUNTRY.get(country_code, {})
133
+ domain = locale.get("domain", country_code)
134
+ market = locale.get("market", f"https://www.amazon.{domain}")
135
+ assoc_handle = locale.get(
136
+ "openid.assoc_handle", f"{DEFAULT_ASSOC_HANDLE}_{country_code}"
137
+ )
134
138
 
135
- if locale and (assoc := locale.get("openid.assoc_handle")):
136
- assoc_handle = assoc
137
- else:
138
- assoc_handle = f"{DEFAULT_ASSOC_HANDLE}_{country_code}"
139
139
  self._assoc_handle = assoc_handle
140
-
141
140
  self._login_email = login_email
142
141
  self._login_password = login_password
143
142
  self._login_country_code = country_code
144
143
  self._domain = domain
144
+ self._market = market
145
145
  self._cookies = self._build_init_cookies()
146
146
  self._csrf_cookie: str | None = None
147
147
  self._save_raw_data = save_raw_data
@@ -158,9 +158,10 @@ class AmazonEchoApi:
158
158
  self._language = f"{lang_maximized.language}-{lang_maximized.region}"
159
159
 
160
160
  _LOGGER.debug(
161
- "Initialize library with domain <%s> and language <%s>",
161
+ "Initialize library: domain <amazon.%s>, language <%s>, market: <%s>",
162
162
  self._domain,
163
163
  self._language,
164
+ self._market,
164
165
  )
165
166
 
166
167
  def _load_website_cookies(self) -> dict[str, str]:
@@ -584,16 +585,14 @@ class AmazonEchoApi:
584
585
  raise CannotAuthenticate
585
586
 
586
587
  resp_me_json = await resp_me.json()
587
- market = resp_me_json["marketPlaceDomainName"]
588
-
589
- _domain = f"https://www.amazon.{self._domain}"
588
+ amazon_market = resp_me_json["marketPlaceDomainName"]
590
589
 
591
- if market != _domain:
590
+ if amazon_market != self._market:
592
591
  _LOGGER.warning(
593
592
  "Selected country <%s> doesn't matches Amazon API reply:\n%s\n vs \n%s",
594
593
  self._login_country_code.upper(),
595
- {"site ": _domain},
596
- {"market": market},
594
+ {"input ": self._market},
595
+ {"amazon": amazon_market},
597
596
  )
598
597
  raise WrongCountry
599
598
 
@@ -49,9 +49,7 @@ DOMAIN_BY_ISO3166_COUNTRY = {
49
49
  "be": {
50
50
  "domain": "com.be",
51
51
  },
52
- "br": {
53
- "domain": "com.br",
54
- },
52
+ "br": AMAZON_US_OVERRIDE | {"market": "https://www.amazon.com.br"},
55
53
  "gb": {
56
54
  "domain": "co.uk",
57
55
  "openid.assoc_handle": f"{DEFAULT_ASSOC_HANDLE}_uk",
@@ -63,6 +61,10 @@ DOMAIN_BY_ISO3166_COUNTRY = {
63
61
  "mx": {
64
62
  "domain": "com.mx",
65
63
  },
64
+ "nl": {
65
+ "domain": "nl",
66
+ "market": "https://www.amazon.co.uk",
67
+ },
66
68
  "no": AMAZON_DE_OVERRIDE,
67
69
  "nz": {
68
70
  "domain": "com.au",
@@ -147,6 +149,7 @@ DEVICE_TO_IGNORE: list[str] = [
147
149
  AMAZON_DEVICE_TYPE, # Alexa App for iOS
148
150
  "A2TF17PFR55MTB", # Alexa App for Android
149
151
  "A1RTAM01W29CUP", # Alexa App for PC
152
+ "A18BI6KPKDOEI4", # ecobee4 Smart Thermostat with Built-in Alexa - issue #199
150
153
  ]
151
154
 
152
155
  DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
@@ -170,6 +173,10 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
170
173
  "model": "Echo Plus",
171
174
  "hw_version": "Gen2",
172
175
  },
176
+ "A1C66CX2XD756O": {
177
+ "model": "Fire Tablet HD 8",
178
+ "hw_version": "Gen8",
179
+ },
173
180
  "A1EIANJ7PNB0Q7": {
174
181
  "model": "Echo Show 15",
175
182
  "hw_version": "Gen1",
@@ -182,12 +189,16 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
182
189
  "model": "Fire TV Stick 4K",
183
190
  "hw_version": "Gen2",
184
191
  },
192
+ "A1Q7QCGNMXAKYW": {
193
+ "model": "Fire Tablet 7",
194
+ "hw_version": "Gen9",
195
+ },
185
196
  "A1RABVCI4QCIKC": {
186
197
  "model": "Echo Dot",
187
198
  "hw_version": "Gen3",
188
199
  },
189
200
  "A1TD5Z1R8IWBHA ": {
190
- "model": "Fire HD 8",
201
+ "model": "Fire Tablet HD 8",
191
202
  "hw_version": "Gen12",
192
203
  },
193
204
  "A1VGB7MHSIEYFK": {
@@ -248,9 +259,13 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
248
259
  "hw_version": "Gen5",
249
260
  },
250
261
  "A2N49KXGVA18AR": {
251
- "model": "Fire HD 10 Plus",
262
+ "model": "Fire Tablet HD 10 Plus",
252
263
  "hw_version": "Gen11",
253
264
  },
265
+ "A2RU4B77X9R9NZ": {
266
+ "model": "Echo Link Amp",
267
+ "hw_version": None,
268
+ },
254
269
  "A2U21SRK4QGSE1": {
255
270
  "model": "Echo Dot",
256
271
  "hw_version": "Gen4",
@@ -267,6 +282,10 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
267
282
  "model": "Echo Dot",
268
283
  "hw_version": "Gen3",
269
284
  },
285
+ "A31DTMEEVDDOIV": {
286
+ "model": "Fire TV Stick Lite",
287
+ "hw_version": "Gen1",
288
+ },
270
289
  "A32DDESGESSHZA": {
271
290
  "model": "Echo Dot",
272
291
  "hw_version": "Gen3",
@@ -279,6 +298,15 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
279
298
  "model": "Smart TV 4K",
280
299
  "hw_version": "4 Series",
281
300
  },
301
+ "A38949IHXHRQ5P": {
302
+ "model": "Echo Tap",
303
+ "hw_version": "Gen1",
304
+ },
305
+ "A39OV95SPFQ9YG": {
306
+ "manufacturer": "Sonos Inc.",
307
+ "model": "Sonos Era 100",
308
+ "hw_version": None,
309
+ },
282
310
  "A3C9PE6TNYLTCH": {
283
311
  "model": "Speaker Group",
284
312
  "hw_version": None,
@@ -291,10 +319,18 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
291
319
  "model": "FireTV 4k MAX",
292
320
  "hw_version": "Gen1",
293
321
  },
322
+ "A3FX4UWTP28V1P": {
323
+ "model": "Echo",
324
+ "hw_version": "Gen3",
325
+ },
294
326
  "A3HF4YRA2L7XGC": {
295
327
  "model": "Fire TV Cube",
296
328
  "hw_version": "Gen1",
297
329
  },
330
+ "A3HND3J60V1OXX": {
331
+ "model": "Echo Loop",
332
+ "hw_version": None,
333
+ },
298
334
  "A3NPD82ABCPIDP": {
299
335
  "manufacturer": "Sonos Inc.",
300
336
  "model": "Sonos Beam",