From b59444d15c5eefd03b0024ebcb65136a68e7020b Mon Sep 17 00:00:00 2001 From: Michal Kochel Date: Fri, 25 Aug 2023 12:16:38 +0200 Subject: [PATCH 1/3] Fixed reload issue Fixes https://github.com/custom-components/climate.programmable_thermostat/issues/44. The `async_setup_reload_service()` function expects a list as the third argument, not a string. The definition: https://github.com/home-assistant/core/blob/2023.8.4/homeassistant/helpers/reload.py#L167 --- custom_components/programmable_thermostat/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/programmable_thermostat/const.py b/custom_components/programmable_thermostat/const.py index d83e807..93c7abf 100644 --- a/custom_components/programmable_thermostat/const.py +++ b/custom_components/programmable_thermostat/const.py @@ -8,7 +8,7 @@ #Generic VERSION = '8.2' DOMAIN = 'programmable_thermostat' -PLATFORM = 'climate' +PLATFORM = ['climate'] ISSUE_URL = 'https://github.com/custom-components/climate.programmable_thermostat/issues' CONFIGFLOW_VERSION = 4 From 86f8a426533ff53773eedf454ddbfb8173d8d572 Mon Sep 17 00:00:00 2001 From: Michal Kochel Date: Fri, 25 Aug 2023 12:24:41 +0200 Subject: [PATCH 2/3] Reverted const.py. --- custom_components/programmable_thermostat/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/programmable_thermostat/const.py b/custom_components/programmable_thermostat/const.py index 93c7abf..d83e807 100644 --- a/custom_components/programmable_thermostat/const.py +++ b/custom_components/programmable_thermostat/const.py @@ -8,7 +8,7 @@ #Generic VERSION = '8.2' DOMAIN = 'programmable_thermostat' -PLATFORM = ['climate'] +PLATFORM = 'climate' ISSUE_URL = 'https://github.com/custom-components/climate.programmable_thermostat/issues' CONFIGFLOW_VERSION = 4 From 3401edbeb480fa40fd2118621b34732ba0e3289a Mon Sep 17 00:00:00 2001 From: Michal Kochel Date: Fri, 25 Aug 2023 12:25:13 +0200 Subject: [PATCH 3/3] Update climate.py --- custom_components/programmable_thermostat/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/programmable_thermostat/climate.py b/custom_components/programmable_thermostat/climate.py index 77b7604..35c809d 100755 --- a/custom_components/programmable_thermostat/climate.py +++ b/custom_components/programmable_thermostat/climate.py @@ -73,7 +73,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Add ProgrammableThermostat entities from configuration.yaml.""" _LOGGER.info("Setup entity coming from configuration.yaml named: %s", config.get(CONF_NAME)) - await async_setup_reload_service(hass, DOMAIN, PLATFORM) + await async_setup_reload_service(hass, DOMAIN, [PLATFORM]) async_add_entities([ProgrammableThermostat(hass, config)]) async def async_setup_entry(hass, config_entry, async_add_devices): @@ -84,7 +84,7 @@ async def async_setup_entry(hass, config_entry, async_add_devices): else: result = config_entry.data _LOGGER.info("setup entity-config_entry_data=%s",result) - await async_setup_reload_service(hass, DOMAIN, PLATFORM) + await async_setup_reload_service(hass, DOMAIN, [PLATFORM]) async_add_devices([ProgrammableThermostat(hass, result)])