From f84317e325b409bd3037b9125c2e92f68d78ff81 Mon Sep 17 00:00:00 2001 From: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com> Date: Mon, 4 Feb 2019 23:42:30 -0600 Subject: [PATCH] Update pysmartthings to 0.5.0 (#20759) --- homeassistant/components/smartthings/__init__.py | 6 ++++-- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/smartthings/__init__.py b/homeassistant/components/smartthings/__init__.py index d86524ef62b..bdbbfcf2590 100644 --- a/homeassistant/components/smartthings/__init__.py +++ b/homeassistant/components/smartthings/__init__.py @@ -23,7 +23,7 @@ from .const import ( from .smartapp import ( setup_smartapp, setup_smartapp_endpoint, validate_installed_app) -REQUIREMENTS = ['pysmartapp==0.3.0', 'pysmartthings==0.4.2'] +REQUIREMENTS = ['pysmartapp==0.3.0', 'pysmartthings==0.5.0'] DEPENDENCIES = ['webhook'] _LOGGER = logging.getLogger(__name__) @@ -139,6 +139,7 @@ class DeviceBroker: async def event_handler(self, req, resp, app): """Broker for incoming events.""" from pysmartapp.event import EVENT_TYPE_DEVICE + from pysmartthings import Capability, Attribute # Do not process events received from a different installed app # under the same parent SmartApp (valid use-scenario) @@ -156,7 +157,8 @@ class DeviceBroker: evt.component_id, evt.capability, evt.attribute, evt.value) # Fire events for buttons - if evt.capability == 'button' and evt.attribute == 'button': + if evt.capability == Capability.button and \ + evt.attribute == Attribute.button: data = { 'component_id': evt.component_id, 'device_id': evt.device_id, diff --git a/requirements_all.txt b/requirements_all.txt index fc4adb0309c..791e6d5ddd6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1228,7 +1228,7 @@ pysma==0.3.1 pysmartapp==0.3.0 # homeassistant.components.smartthings -pysmartthings==0.4.2 +pysmartthings==0.5.0 # homeassistant.components.device_tracker.snmp # homeassistant.components.sensor.snmp diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3ec1c7d35fa..611b20d6a0c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -217,7 +217,7 @@ pyqwikswitch==0.8 pysmartapp==0.3.0 # homeassistant.components.smartthings -pysmartthings==0.4.2 +pysmartthings==0.5.0 # homeassistant.components.sonos pysonos==0.0.6