Add Abode water valve support (#30635)

This commit is contained in:
shred86 2020-02-08 07:58:07 -08:00 committed by GitHub
parent 967b02073e
commit 14e0dde055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,8 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
DEVICE_TYPES = [CONST.TYPE_SWITCH, CONST.TYPE_VALVE]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode switch devices."""
@ -18,8 +20,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
entities = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_SWITCH):
entities.append(AbodeSwitch(data, device))
for device_type in DEVICE_TYPES:
for device in data.abode.get_devices(generic_type=device_type):
entities.append(AbodeSwitch(data, device))
for automation in data.abode.get_automations(generic_type=CONST.TYPE_AUTOMATION):
entities.append(