From 11fa83b8a41a13b38b35a91a589e487a133ae28c Mon Sep 17 00:00:00 2001 From: Grm Date: Sat, 6 Jun 2020 01:58:47 +0200 Subject: [PATCH] enable binary_sensor for smart gardena --- custom_components/gardena_smart_system/__init__.py | 2 +- custom_components/gardena_smart_system/binary_sensor.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/gardena_smart_system/__init__.py b/custom_components/gardena_smart_system/__init__.py index ac6d6b9..bf52143 100644 --- a/custom_components/gardena_smart_system/__init__.py +++ b/custom_components/gardena_smart_system/__init__.py @@ -27,7 +27,7 @@ _LOGGER = logging.getLogger(__name__) -PLATFORMS = ("vacuum", "sensor", "switch") +PLATFORMS = ("vacuum", "sensor", "switch", "binary_sensor") async def async_setup(hass: HomeAssistant, config: dict): diff --git a/custom_components/gardena_smart_system/binary_sensor.py b/custom_components/gardena_smart_system/binary_sensor.py index f3e54b1..c770257 100644 --- a/custom_components/gardena_smart_system/binary_sensor.py +++ b/custom_components/gardena_smart_system/binary_sensor.py @@ -3,12 +3,13 @@ BinarySensorEntity, ) +from custom_components.gardena_smart_system import GARDENA_SYSTEM from .const import DOMAIN async def async_setup_entry(hass, config_entry, async_add_entities): """Perform the setup for Gardena websocket connection status.""" - async_add_entities(SmartSystemWebsocketStatus(hass.data[DOMAIN]), True) + async_add_entities([SmartSystemWebsocketStatus(hass.data[DOMAIN][GARDENA_SYSTEM])], True) class SmartSystemWebsocketStatus(BinarySensorEntity):