From 0224695a0182886ff2946aaa90f615989b475e8f Mon Sep 17 00:00:00 2001 From: EnzoD86 <61162811+EnzoD86@users.noreply.github.com> Date: Thu, 25 Jul 2024 03:01:41 +0200 Subject: [PATCH] Refactoring --- custom_components/tuya_smart_ir_ac/__init__.py | 3 ++- custom_components/tuya_smart_ir_ac/api.py | 2 +- custom_components/tuya_smart_ir_ac/manifest.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/tuya_smart_ir_ac/__init__.py b/custom_components/tuya_smart_ir_ac/__init__.py index 54ea546..2b8b913 100644 --- a/custom_components/tuya_smart_ir_ac/__init__.py +++ b/custom_components/tuya_smart_ir_ac/__init__.py @@ -29,11 +29,12 @@ async def async_setup(hass, config): if DOMAIN not in config: - _LOGGER.error("Cannot find tuya_smart_ir platform on configuration.yaml") + _LOGGER.error(f"Cannot find {DOMAIN} platform on configuration.yaml") return False cfg = config.get(DOMAIN) tuya_country = cfg.get(CONF_TUYA_COUNTRY) + api_endpoint = TUYA_ENDPOINTS.get(tuya_country) access_id = cfg.get(CONF_ACCESS_ID) access_secret = cfg.get(CONF_ACCESS_SECRET) diff --git a/custom_components/tuya_smart_ir_ac/api.py b/custom_components/tuya_smart_ir_ac/api.py index 5aafa9b..c0509da 100644 --- a/custom_components/tuya_smart_ir_ac/api.py +++ b/custom_components/tuya_smart_ir_ac/api.py @@ -1,6 +1,6 @@ import logging -_LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__package__) class TuyaAPI: diff --git a/custom_components/tuya_smart_ir_ac/manifest.json b/custom_components/tuya_smart_ir_ac/manifest.json index 6f8a23f..5e673fe 100644 --- a/custom_components/tuya_smart_ir_ac/manifest.json +++ b/custom_components/tuya_smart_ir_ac/manifest.json @@ -7,5 +7,5 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/EnzoD86/tuya-smart-ir-ac/issues", "requirements": ["tuya-connector-python==0.1.2"], - "version": "2024.8.1" -} + "version": "2024.8.0" +} \ No newline at end of file