From b405d91f8794588d987814e06becca79d22eb498 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 10:52:15 +0000 Subject: [PATCH 01/12] Added non-standard port specification --- custom_components/wiser/config_flow.py | 7 ++++++- custom_components/wiser/coordinator.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser/config_flow.py index 2f1b310..e7ce4a7 100755 --- a/custom_components/wiser/config_flow.py +++ b/custom_components/wiser/config_flow.py @@ -17,7 +17,7 @@ from homeassistant import config_entries, exceptions from homeassistant.components import zeroconf -from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_SCAN_INTERVAL +from homeassistant.const import CONF_HOST, CONF_PORT, CONF_NAME, CONF_PASSWORD, CONF_SCAN_INTERVAL from homeassistant.core import HomeAssistant, callback from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers.selector import selector, SelectSelectorMode @@ -57,6 +57,7 @@ async def validate_input(hass: HomeAssistant, data): """ wiserhub = WiserAPI( host=data[CONF_HOST], + port=data[CONF_PORT], secret=data[CONF_PASSWORD], session=async_get_clientsession(hass), extra_config_file=hass.config.config_dir + CUSTOM_DATA_STORE, @@ -140,6 +141,7 @@ async def async_step_zeroconf( if not discovery_info.name.startswith("WiserHeat"): return self.async_abort(reason="not_wiser_hub") host = discovery_info.host + port = discovery_info.port zctype = discovery_info.type name = discovery_info.name.replace(f".{zctype}", "") @@ -151,6 +153,7 @@ async def async_step_zeroconf( self.discovery_info.update( { CONF_HOST: host, + CONF_PORT: port, CONF_HOSTNAME: discovery_info.hostname.replace(".local.", ".local"), CONF_NAME: name, } @@ -192,6 +195,7 @@ async def async_step_zeroconf_confirm( "name": self.discovery_info[CONF_NAME], "hostname": self.discovery_info[CONF_HOSTNAME], "ip_address": self.discovery_info[CONF_HOST], + "port": self.discovery_info[CONF_PORT], }, data_schema=vol.Schema( { @@ -250,6 +254,7 @@ async def async_step_main_params(self, user_input=None): if user_input[CONF_HOST]: data = { CONF_HOST: user_input[CONF_HOST], + CONF_PORT: user_input[CONF_PORT], CONF_PASSWORD: self.config_entry.data[CONF_PASSWORD], CONF_NAME: self.config_entry.data[CONF_NAME], } diff --git a/custom_components/wiser/coordinator.py b/custom_components/wiser/coordinator.py index fd877f0..7a51459 100644 --- a/custom_components/wiser/coordinator.py +++ b/custom_components/wiser/coordinator.py @@ -12,7 +12,7 @@ ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_SCAN_INTERVAL +from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PASSWORD, CONF_SCAN_INTERVAL from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.update_coordinator import DataUpdateCoordinator @@ -111,6 +111,7 @@ def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None: self.wiserhub = WiserAPI( host=config_entry.data[CONF_HOST], + port=config_entry.data[CONF_PORT], secret=str(config_entry.data[CONF_PASSWORD]).strip(), extra_config_file=hass.config.config_dir + CUSTOM_DATA_STORE, enable_automations=self.enable_automations_passive_mode, From 2a0a7f589e153b9189395251c7832d4bab01cdaa Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:10:38 +0000 Subject: [PATCH 02/12] Renamed 'wiser' dir to avoid clash while testing --- custom_components/{wiser => wiser_tmp}/__init__.py | 0 custom_components/{wiser => wiser_tmp}/button.py | 0 custom_components/{wiser => wiser_tmp}/climate.py | 0 custom_components/{wiser => wiser_tmp}/config_flow.py | 0 custom_components/{wiser => wiser_tmp}/const.py | 0 custom_components/{wiser => wiser_tmp}/coordinator.py | 0 custom_components/{wiser => wiser_tmp}/cover.py | 0 custom_components/{wiser => wiser_tmp}/device_trigger.py | 0 custom_components/{wiser => wiser_tmp}/diagnostics.py | 0 custom_components/{wiser => wiser_tmp}/events.py | 0 custom_components/{wiser => wiser_tmp}/frontend/__init__.py | 0 .../{wiser => wiser_tmp}/frontend/wiser-schedule-card.js | 0 .../{wiser => wiser_tmp}/frontend/wiser-zigbee-card.js | 0 custom_components/{wiser => wiser_tmp}/helpers.py | 0 custom_components/{wiser => wiser_tmp}/light.py | 0 custom_components/{wiser => wiser_tmp}/manifest.json | 0 custom_components/{wiser => wiser_tmp}/number.py | 0 custom_components/{wiser => wiser_tmp}/schedules.py | 0 custom_components/{wiser => wiser_tmp}/select.py | 0 custom_components/{wiser => wiser_tmp}/sensor.py | 0 custom_components/{wiser => wiser_tmp}/services.py | 0 custom_components/{wiser => wiser_tmp}/services.yaml | 0 custom_components/{wiser => wiser_tmp}/strings.json | 0 custom_components/{wiser => wiser_tmp}/switch.py | 0 custom_components/{wiser => wiser_tmp}/translations/de.json | 0 custom_components/{wiser => wiser_tmp}/translations/en.json | 0 custom_components/{wiser => wiser_tmp}/translations/fr.json | 0 custom_components/{wiser => wiser_tmp}/websockets.py | 0 hacs.json | 6 +++--- 29 files changed, 3 insertions(+), 3 deletions(-) rename custom_components/{wiser => wiser_tmp}/__init__.py (100%) rename custom_components/{wiser => wiser_tmp}/button.py (100%) rename custom_components/{wiser => wiser_tmp}/climate.py (100%) rename custom_components/{wiser => wiser_tmp}/config_flow.py (100%) rename custom_components/{wiser => wiser_tmp}/const.py (100%) rename custom_components/{wiser => wiser_tmp}/coordinator.py (100%) rename custom_components/{wiser => wiser_tmp}/cover.py (100%) rename custom_components/{wiser => wiser_tmp}/device_trigger.py (100%) rename custom_components/{wiser => wiser_tmp}/diagnostics.py (100%) rename custom_components/{wiser => wiser_tmp}/events.py (100%) rename custom_components/{wiser => wiser_tmp}/frontend/__init__.py (100%) rename custom_components/{wiser => wiser_tmp}/frontend/wiser-schedule-card.js (100%) rename custom_components/{wiser => wiser_tmp}/frontend/wiser-zigbee-card.js (100%) rename custom_components/{wiser => wiser_tmp}/helpers.py (100%) rename custom_components/{wiser => wiser_tmp}/light.py (100%) rename custom_components/{wiser => wiser_tmp}/manifest.json (100%) rename custom_components/{wiser => wiser_tmp}/number.py (100%) rename custom_components/{wiser => wiser_tmp}/schedules.py (100%) rename custom_components/{wiser => wiser_tmp}/select.py (100%) rename custom_components/{wiser => wiser_tmp}/sensor.py (100%) rename custom_components/{wiser => wiser_tmp}/services.py (100%) rename custom_components/{wiser => wiser_tmp}/services.yaml (100%) rename custom_components/{wiser => wiser_tmp}/strings.json (100%) rename custom_components/{wiser => wiser_tmp}/switch.py (100%) rename custom_components/{wiser => wiser_tmp}/translations/de.json (100%) rename custom_components/{wiser => wiser_tmp}/translations/en.json (100%) rename custom_components/{wiser => wiser_tmp}/translations/fr.json (100%) rename custom_components/{wiser => wiser_tmp}/websockets.py (100%) diff --git a/custom_components/wiser/__init__.py b/custom_components/wiser_tmp/__init__.py similarity index 100% rename from custom_components/wiser/__init__.py rename to custom_components/wiser_tmp/__init__.py diff --git a/custom_components/wiser/button.py b/custom_components/wiser_tmp/button.py similarity index 100% rename from custom_components/wiser/button.py rename to custom_components/wiser_tmp/button.py diff --git a/custom_components/wiser/climate.py b/custom_components/wiser_tmp/climate.py similarity index 100% rename from custom_components/wiser/climate.py rename to custom_components/wiser_tmp/climate.py diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser_tmp/config_flow.py similarity index 100% rename from custom_components/wiser/config_flow.py rename to custom_components/wiser_tmp/config_flow.py diff --git a/custom_components/wiser/const.py b/custom_components/wiser_tmp/const.py similarity index 100% rename from custom_components/wiser/const.py rename to custom_components/wiser_tmp/const.py diff --git a/custom_components/wiser/coordinator.py b/custom_components/wiser_tmp/coordinator.py similarity index 100% rename from custom_components/wiser/coordinator.py rename to custom_components/wiser_tmp/coordinator.py diff --git a/custom_components/wiser/cover.py b/custom_components/wiser_tmp/cover.py similarity index 100% rename from custom_components/wiser/cover.py rename to custom_components/wiser_tmp/cover.py diff --git a/custom_components/wiser/device_trigger.py b/custom_components/wiser_tmp/device_trigger.py similarity index 100% rename from custom_components/wiser/device_trigger.py rename to custom_components/wiser_tmp/device_trigger.py diff --git a/custom_components/wiser/diagnostics.py b/custom_components/wiser_tmp/diagnostics.py similarity index 100% rename from custom_components/wiser/diagnostics.py rename to custom_components/wiser_tmp/diagnostics.py diff --git a/custom_components/wiser/events.py b/custom_components/wiser_tmp/events.py similarity index 100% rename from custom_components/wiser/events.py rename to custom_components/wiser_tmp/events.py diff --git a/custom_components/wiser/frontend/__init__.py b/custom_components/wiser_tmp/frontend/__init__.py similarity index 100% rename from custom_components/wiser/frontend/__init__.py rename to custom_components/wiser_tmp/frontend/__init__.py diff --git a/custom_components/wiser/frontend/wiser-schedule-card.js b/custom_components/wiser_tmp/frontend/wiser-schedule-card.js similarity index 100% rename from custom_components/wiser/frontend/wiser-schedule-card.js rename to custom_components/wiser_tmp/frontend/wiser-schedule-card.js diff --git a/custom_components/wiser/frontend/wiser-zigbee-card.js b/custom_components/wiser_tmp/frontend/wiser-zigbee-card.js similarity index 100% rename from custom_components/wiser/frontend/wiser-zigbee-card.js rename to custom_components/wiser_tmp/frontend/wiser-zigbee-card.js diff --git a/custom_components/wiser/helpers.py b/custom_components/wiser_tmp/helpers.py similarity index 100% rename from custom_components/wiser/helpers.py rename to custom_components/wiser_tmp/helpers.py diff --git a/custom_components/wiser/light.py b/custom_components/wiser_tmp/light.py similarity index 100% rename from custom_components/wiser/light.py rename to custom_components/wiser_tmp/light.py diff --git a/custom_components/wiser/manifest.json b/custom_components/wiser_tmp/manifest.json similarity index 100% rename from custom_components/wiser/manifest.json rename to custom_components/wiser_tmp/manifest.json diff --git a/custom_components/wiser/number.py b/custom_components/wiser_tmp/number.py similarity index 100% rename from custom_components/wiser/number.py rename to custom_components/wiser_tmp/number.py diff --git a/custom_components/wiser/schedules.py b/custom_components/wiser_tmp/schedules.py similarity index 100% rename from custom_components/wiser/schedules.py rename to custom_components/wiser_tmp/schedules.py diff --git a/custom_components/wiser/select.py b/custom_components/wiser_tmp/select.py similarity index 100% rename from custom_components/wiser/select.py rename to custom_components/wiser_tmp/select.py diff --git a/custom_components/wiser/sensor.py b/custom_components/wiser_tmp/sensor.py similarity index 100% rename from custom_components/wiser/sensor.py rename to custom_components/wiser_tmp/sensor.py diff --git a/custom_components/wiser/services.py b/custom_components/wiser_tmp/services.py similarity index 100% rename from custom_components/wiser/services.py rename to custom_components/wiser_tmp/services.py diff --git a/custom_components/wiser/services.yaml b/custom_components/wiser_tmp/services.yaml similarity index 100% rename from custom_components/wiser/services.yaml rename to custom_components/wiser_tmp/services.yaml diff --git a/custom_components/wiser/strings.json b/custom_components/wiser_tmp/strings.json similarity index 100% rename from custom_components/wiser/strings.json rename to custom_components/wiser_tmp/strings.json diff --git a/custom_components/wiser/switch.py b/custom_components/wiser_tmp/switch.py similarity index 100% rename from custom_components/wiser/switch.py rename to custom_components/wiser_tmp/switch.py diff --git a/custom_components/wiser/translations/de.json b/custom_components/wiser_tmp/translations/de.json similarity index 100% rename from custom_components/wiser/translations/de.json rename to custom_components/wiser_tmp/translations/de.json diff --git a/custom_components/wiser/translations/en.json b/custom_components/wiser_tmp/translations/en.json similarity index 100% rename from custom_components/wiser/translations/en.json rename to custom_components/wiser_tmp/translations/en.json diff --git a/custom_components/wiser/translations/fr.json b/custom_components/wiser_tmp/translations/fr.json similarity index 100% rename from custom_components/wiser/translations/fr.json rename to custom_components/wiser_tmp/translations/fr.json diff --git a/custom_components/wiser/websockets.py b/custom_components/wiser_tmp/websockets.py similarity index 100% rename from custom_components/wiser/websockets.py rename to custom_components/wiser_tmp/websockets.py diff --git a/hacs.json b/hacs.json index 0f77b62..3df9a6d 100644 --- a/hacs.json +++ b/hacs.json @@ -2,6 +2,6 @@ "name": "Drayton Wiser Integration for Home Assistant", "homeassistant": "2023.12", "render_readme": true, - "zip_release": true, - "filename": "wiser.zip" -} \ No newline at end of file + "zip_release": false, + // "filename": "wiser.zip" +} From 0c94cafb4b986a7ed877c02b2e6f74ddd938fa20 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:15:01 +0000 Subject: [PATCH 03/12] Updated manifest for testing --- custom_components/{wiser_tmp => wiser}/__init__.py | 0 custom_components/{wiser_tmp => wiser}/button.py | 0 custom_components/{wiser_tmp => wiser}/climate.py | 0 custom_components/{wiser_tmp => wiser}/config_flow.py | 0 custom_components/{wiser_tmp => wiser}/const.py | 0 custom_components/{wiser_tmp => wiser}/coordinator.py | 0 custom_components/{wiser_tmp => wiser}/cover.py | 0 custom_components/{wiser_tmp => wiser}/device_trigger.py | 0 custom_components/{wiser_tmp => wiser}/diagnostics.py | 0 custom_components/{wiser_tmp => wiser}/events.py | 0 custom_components/{wiser_tmp => wiser}/frontend/__init__.py | 0 .../{wiser_tmp => wiser}/frontend/wiser-schedule-card.js | 0 .../{wiser_tmp => wiser}/frontend/wiser-zigbee-card.js | 0 custom_components/{wiser_tmp => wiser}/helpers.py | 0 custom_components/{wiser_tmp => wiser}/light.py | 0 custom_components/{wiser_tmp => wiser}/manifest.json | 4 ++-- custom_components/{wiser_tmp => wiser}/number.py | 0 custom_components/{wiser_tmp => wiser}/schedules.py | 0 custom_components/{wiser_tmp => wiser}/select.py | 0 custom_components/{wiser_tmp => wiser}/sensor.py | 0 custom_components/{wiser_tmp => wiser}/services.py | 0 custom_components/{wiser_tmp => wiser}/services.yaml | 0 custom_components/{wiser_tmp => wiser}/strings.json | 0 custom_components/{wiser_tmp => wiser}/switch.py | 0 custom_components/{wiser_tmp => wiser}/translations/de.json | 0 custom_components/{wiser_tmp => wiser}/translations/en.json | 0 custom_components/{wiser_tmp => wiser}/translations/fr.json | 0 custom_components/{wiser_tmp => wiser}/websockets.py | 0 28 files changed, 2 insertions(+), 2 deletions(-) rename custom_components/{wiser_tmp => wiser}/__init__.py (100%) rename custom_components/{wiser_tmp => wiser}/button.py (100%) rename custom_components/{wiser_tmp => wiser}/climate.py (100%) rename custom_components/{wiser_tmp => wiser}/config_flow.py (100%) rename custom_components/{wiser_tmp => wiser}/const.py (100%) rename custom_components/{wiser_tmp => wiser}/coordinator.py (100%) rename custom_components/{wiser_tmp => wiser}/cover.py (100%) rename custom_components/{wiser_tmp => wiser}/device_trigger.py (100%) rename custom_components/{wiser_tmp => wiser}/diagnostics.py (100%) rename custom_components/{wiser_tmp => wiser}/events.py (100%) rename custom_components/{wiser_tmp => wiser}/frontend/__init__.py (100%) rename custom_components/{wiser_tmp => wiser}/frontend/wiser-schedule-card.js (100%) rename custom_components/{wiser_tmp => wiser}/frontend/wiser-zigbee-card.js (100%) rename custom_components/{wiser_tmp => wiser}/helpers.py (100%) rename custom_components/{wiser_tmp => wiser}/light.py (100%) rename custom_components/{wiser_tmp => wiser}/manifest.json (95%) rename custom_components/{wiser_tmp => wiser}/number.py (100%) rename custom_components/{wiser_tmp => wiser}/schedules.py (100%) rename custom_components/{wiser_tmp => wiser}/select.py (100%) rename custom_components/{wiser_tmp => wiser}/sensor.py (100%) rename custom_components/{wiser_tmp => wiser}/services.py (100%) rename custom_components/{wiser_tmp => wiser}/services.yaml (100%) rename custom_components/{wiser_tmp => wiser}/strings.json (100%) rename custom_components/{wiser_tmp => wiser}/switch.py (100%) rename custom_components/{wiser_tmp => wiser}/translations/de.json (100%) rename custom_components/{wiser_tmp => wiser}/translations/en.json (100%) rename custom_components/{wiser_tmp => wiser}/translations/fr.json (100%) rename custom_components/{wiser_tmp => wiser}/websockets.py (100%) diff --git a/custom_components/wiser_tmp/__init__.py b/custom_components/wiser/__init__.py similarity index 100% rename from custom_components/wiser_tmp/__init__.py rename to custom_components/wiser/__init__.py diff --git a/custom_components/wiser_tmp/button.py b/custom_components/wiser/button.py similarity index 100% rename from custom_components/wiser_tmp/button.py rename to custom_components/wiser/button.py diff --git a/custom_components/wiser_tmp/climate.py b/custom_components/wiser/climate.py similarity index 100% rename from custom_components/wiser_tmp/climate.py rename to custom_components/wiser/climate.py diff --git a/custom_components/wiser_tmp/config_flow.py b/custom_components/wiser/config_flow.py similarity index 100% rename from custom_components/wiser_tmp/config_flow.py rename to custom_components/wiser/config_flow.py diff --git a/custom_components/wiser_tmp/const.py b/custom_components/wiser/const.py similarity index 100% rename from custom_components/wiser_tmp/const.py rename to custom_components/wiser/const.py diff --git a/custom_components/wiser_tmp/coordinator.py b/custom_components/wiser/coordinator.py similarity index 100% rename from custom_components/wiser_tmp/coordinator.py rename to custom_components/wiser/coordinator.py diff --git a/custom_components/wiser_tmp/cover.py b/custom_components/wiser/cover.py similarity index 100% rename from custom_components/wiser_tmp/cover.py rename to custom_components/wiser/cover.py diff --git a/custom_components/wiser_tmp/device_trigger.py b/custom_components/wiser/device_trigger.py similarity index 100% rename from custom_components/wiser_tmp/device_trigger.py rename to custom_components/wiser/device_trigger.py diff --git a/custom_components/wiser_tmp/diagnostics.py b/custom_components/wiser/diagnostics.py similarity index 100% rename from custom_components/wiser_tmp/diagnostics.py rename to custom_components/wiser/diagnostics.py diff --git a/custom_components/wiser_tmp/events.py b/custom_components/wiser/events.py similarity index 100% rename from custom_components/wiser_tmp/events.py rename to custom_components/wiser/events.py diff --git a/custom_components/wiser_tmp/frontend/__init__.py b/custom_components/wiser/frontend/__init__.py similarity index 100% rename from custom_components/wiser_tmp/frontend/__init__.py rename to custom_components/wiser/frontend/__init__.py diff --git a/custom_components/wiser_tmp/frontend/wiser-schedule-card.js b/custom_components/wiser/frontend/wiser-schedule-card.js similarity index 100% rename from custom_components/wiser_tmp/frontend/wiser-schedule-card.js rename to custom_components/wiser/frontend/wiser-schedule-card.js diff --git a/custom_components/wiser_tmp/frontend/wiser-zigbee-card.js b/custom_components/wiser/frontend/wiser-zigbee-card.js similarity index 100% rename from custom_components/wiser_tmp/frontend/wiser-zigbee-card.js rename to custom_components/wiser/frontend/wiser-zigbee-card.js diff --git a/custom_components/wiser_tmp/helpers.py b/custom_components/wiser/helpers.py similarity index 100% rename from custom_components/wiser_tmp/helpers.py rename to custom_components/wiser/helpers.py diff --git a/custom_components/wiser_tmp/light.py b/custom_components/wiser/light.py similarity index 100% rename from custom_components/wiser_tmp/light.py rename to custom_components/wiser/light.py diff --git a/custom_components/wiser_tmp/manifest.json b/custom_components/wiser/manifest.json similarity index 95% rename from custom_components/wiser_tmp/manifest.json rename to custom_components/wiser/manifest.json index 886b552..3cfc306 100755 --- a/custom_components/wiser_tmp/manifest.json +++ b/custom_components/wiser/manifest.json @@ -1,5 +1,5 @@ { - "domain": "wiser", + "domain": "wiser_testing", "name": "Drayton Wiser Integration for Home Assistant", "codeowners": [ "@asantaga", @@ -25,4 +25,4 @@ "name": "wiser*" } ] -} \ No newline at end of file +} diff --git a/custom_components/wiser_tmp/number.py b/custom_components/wiser/number.py similarity index 100% rename from custom_components/wiser_tmp/number.py rename to custom_components/wiser/number.py diff --git a/custom_components/wiser_tmp/schedules.py b/custom_components/wiser/schedules.py similarity index 100% rename from custom_components/wiser_tmp/schedules.py rename to custom_components/wiser/schedules.py diff --git a/custom_components/wiser_tmp/select.py b/custom_components/wiser/select.py similarity index 100% rename from custom_components/wiser_tmp/select.py rename to custom_components/wiser/select.py diff --git a/custom_components/wiser_tmp/sensor.py b/custom_components/wiser/sensor.py similarity index 100% rename from custom_components/wiser_tmp/sensor.py rename to custom_components/wiser/sensor.py diff --git a/custom_components/wiser_tmp/services.py b/custom_components/wiser/services.py similarity index 100% rename from custom_components/wiser_tmp/services.py rename to custom_components/wiser/services.py diff --git a/custom_components/wiser_tmp/services.yaml b/custom_components/wiser/services.yaml similarity index 100% rename from custom_components/wiser_tmp/services.yaml rename to custom_components/wiser/services.yaml diff --git a/custom_components/wiser_tmp/strings.json b/custom_components/wiser/strings.json similarity index 100% rename from custom_components/wiser_tmp/strings.json rename to custom_components/wiser/strings.json diff --git a/custom_components/wiser_tmp/switch.py b/custom_components/wiser/switch.py similarity index 100% rename from custom_components/wiser_tmp/switch.py rename to custom_components/wiser/switch.py diff --git a/custom_components/wiser_tmp/translations/de.json b/custom_components/wiser/translations/de.json similarity index 100% rename from custom_components/wiser_tmp/translations/de.json rename to custom_components/wiser/translations/de.json diff --git a/custom_components/wiser_tmp/translations/en.json b/custom_components/wiser/translations/en.json similarity index 100% rename from custom_components/wiser_tmp/translations/en.json rename to custom_components/wiser/translations/en.json diff --git a/custom_components/wiser_tmp/translations/fr.json b/custom_components/wiser/translations/fr.json similarity index 100% rename from custom_components/wiser_tmp/translations/fr.json rename to custom_components/wiser/translations/fr.json diff --git a/custom_components/wiser_tmp/websockets.py b/custom_components/wiser/websockets.py similarity index 100% rename from custom_components/wiser_tmp/websockets.py rename to custom_components/wiser/websockets.py From ce22c1e5e53b317ec12f1afc351b90667664bad4 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:19:51 +0000 Subject: [PATCH 04/12] Updated test domain in const.py --- custom_components/wiser/const.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/wiser/const.py b/custom_components/wiser/const.py index 9722143..1b67ceb 100755 --- a/custom_components/wiser/const.py +++ b/custom_components/wiser/const.py @@ -6,9 +6,9 @@ """ VERSION = "3.4.1" -DOMAIN = "wiser" +DOMAIN = "wiser_test" DATA_WISER_CONFIG = "wiser_config" -URL_BASE = "/wiser" +URL_BASE = "/wiser_test" WISER_CARDS = [ { From 6a6e6d7126bab9126f69ddd172de7151037edc0e Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:23:40 +0000 Subject: [PATCH 05/12] Updated test domain in const.py --- custom_components/wiser/const.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/wiser/const.py b/custom_components/wiser/const.py index 1b67ceb..94e9767 100755 --- a/custom_components/wiser/const.py +++ b/custom_components/wiser/const.py @@ -6,9 +6,9 @@ """ VERSION = "3.4.1" -DOMAIN = "wiser_test" +DOMAIN = "wiser_testing" DATA_WISER_CONFIG = "wiser_config" -URL_BASE = "/wiser_test" +URL_BASE = "/wiser_testing" WISER_CARDS = [ { From 0976343db0ffcb5342f6edec7c7550253dff4c29 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:30:16 +0000 Subject: [PATCH 06/12] Added config strings. --- custom_components/wiser/strings.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/wiser/strings.json b/custom_components/wiser/strings.json index eb46300..ee05ede 100755 --- a/custom_components/wiser/strings.json +++ b/custom_components/wiser/strings.json @@ -7,6 +7,7 @@ "description": "Please enter the ip address and secret key obtained from the hub.", "data": { "host": "IP Address or Hostname", + "port": "Port number" "password": "Secret Key" } }, @@ -15,6 +16,7 @@ "description": "Please enter the secret key obtained from the hub.", "data": { "host": "IP Address or Hostname", + "port": "Port number" "password": "Secret Key" } } From 306e8b871328dede5350e82828b3457891dfca2a Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:36:27 +0000 Subject: [PATCH 07/12] Updated data schema --- custom_components/wiser/config_flow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser/config_flow.py index e7ce4a7..afc16f8 100755 --- a/custom_components/wiser/config_flow.py +++ b/custom_components/wiser/config_flow.py @@ -46,7 +46,7 @@ _LOGGER = logging.getLogger(__name__) DATA_SCHEMA = vol.Schema( - {vol.Required(CONF_HOST): str, vol.Required(CONF_PASSWORD): str} + {vol.Required(CONF_HOST): str, vol.Optional(CONF_PORT): int, vol.Required(CONF_PASSWORD): str} ) @@ -202,6 +202,9 @@ async def async_step_zeroconf_confirm( vol.Required( CONF_HOST, default=self.discovery_info[CONF_HOST] ): str, + vol.Optional( + CONF_PORT, default=self.discovery_info[CONF_PORT] + ): int, vol.Required(CONF_PASSWORD): str, } ), From 3a80cf090e50ca3f1c2661147739007fa12aa9c7 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 11:43:24 +0000 Subject: [PATCH 08/12] Reverted debug changes. --- custom_components/wiser/const.py | 4 ++-- custom_components/wiser/manifest.json | 2 +- hacs.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/wiser/const.py b/custom_components/wiser/const.py index 94e9767..9722143 100755 --- a/custom_components/wiser/const.py +++ b/custom_components/wiser/const.py @@ -6,9 +6,9 @@ """ VERSION = "3.4.1" -DOMAIN = "wiser_testing" +DOMAIN = "wiser" DATA_WISER_CONFIG = "wiser_config" -URL_BASE = "/wiser_testing" +URL_BASE = "/wiser" WISER_CARDS = [ { diff --git a/custom_components/wiser/manifest.json b/custom_components/wiser/manifest.json index 3cfc306..7a4e66c 100755 --- a/custom_components/wiser/manifest.json +++ b/custom_components/wiser/manifest.json @@ -1,5 +1,5 @@ { - "domain": "wiser_testing", + "domain": "wiser", "name": "Drayton Wiser Integration for Home Assistant", "codeowners": [ "@asantaga", diff --git a/hacs.json b/hacs.json index 3df9a6d..38e45f7 100644 --- a/hacs.json +++ b/hacs.json @@ -2,6 +2,6 @@ "name": "Drayton Wiser Integration for Home Assistant", "homeassistant": "2023.12", "render_readme": true, - "zip_release": false, - // "filename": "wiser.zip" + "zip_release": true, + "filename": "wiser.zip" } From 4af362533af3791e908edef3b503054a9fca4e16 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 13:24:16 +0000 Subject: [PATCH 09/12] Bugfix in strings.json --- custom_components/wiser/strings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/wiser/strings.json b/custom_components/wiser/strings.json index ee05ede..cb87204 100755 --- a/custom_components/wiser/strings.json +++ b/custom_components/wiser/strings.json @@ -7,7 +7,7 @@ "description": "Please enter the ip address and secret key obtained from the hub.", "data": { "host": "IP Address or Hostname", - "port": "Port number" + "port": "Port number", "password": "Secret Key" } }, @@ -16,7 +16,7 @@ "description": "Please enter the secret key obtained from the hub.", "data": { "host": "IP Address or Hostname", - "port": "Port number" + "port": "Port number", "password": "Secret Key" } } From 03d27764ab19d25ea374a83e95b17cee6d8deb30 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 13:38:28 +0000 Subject: [PATCH 10/12] Updated en.json --- custom_components/wiser/translations/en.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/wiser/translations/en.json b/custom_components/wiser/translations/en.json index c9b1510..1866ad1 100755 --- a/custom_components/wiser/translations/en.json +++ b/custom_components/wiser/translations/en.json @@ -7,6 +7,7 @@ "description": "Please enter the ip address and secret key obtained from the hub.", "data": { "host": "IP Address or Hostname", + "port": "Port number", "password": "Secret Key" } }, @@ -15,6 +16,7 @@ "description": "Please enter the secret key obtained from the hub - {name}. \n Hostname: {hostname} \n IP Address: {ip_address}", "data": { "host": "IP Address or Hostname", + "port": "Port number", "password": "Secret Key" } } @@ -45,6 +47,7 @@ "description": "Main Parameters", "data": { "host": "IP Address or Hostname", + "port": "Port number", "scan_interval": "Scan Interval (secs)", "heating_boost_temp": "Default Heating Boost Temperature (°C)", "heating_boost_time": "Default Heating Boost Duration (mins)", From af384399534f31bdb85ddd384ece9a82bfc44545 Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 13:44:35 +0000 Subject: [PATCH 11/12] Add default port --- custom_components/wiser/config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser/config_flow.py index afc16f8..db8fb98 100755 --- a/custom_components/wiser/config_flow.py +++ b/custom_components/wiser/config_flow.py @@ -46,7 +46,7 @@ _LOGGER = logging.getLogger(__name__) DATA_SCHEMA = vol.Schema( - {vol.Required(CONF_HOST): str, vol.Optional(CONF_PORT): int, vol.Required(CONF_PASSWORD): str} + {vol.Required(CONF_HOST): str, vol.Optional(CONF_PORT, default=80): int, vol.Required(CONF_PASSWORD): str} ) From a7193d13bc1502c697ccecd40abb5c7e4cc3f70d Mon Sep 17 00:00:00 2001 From: Simon Gaulter Date: Tue, 23 Jan 2024 13:52:39 +0000 Subject: [PATCH 12/12] Options flow. --- custom_components/wiser/config_flow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser/config_flow.py index db8fb98..d8abb0b 100755 --- a/custom_components/wiser/config_flow.py +++ b/custom_components/wiser/config_flow.py @@ -262,6 +262,7 @@ async def async_step_main_params(self, user_input=None): CONF_NAME: self.config_entry.data[CONF_NAME], } user_input.pop(CONF_HOST) + user_input.pop(CONF_PORT) self.hass.config_entries.async_update_entry( self.config_entry, data=data ) @@ -270,6 +271,7 @@ async def async_step_main_params(self, user_input=None): data_schema = { vol.Required(CONF_HOST, default=self.config_entry.data[CONF_HOST]): str, + vol.Optional(CONF_PORT, default=self.config_entry.data[CONF_PORT]): str, vol.Optional( CONF_SCAN_INTERVAL, default=self.config_entry.options.get(