Catch all Ring timeout errors (#30960)

* Catch more Ring errors

* Fix comment & Disable wifi entities by default
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-01-19 13:39:16 -08:00
1 parent 8fcd0e9a79
commit ecef0f6e93
4 files changed
+49 -11

No files matched your search

+6 -6
View File
@@ -15,9 +15,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a sensor for a Ring device."""
devices = hass.data[DOMAIN][config_entry.entry_id]["devices"]
# Makes a ton of requests. We will make this a config entry option in the future
wifi_enabled = False
sensors = []
for device_type in ("chimes", "doorbots", "authorized_doorbots", "stickup_cams"):
@@ -25,9 +22,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if device_type not in SENSOR_TYPES[sensor_type][1]:
continue
if not wifi_enabled and sensor_type.startswith("wifi_"):
continue
for device in devices[device_type]:
if device_type == "battery" and device.battery_life is None:
continue
@@ -124,6 +118,12 @@ class HealthDataRingSensor(RingSensor):
"""Call update method."""
self.async_write_ha_state()
@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added to the entity registry."""
# These sensors are data hungry and not useful. Disable by default.
return False
@property
def state(self):
"""Return the state of the sensor."""