From 58957aea2d261bcf0debaf5230bbca9df71952ee Mon Sep 17 00:00:00 2001 From: "firstof9@gmail.com" Date: Wed, 20 May 2026 17:00:41 -0700 Subject: [PATCH] Adjust firmware version check logging levels to debug --- openevsehttp/client.py | 8 ++++---- openevsehttp/commands.py | 4 ++-- tests/test_client.py | 2 +- tests/test_commands.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openevsehttp/client.py b/openevsehttp/client.py index 5daf0dc..f93ab29 100644 --- a/openevsehttp/client.py +++ b/openevsehttp/client.py @@ -438,7 +438,7 @@ def _version_check(self, min_version: str, max_version: str = "") -> bool: """Return bool if minimum version is met.""" if "version" not in self._config: # Throw warning if we can't find the version - _LOGGER.warning("Unable to find firmware version.") + _LOGGER.debug("Unable to find firmware version.") return False cutoff = AwesomeVersion(min_version) limit = "" @@ -447,10 +447,10 @@ def _version_check(self, min_version: str, max_version: str = "") -> bool: current = get_awesome_version(self._config["version"]) if current.strategy == "unknown": - _LOGGER.warning( - "Non-standard versioning string: %s", self._config["version"] + _LOGGER.debug( + "Non-semver firmware version detected: %s", + self._config["version"], ) - _LOGGER.debug("Non-semver firmware version detected.") return False if limit: diff --git a/openevsehttp/commands.py b/openevsehttp/commands.py index b3283c9..7a97597 100644 --- a/openevsehttp/commands.py +++ b/openevsehttp/commands.py @@ -358,7 +358,7 @@ async def firmware_check(self) -> dict | None: """Return the latest firmware version.""" if "version" not in self._config: # Throw warning if we can't find the version - _LOGGER.warning("Unable to find firmware version.") + _LOGGER.debug("Unable to find firmware version.") return None base_url = "https://api.github.com/repos/OpenEVSE/" url = None @@ -376,7 +376,7 @@ async def firmware_check(self) -> dict | None: else: url = f"{base_url}ESP8266_WiFi_v2.x/releases/latest" except AwesomeVersionCompareException: - _LOGGER.warning("Non-semver firmware version detected.") + _LOGGER.debug("Non-semver firmware version detected.") return None try: diff --git a/tests/test_client.py b/tests/test_client.py index 1953b82..8e3ccd0 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -365,7 +365,7 @@ async def test_firmware_check( with caplog.at_level(logging.DEBUG): firmware = await test_charger_unknown_semver.firmware_check() assert "Using version: random_a4f11e" in caplog.text - assert "Non-semver firmware version detected." in caplog.text + assert "Non-semver firmware version detected" in caplog.text assert firmware is None diff --git a/tests/test_commands.py b/tests/test_commands.py index a527f59..251aa1c 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -452,7 +452,7 @@ async def test_set_divertmode( with pytest.raises(UnsupportedFeature): with caplog.at_level(logging.DEBUG): await test_charger_unknown_semver.divert_mode() - assert "Non-semver firmware version detected." in caplog.text + assert "Non-semver firmware version detected" in caplog.text async def test_set_divertmode_dict(test_charger_new, mock_aioclient):