mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Added spcific exception type for failure to communicate with Vera controller
This commit is contained in:
parent
6dc18ba603
commit
38fbc3595a
@ -83,8 +83,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
devices = []
|
||||
try:
|
||||
devices = controller.get_devices('Switch')
|
||||
# pylint: disable=broad-except
|
||||
except Exception as inst:
|
||||
except IOError as inst:
|
||||
# There was a network related error connecting to the vera controller
|
||||
_LOGGER.error("Could not find Vera lights: %s", inst)
|
||||
return False
|
||||
|
||||
|
@ -83,8 +83,8 @@ def get_devices(hass, config):
|
||||
devices = []
|
||||
try:
|
||||
devices = vera_controller.get_devices(categories)
|
||||
# pylint: disable=broad-except
|
||||
except Exception as inst:
|
||||
except IOError as inst:
|
||||
# There was a network related error connecting to the vera controller
|
||||
_LOGGER.error("Could not find Vera sensors: %s", inst)
|
||||
return False
|
||||
|
||||
|
@ -82,8 +82,8 @@ def get_devices(hass, config):
|
||||
devices = []
|
||||
try:
|
||||
devices = vera_controller.get_devices(['Switch', 'Armable Sensor'])
|
||||
# pylint: disable=broad-except
|
||||
except Exception as inst:
|
||||
except IOError as inst:
|
||||
# There was a network related error connecting to the vera controller
|
||||
_LOGGER.error("Could not find Vera switches: %s", inst)
|
||||
return False
|
||||
|
||||
@ -175,7 +175,6 @@ class VeraSwitch(ToggleDevice):
|
||||
@property
|
||||
def is_on(self):
|
||||
""" True if device is on. """
|
||||
self.update()
|
||||
return self.is_on_status
|
||||
|
||||
def update(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user