From da5b26ed26096446dd9686421c9249328c72b106 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Tue, 10 Aug 2021 01:34:16 -0700 Subject: [PATCH] Temporary bugfix for AwningValance (until this is fixed serverside) (#511) * Temporary bugfix for https://github.com/iMicknl/ha-tahoma/issues/486 * Add note --- custom_components/tahoma/cover.py | 6 ++++-- custom_components/tahoma/cover_devices/awning.py | 5 +---- custom_components/tahoma/cover_devices/vertical_cover.py | 5 +---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/custom_components/tahoma/cover.py b/custom_components/tahoma/cover.py index 50a4f81af..829952cd3 100644 --- a/custom_components/tahoma/cover.py +++ b/custom_components/tahoma/cover.py @@ -25,16 +25,18 @@ async def async_setup_entry( data = hass.data[DOMAIN][entry.entry_id] coordinator = data["coordinator"] + # Includes fix for #486, which is waiting on Somfy back-end deployment + # Remove when DeploymentState will be returned for AwningValance entities = [ Awning(device.deviceurl, coordinator) for device in data["platforms"].get(COVER) - if device.ui_class == "Awning" + if device.ui_class == "Awning" and device.widget != "AwningValance" ] entities += [ VerticalCover(device.deviceurl, coordinator) for device in data["platforms"].get(COVER) - if device.ui_class != "Awning" + if device.ui_class != "Awning" or device.widget == "AwningValance" ] async_add_entities(entities) diff --git a/custom_components/tahoma/cover_devices/awning.py b/custom_components/tahoma/cover_devices/awning.py index 4ce35dadd..149aaab6b 100644 --- a/custom_components/tahoma/cover_devices/awning.py +++ b/custom_components/tahoma/cover_devices/awning.py @@ -8,10 +8,7 @@ SUPPORT_STOP, ) -from custom_components.tahoma.cover_devices.tahoma_cover import ( - COMMANDS_STOP, - TahomaGenericCover, -) +from .tahoma_cover import COMMANDS_STOP, TahomaGenericCover COMMAND_DEPLOY = "deploy" COMMAND_SET_DEPLOYMENT = "setDeployment" diff --git a/custom_components/tahoma/cover_devices/vertical_cover.py b/custom_components/tahoma/cover_devices/vertical_cover.py index b64384c93..f42756e4e 100644 --- a/custom_components/tahoma/cover_devices/vertical_cover.py +++ b/custom_components/tahoma/cover_devices/vertical_cover.py @@ -14,10 +14,7 @@ SUPPORT_STOP, ) -from custom_components.tahoma.cover_devices.tahoma_cover import ( - COMMANDS_STOP, - TahomaGenericCover, -) +from .tahoma_cover import COMMANDS_STOP, TahomaGenericCover COMMAND_CYCLE = "cycle" COMMAND_CLOSE = "close"