python-ember-mug 1.4.0b2__tar.gz → 1.4.0b3__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.4
2
2
  Name: python-ember-mug
3
- Version: 1.4.0b2
3
+ Version: 1.4.0b3
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.4.0b2"
9
+ __version__ = "1.4.0b3"
@@ -435,9 +435,19 @@ class EmberMug:
435
435
  """Update a list of attributes from the mug."""
436
436
  logger.debug("Updating the following attributes: %s", attrs)
437
437
  await self._ensure_connection()
438
- changes = self.data.update_info(**{attr: await getattr(self, f"get_{attr}")() for attr in attrs})
438
+ updates = {}
439
+ failed_attrs = set()
440
+ for attr in attrs:
441
+ try:
442
+ updates[attr] = await getattr(self, f"get_{attr}")()
443
+ except BleakError as e:
444
+ failed_attrs |= {attr}
445
+ logger.debug("Failed to fetch %s: %s", attr, e)
446
+ changes = self.data.update_info(**updates)
439
447
  if changes:
440
448
  self._fire_callbacks()
449
+ if failed_attrs:
450
+ logger.warning("Failed to fetch some attributes: %s", failed_attrs)
441
451
  logger.debug("Attributes updated: %s", changes)
442
452
  return changes
443
453