aioamazondevices 11.0.2__py3-none-any.whl → 11.0.3__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__ = "11.0.2"
3
+ __version__ = "11.0.3"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
aioamazondevices/api.py CHANGED
@@ -307,9 +307,15 @@ class AmazonEchoApi:
307
307
  sensors = devices_sensors.get(device.serial_number, {})
308
308
  if sensors:
309
309
  device.sensors = sensors
310
+ if reachability_sensor := sensors.get("reachability"):
311
+ device.online = reachability_sensor.value == "OK"
312
+ else:
313
+ device.online = False
310
314
  else:
315
+ device.online = False
311
316
  for device_sensor in device.sensors.values():
312
317
  device_sensor.error = True
318
+
313
319
  if (
314
320
  device_dnd := dnd_sensors.get(device.serial_number)
315
321
  ) and device.device_family != SPEAKER_GROUP_FAMILY:
@@ -341,6 +347,15 @@ class AmazonEchoApi:
341
347
  ):
342
348
  device.notifications[notification_type] = notification_object
343
349
 
350
+ # base online status of speaker groups on their members
351
+ for device in self._final_devices.values():
352
+ if device.device_family == SPEAKER_GROUP_FAMILY:
353
+ device.online = all(
354
+ d.online
355
+ for d in self._final_devices.values()
356
+ if d.serial_number in device.device_cluster_members
357
+ )
358
+
344
359
  async def _set_device_endpoints_data(self) -> None:
345
360
  """Set device endpoint data."""
346
361
  devices_endpoints = await self._get_devices_endpoint_data()
@@ -21,6 +21,12 @@ SENSORS: dict[str, dict[str, str | None]] = {
21
21
  "subkey": "value",
22
22
  "scale": None,
23
23
  },
24
+ "connectivity": {
25
+ "name": "reachability",
26
+ "key": "reachabilityStatusValue",
27
+ "subkey": None,
28
+ "scale": None,
29
+ },
24
30
  }
25
31
 
26
32
  ALEXA_INFO_SKILLS = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioamazondevices
3
- Version: 11.0.2
3
+ Version: 11.0.3
4
4
  Summary: Python library to control Amazon devices
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -1,9 +1,9 @@
1
- aioamazondevices/__init__.py,sha256=RH-8Gu8O2U2mizx4VXkLW5aTuvHUP0LZ9GAU0b3dzdc,277
2
- aioamazondevices/api.py,sha256=e5RcQpRWM52IxwUBXLmgGLYqkawKBu474Qit3ijD6cM,19252
1
+ aioamazondevices/__init__.py,sha256=Q_uFYFnNYMzrZjtqxHRSTatCd-pn44lYmk0nn0Q3rOY,277
2
+ aioamazondevices/api.py,sha256=CQ_CQMhpwHryTX8Utqmw8AVKvi56UmD3xpozIXTe0Uc,19888
3
3
  aioamazondevices/const/__init__.py,sha256=xQt8Smq2Ojjo30KKdev_gxDkcpY9PJlArTUXKel8oqs,38
4
4
  aioamazondevices/const/devices.py,sha256=-W4yBSeACIsG3z_8MC_jrQoFJN1NZMe4c62XPee6q1k,11285
5
5
  aioamazondevices/const/http.py,sha256=tgsRJWfx_SFRBk6T7TiClP02qIsPN4wShfMqRbZcQio,1204
6
- aioamazondevices/const/metadata.py,sha256=SV8sVVevB0ap7ZLNcAg9L-CSoSe885jlmg15ls99shA,1100
6
+ aioamazondevices/const/metadata.py,sha256=zfia4dzEJQ1NPKiVzL-BslOngBRPSpL_vX0DPvIBhSg,1250
7
7
  aioamazondevices/const/queries.py,sha256=weCYmUJedNyx1P8z_tG_6cHGMjICUVo6KOckkl4P_-w,1900
8
8
  aioamazondevices/const/schedules.py,sha256=GohhoXSGxXEq_fEycSBsjaDJdIxuMtvspLVqaCmJjOU,1378
9
9
  aioamazondevices/const/sounds.py,sha256=hdrXYKEuSOCw7fDdylvqLcDqD5poHzhgXEnUwq_TwDE,1923
@@ -17,7 +17,7 @@ aioamazondevices/login.py,sha256=NNbZjaSC32uOGsKNkSx-URA4DIEGpCZSLp2Ey5xFv9U,173
17
17
  aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  aioamazondevices/structures.py,sha256=2duKj9kiknFQHVGOysh0pWTQagTT-IDStCskayrwYSE,1425
19
19
  aioamazondevices/utils.py,sha256=V6b5_CNJ5LtVBl9KSitr14nNle4mNDkZVojGhKfy60A,2373
20
- aioamazondevices-11.0.2.dist-info/METADATA,sha256=GxyYwHb_ebJzaPjCEpIVCvYnH-a4LnLqrU_Ah2eRLVk,8308
21
- aioamazondevices-11.0.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
22
- aioamazondevices-11.0.2.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
23
- aioamazondevices-11.0.2.dist-info/RECORD,,
20
+ aioamazondevices-11.0.3.dist-info/METADATA,sha256=BxEuuS0OxVpBisq1ViK3xhejCOdQBAwu_1b7glFrQSg,8308
21
+ aioamazondevices-11.0.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
22
+ aioamazondevices-11.0.3.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
23
+ aioamazondevices-11.0.3.dist-info/RECORD,,