Skip to content

Commit

Permalink
Merge pull request #95 from jbalague/handle-missing-AssertionError
Browse files Browse the repository at this point in the history
Handle missing AssertionError when HA is still in startup
  • Loading branch information
Ernst79 authored Jul 10, 2020
2 parents 6b4382d + 7f07141 commit 16bc34a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/mitemp_bt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def discover_ble_devices(config, aeskeyslist, whitelist):
setattr(sensors[b_i], "_state", batt[mac])
try:
sensors[b_i].schedule_update_ha_state()
except AttributeError:
except (AttributeError, AssertionError):
_LOGGER.debug(
"Sensor %s (%s, batt.) not yet ready for update",
mac,
Expand Down Expand Up @@ -734,7 +734,7 @@ def discover_ble_devices(config, aeskeyslist, whitelist):
setattr(sensors[cn_i], "_state", cons_m_data[mac])
try:
sensors[cn_i].schedule_update_ha_state()
except AttributeError:
except (AttributeError, AssertionError):
_LOGGER.debug(
"Sensor %s (%s, cons.) not yet ready for update",
mac,
Expand All @@ -749,7 +749,7 @@ def discover_ble_devices(config, aeskeyslist, whitelist):
setattr(sensors[sw_i], "_state", switch_m_data[mac])
try:
sensors[sw_i].schedule_update_ha_state()
except AttributeError:
except (AttributeError, AssertionError):
_LOGGER.debug(
"Sensor %s (%s, switch) not yet ready for update",
mac,
Expand Down

0 comments on commit 16bc34a

Please sign in to comment.