From 0107751a3c4f820cec85045a8d78fc5678d43c86 Mon Sep 17 00:00:00 2001 From: Tim Norman Date: Tue, 27 Feb 2024 16:22:24 -0700 Subject: [PATCH 1/6] Rename humidityOperation to humOperation in documentation to match attribute name. --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index ce0f5f9..6c19bc1 100644 --- a/README.MD +++ b/README.MD @@ -211,7 +211,7 @@ In addition the following extra attributes are provided, to allow for a more det | demand | % of maximum CFM of air demand for the zone. Value is 0-100 | | fan | Indicates if the fan is currently running. Note: this is true only when the fan is running and there is no active HVAC action (cooling, heating, etc.) | | heatCoast | This will only appear in non-zoning systems and it indicates the system is set to a single setpoint mode, the system was in heating mode and has turned off to coast to the desired temperature | -| humidityOperation | Current active humidity operation - **Waiting**,**Humidifying**, **Drying** or **Off** | +| humOperation | Current active humidity operation - **Waiting**,**Humidifying**, **Drying** or **Off** | | ssr | When enabled, smooth set back begins recovery up to two hours before the programmed time so that the programmed temperature is reached at the corresponding programmed event time. Assume 12°F (6.72°C) per hour for first-stage gas/electric heating and 6°F (3.36°C) per hour for first-stage compressor based heating or cooling.With Smooth Set Back disabled, the system will start a recovery at the programmed time. Options are enabled or disabled. Default is enabled. See manual for more details | | tempOperation | Current active temperature operation heating or cooling | | ventilation | Indicates if external ventilation is currently active on this zone | From 94d78505eecf1619844b7ad566745485c5d9b107 Mon Sep 17 00:00:00 2001 From: PeteRager <76050312+PeteRager@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:43:48 -0500 Subject: [PATCH 2/6] Bump the API version to pull in emergency heat fix --- .vscode/settings.json | 9 +-------- custom_components/lennoxs30/manifest.json | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4d9ab92..541629d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,12 +23,5 @@ "setpoints", "sysuptime" ], - "python.formatting.provider": "black", - "python.formatting.blackArgs": ["--line-length", "120"], - "cSpell.enabled": false, - "python.linting.flake8Enabled": false, - "python.linting.enabled": true, - "python.linting.flake8Args": ["--config=setup.cfg", "--doctests"], - "python.linting.pylintEnabled": true, - + "cSpell.enabled": false, } diff --git a/custom_components/lennoxs30/manifest.json b/custom_components/lennoxs30/manifest.json index b4d0677..c123db8 100644 --- a/custom_components/lennoxs30/manifest.json +++ b/custom_components/lennoxs30/manifest.json @@ -8,6 +8,6 @@ "iot_class": "local_push", "issue_tracker" : "https://github.com/PeteRager/lennoxs30/issues", "quality_scale": "platinum", - "requirements": ["lennoxs30api==0.2.13"], + "requirements": ["lennoxs30api==0.2.14"], "version": "2024.2.1" } \ No newline at end of file From ce6800d841f8e7344ea86c3a790905b73191a8f5 Mon Sep 17 00:00:00 2001 From: PeteRager <76050312+PeteRager@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:15:43 -0500 Subject: [PATCH 3/6] state names are only a-z 0-9 --- custom_components/lennoxs30/__init__.py | 5 +++-- tests/test_async_setup_entry.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/custom_components/lennoxs30/__init__.py b/custom_components/lennoxs30/__init__.py index 86abc75..684c1c7 100644 --- a/custom_components/lennoxs30/__init__.py +++ b/custom_components/lennoxs30/__init__.py @@ -8,6 +8,7 @@ import asyncio from asyncio.locks import Event import logging +import re import time import voluptuous as vol @@ -471,10 +472,10 @@ def __init__( else: if ip_address is None: e_name = email.split("@") - redacted_email: str = e_name[0].replace(".", "_").replace("__","_") + redacted_email: str = re.sub("[^A-Za-z0-9]","",e_name[0]) self.connection_state = "lennoxs30.conn_" + redacted_email else: - self.connection_state = "lennoxs30.conn_" + self._ip_address.replace(".", "_").replace(":", "_") + self.connection_state = "lennoxs30.conn_" + re.sub("[^A-Za-z0-9]","",self._ip_address) async def async_shutdown(self, event: Event) -> None: """Called when hass shutsdown""" diff --git a/tests/test_async_setup_entry.py b/tests/test_async_setup_entry.py index da04e62..d245a6e 100644 --- a/tests/test_async_setup_entry.py +++ b/tests/test_async_setup_entry.py @@ -316,11 +316,11 @@ async def test_async_setup_entry_multiple(hass, caplog): assert manager.create_equipment_parameters is False assert manager._conf_init_wait_time == 30 assert manager.is_metric is True - assert manager.connection_state == "lennoxs30.conn_192_168_1_94" + assert manager.connection_state == "lennoxs30.conn_192168194" data = { "cloud_connection": True, - "email": "pete._rage@rage.com", + "email": "_pete._rage@rage.com", "password": "rage", "app_id": "homeassistant", "create_sensors": True, @@ -354,7 +354,7 @@ async def test_async_setup_entry_multiple(hass, caplog): assert manager._poll_interval == 1 assert manager._fast_poll_interval == 0.75 assert manager._fast_poll_count == 5 - assert manager.api._username == "pete._rage@rage.com" + assert manager.api._username == "_pete._rage@rage.com" assert manager.api._password == "rage" assert manager._pii_message_log is False assert manager._message_debug_logging is True @@ -367,7 +367,7 @@ async def test_async_setup_entry_multiple(hass, caplog): assert manager.create_equipment_parameters is False assert manager._conf_init_wait_time == 30 assert manager.is_metric is True - assert manager.connection_state == "lennoxs30.conn_pete_rage" + assert manager.connection_state == "lennoxs30.conn_peterage" @pytest.mark.asyncio From d7c0b8f0f9c0f14f617672fb473928c0ce6c70c8 Mon Sep 17 00:00:00 2001 From: PeteRager <76050312+PeteRager@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:23:23 -0500 Subject: [PATCH 4/6] Rework the connection state entity id --- custom_components/lennoxs30/__init__.py | 6 ++++-- tests/test_async_setup_entry.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/custom_components/lennoxs30/__init__.py b/custom_components/lennoxs30/__init__.py index 684c1c7..ee47406 100644 --- a/custom_components/lennoxs30/__init__.py +++ b/custom_components/lennoxs30/__init__.py @@ -9,6 +9,7 @@ from asyncio.locks import Event import logging import re +import re import time import voluptuous as vol @@ -472,10 +473,11 @@ def __init__( else: if ip_address is None: e_name = email.split("@") - redacted_email: str = re.sub("[^A-Za-z0-9]","",e_name[0]) + redacted_email: str = re.sub("[^A-Za-z0-9]","_",e_name[0]) self.connection_state = "lennoxs30.conn_" + redacted_email else: - self.connection_state = "lennoxs30.conn_" + re.sub("[^A-Za-z0-9]","",self._ip_address) + self.connection_state = "lennoxs30.conn_" + re.sub("[^A-Za-z0-9]","_",self._ip_address) + self.connection_state = re.sub("_+","_", self.connection_state) async def async_shutdown(self, event: Event) -> None: """Called when hass shutsdown""" diff --git a/tests/test_async_setup_entry.py b/tests/test_async_setup_entry.py index d245a6e..de8556c 100644 --- a/tests/test_async_setup_entry.py +++ b/tests/test_async_setup_entry.py @@ -316,7 +316,7 @@ async def test_async_setup_entry_multiple(hass, caplog): assert manager.create_equipment_parameters is False assert manager._conf_init_wait_time == 30 assert manager.is_metric is True - assert manager.connection_state == "lennoxs30.conn_192168194" + assert manager.connection_state == "lennoxs30.conn_192_168_1_94" data = { "cloud_connection": True, @@ -367,7 +367,7 @@ async def test_async_setup_entry_multiple(hass, caplog): assert manager.create_equipment_parameters is False assert manager._conf_init_wait_time == 30 assert manager.is_metric is True - assert manager.connection_state == "lennoxs30.conn_peterage" + assert manager.connection_state == "lennoxs30.conn_pete_rage" @pytest.mark.asyncio From f531f599f62cb24cc84672339d8233abcf8d6e70 Mon Sep 17 00:00:00 2001 From: PeteRager <76050312+PeteRager@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:25:19 -0500 Subject: [PATCH 5/6] clean up imports --- custom_components/lennoxs30/__init__.py | 1 - tests/test_async_setup_entry.py | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/custom_components/lennoxs30/__init__.py b/custom_components/lennoxs30/__init__.py index ee47406..bd39ba2 100644 --- a/custom_components/lennoxs30/__init__.py +++ b/custom_components/lennoxs30/__init__.py @@ -9,7 +9,6 @@ from asyncio.locks import Event import logging import re -import re import time import voluptuous as vol diff --git a/tests/test_async_setup_entry.py b/tests/test_async_setup_entry.py index de8556c..aab2bb6 100644 --- a/tests/test_async_setup_entry.py +++ b/tests/test_async_setup_entry.py @@ -17,10 +17,7 @@ import pytest from homeassistant.exceptions import HomeAssistantError -from homeassistant.const import ( - CONF_TIMEOUT, - EVENT_HOMEASSISTANT_STOP, -) +from homeassistant.const import CONF_TIMEOUT from homeassistant import config_entries from homeassistant.core import HomeAssistant From 6a317bc563d3b50e8842b73bd6175316d8161b33 Mon Sep 17 00:00:00 2001 From: PeteRager <76050312+PeteRager@users.noreply.github.com> Date: Wed, 6 Mar 2024 20:05:17 -0500 Subject: [PATCH 6/6] bump version --- custom_components/lennoxs30/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/lennoxs30/manifest.json b/custom_components/lennoxs30/manifest.json index c123db8..15cd144 100644 --- a/custom_components/lennoxs30/manifest.json +++ b/custom_components/lennoxs30/manifest.json @@ -9,5 +9,5 @@ "issue_tracker" : "https://github.com/PeteRager/lennoxs30/issues", "quality_scale": "platinum", "requirements": ["lennoxs30api==0.2.14"], - "version": "2024.2.1" + "version": "2024.3.0" } \ No newline at end of file