From a479c2abc3a859e8978c66143119239ba5eb7082 Mon Sep 17 00:00:00 2001 From: Mikael Johansson <46709289+twinor@users.noreply.github.com> Date: Wed, 13 Aug 2025 12:16:00 +0200 Subject: [PATCH 1/3] Updated kill switch handling by explicitly treating http 404 file not found as request to back down Updated kill switch handling by explicitly treating http 404 file not found as request to back down --- pycheckwatt/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pycheckwatt/__init__.py b/pycheckwatt/__init__.py index 69dea5f..f3eb90f 100644 --- a/pycheckwatt/__init__.py +++ b/pycheckwatt/__init__.py @@ -213,6 +213,13 @@ async def _continue_kill_switch_not_enabled(self): ) return False + if response.status == 404: + #Kill was requested by removing kill-switch file + _LOGGER.debug( + "CheckWatt has requested to back down by removing kill-switch file" + ) + return False + if response.status == 401: _LOGGER.error( "Unauthorized: Check your CheckWatt authentication credentials" From 0359fb3333aec29baf4daeac9c4b1660a40f2f3d Mon Sep 17 00:00:00 2001 From: Mikael Johansson <46709289+twinor@users.noreply.github.com> Date: Mon, 18 Aug 2025 11:33:29 +0200 Subject: [PATCH 2/3] Update __init__.py --- pycheckwatt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycheckwatt/__init__.py b/pycheckwatt/__init__.py index f3eb90f..93149c9 100644 --- a/pycheckwatt/__init__.py +++ b/pycheckwatt/__init__.py @@ -215,7 +215,7 @@ async def _continue_kill_switch_not_enabled(self): if response.status == 404: #Kill was requested by removing kill-switch file - _LOGGER.debug( + _LOGGER.error( "CheckWatt has requested to back down by removing kill-switch file" ) return False From fa32aaab8e06b23bbd089331e3144a7cbf7f4087 Mon Sep 17 00:00:00 2001 From: Mikael Johansson <46709289+twinor@users.noreply.github.com> Date: Mon, 18 Aug 2025 12:04:14 +0200 Subject: [PATCH 3/3] Update __init__.py --- pycheckwatt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycheckwatt/__init__.py b/pycheckwatt/__init__.py index 93149c9..382cee2 100644 --- a/pycheckwatt/__init__.py +++ b/pycheckwatt/__init__.py @@ -214,7 +214,7 @@ async def _continue_kill_switch_not_enabled(self): return False if response.status == 404: - #Kill was requested by removing kill-switch file + # Kill was requested by removing kill-switch file _LOGGER.error( "CheckWatt has requested to back down by removing kill-switch file" )