From 45bb77285a0756bf05515215d4c5a18599d10c5b Mon Sep 17 00:00:00 2001 From: Philipp Grimm Date: Mon, 12 Feb 2024 22:36:23 +0100 Subject: [PATCH] change import * to explicit imports for homeassistant.const --- changes.md | 1 + custom_components/eltako/binary_sensor.py | 8 ++++---- custom_components/eltako/climate.py | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/changes.md b/changes.md index 0bec7b42..152adcf0 100644 --- a/changes.md +++ b/changes.md @@ -2,6 +2,7 @@ ## Version 1.3.7 Import Cleanup * Trial to remove import warnings (Reported Issue: https://github.com/grimmpp/home-assistant-eltako/issues/61) +* 🐞 Removed entity_id bug from GatewayConnectionState 🐞 ## Version 1.3.6 Dependencies fixed for 1.3.5 * 🐞 Wrong dependency in manifest 🐞 diff --git a/custom_components/eltako/binary_sensor.py b/custom_components/eltako/binary_sensor.py index bd4e05e5..e23f0225 100644 --- a/custom_components/eltako/binary_sensor.py +++ b/custom_components/eltako/binary_sensor.py @@ -33,13 +33,13 @@ async def async_setup_entry( platform = Platform.BINARY_SENSOR - for platform in [Platform.BINARY_SENSOR, Platform.SENSOR]: - if platform in config: - for entity_config in config[platform]: + for platform_id in [Platform.BINARY_SENSOR, Platform.SENSOR]: + if platform_id in config: + for entity_config in config[platform_id]: try: dev_conf = config_helpers.DeviceConf(entity_config, [CONF_DEVICE_CLASS, CONF_INVERT_SIGNAL]) if dev_conf.eep.eep_string in CONF_EEP_SUPPORTED_BINARY_SENSOR: - entities.append(EltakoBinarySensor(platform, gateway, dev_conf.id, dev_conf.name, dev_conf.eep, + entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep, dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL))) except Exception as e: diff --git a/custom_components/eltako/climate.py b/custom_components/eltako/climate.py index 05cb026c..3c0f180c 100644 --- a/custom_components/eltako/climate.py +++ b/custom_components/eltako/climate.py @@ -17,10 +17,9 @@ ClimateEntityFeature ) from homeassistant import config_entries -from homeassistant.const import CONF_ID, CONF_NAME, Platform, TEMP_CELSIUS, CONF_TEMPERATURE_UNIT, Platform +from homeassistant.const import Platform, CONF_TEMPERATURE_UNIT, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.typing import ConfigType from .gateway import EnOceanGateway