From f5aea55b2971307ee91cfe75894e87bfc553d45e Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 22 Nov 2025 21:30:12 +1100 Subject: [PATCH] BE: linting fixes 5 Signed-off-by: jokob-sk --- front/plugins/_publisher_ntfy/ntfy.py | 3 ++- front/plugins/freebox/freebox.py | 4 ++-- pyproject.toml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/front/plugins/_publisher_ntfy/ntfy.py b/front/plugins/_publisher_ntfy/ntfy.py index 16a75d8c..900fac1c 100755 --- a/front/plugins/_publisher_ntfy/ntfy.py +++ b/front/plugins/_publisher_ntfy/ntfy.py @@ -119,7 +119,8 @@ def send(html, text): get_setting_value('NTFY_TOPIC')), data = text, headers = headers, - verify = verify_ssl + verify = verify_ssl, + timeout = get_setting_value('NTFY_RUN_TIMEOUT') ) response_status_code = response.status_code diff --git a/front/plugins/freebox/freebox.py b/front/plugins/freebox/freebox.py index 00539ae0..c5b1cee2 100755 --- a/front/plugins/freebox/freebox.py +++ b/front/plugins/freebox/freebox.py @@ -22,7 +22,7 @@ from logger import mylog, Logger # noqa: E402 [flake8 lint suppression] from const import logPath # noqa: E402 [flake8 lint suppression] from helper import get_setting_value # noqa: E402 [flake8 lint suppression] import conf # noqa: E402 [flake8 lint suppression] -from utils.datetime_utils import timeNowDB # noqa: E402 [flake8 lint suppression] +from utils.datetime_utils import timeNowDB, DATETIME_PATTERN # noqa: E402 [flake8 lint suppression] # Make sure the TIMEZONE for logging is correct conf.tz = timezone(get_setting_value("TIMEZONE")) @@ -167,7 +167,7 @@ def main(): watched1=host.get("primary_name", "(unknown)"), watched2=host.get("vendor_name", "(unknown)"), watched3=map_device_type(host.get("host_type", "")), - watched4=datetime.fromtimestamp(ip.get("last_time_reachable", 0)), + watched4=datetime.fromtimestamp(ip.get("last_time_reachable", 0)).strftime(DATETIME_PATTERN), extra="", foreignKey=mac, ) diff --git a/pyproject.toml b/pyproject.toml index 846b5a7d..047eade6 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ markers = [ ] [tool.ruff] line-length = 180 +ignore = ["E203", "C901"] # global ignores [tool.ruff.lint] select = ["E", "F"] -extend-select = ["E402"] -ignore = ["E203", "C901"] \ No newline at end of file +extend-select = ["E402"] \ No newline at end of file