From 85e486863b80d4ce3fe26666c0f16137060f78e2 Mon Sep 17 00:00:00 2001 From: jontofront Date: Thu, 11 Jan 2024 21:05:54 +0200 Subject: [PATCH] remove dublicate funkcion --- custom_components/econet300/binary_sensor.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/custom_components/econet300/binary_sensor.py b/custom_components/econet300/binary_sensor.py index 9324ccc..6b3085d 100644 --- a/custom_components/econet300/binary_sensor.py +++ b/custom_components/econet300/binary_sensor.py @@ -3,7 +3,6 @@ import logging from homeassistant.components.binary_sensor import ( - BinarySensorEntityDescription, BinarySensorEntity, BinarySensorEntityDescription, ) @@ -11,19 +10,19 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .entity import EconetEntity +from .common import Econet300Api, EconetDataCoordinator from .common_functions import camel_to_snake -from .common import EconetDataCoordinator, Econet300Api from .const import ( - DOMAIN, - SERVICE_COORDINATOR, - SERVICE_API, + AVAILABLE_NUMBER_OF_MIXERS, BINARY_SENSOR_MAP, + DOMAIN, ENTITY_DEVICE_CLASS_MAP, ENTITY_ICON, ENTITY_ICON_OFF, - AVAILABLE_NUMBER_OF_MIXERS, + SERVICE_API, + SERVICE_COORDINATOR, ) +from .entity import EconetEntity _LOGGER = logging.getLogger(__name__) @@ -36,7 +35,6 @@ class EconetBinarySensorEntityDescription(BinarySensorEntityDescription): availability_key: str = "" - class EconetBinarySensor(EconetEntity, BinarySensorEntity): """Econet Binary Sensor""" @@ -90,11 +88,6 @@ def create_binary_entity_description(key: str) -> EconetBinarySensorEntityDescri return entity_description -def can_add_mixer(desc: str, coordinator: EconetDataCoordinator): - """Check if can add mixer entity""" - return coordinator.has_data(desc) and coordinator.data[desc] is not None - - def can_add_mixer(desc: str, coordinator: EconetDataCoordinator): return coordinator.has_data(desc) and coordinator.data[desc] is not None