python-ember-mug 1.5.0__tar.gz → 1.5.1__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.5
2
2
  Name: python-ember-mug
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: Python Library for Ember Mugs.
5
5
  Project-URL: Changelog, https://sopelj.github.io/python-ember-mug/changelog/
6
6
  Project-URL: Documentation, https://sopelj.github.io/python-ember-mug/
@@ -6,4 +6,4 @@ __all__ = ("EmberMug",)
6
6
 
7
7
  __author__ = """Jesse Sopel"""
8
8
  __email__ = "jesse@sopelj.ca"
9
- __version__ = "1.5.0"
9
+ __version__ = "1.5.1"
@@ -449,17 +449,25 @@ class EmberMug:
449
449
  await self._ensure_connection()
450
450
  updates = {}
451
451
  failed_attrs = set()
452
+ last_error = None
452
453
  for attr in attrs:
453
454
  try:
454
455
  updates[attr] = await getattr(self, f"get_{attr}")()
455
456
  except BleakError as e:
456
457
  failed_attrs |= {attr}
458
+ last_error = e
457
459
  logger.debug("Failed to fetch %s: %s", attr, e)
460
+
461
+ if len(failed_attrs) == len(attrs) and last_error:
462
+ raise last_error
463
+
458
464
  changes = self.data.update_info(**updates)
459
465
  if changes:
460
466
  self._fire_callbacks()
467
+
461
468
  if failed_attrs:
462
469
  logger.warning("Failed to fetch some attributes: %s", failed_attrs)
470
+
463
471
  logger.debug("Attributes updated: %s", changes)
464
472
  return changes
465
473