mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
@@ -119,7 +119,8 @@ def send(html, text):
|
|||||||
get_setting_value('NTFY_TOPIC')),
|
get_setting_value('NTFY_TOPIC')),
|
||||||
data = text,
|
data = text,
|
||||||
headers = headers,
|
headers = headers,
|
||||||
verify = verify_ssl
|
verify = verify_ssl,
|
||||||
|
timeout = get_setting_value('NTFY_RUN_TIMEOUT')
|
||||||
)
|
)
|
||||||
|
|
||||||
response_status_code = response.status_code
|
response_status_code = response.status_code
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
|||||||
from const import logPath # 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]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # 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
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value("TIMEZONE"))
|
conf.tz = timezone(get_setting_value("TIMEZONE"))
|
||||||
@@ -167,7 +167,7 @@ def main():
|
|||||||
watched1=host.get("primary_name", "(unknown)"),
|
watched1=host.get("primary_name", "(unknown)"),
|
||||||
watched2=host.get("vendor_name", "(unknown)"),
|
watched2=host.get("vendor_name", "(unknown)"),
|
||||||
watched3=map_device_type(host.get("host_type", "")),
|
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="",
|
extra="",
|
||||||
foreignKey=mac,
|
foreignKey=mac,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ markers = [
|
|||||||
]
|
]
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 180
|
line-length = 180
|
||||||
|
ignore = ["E203", "C901"] # global ignores
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
select = ["E", "F"]
|
select = ["E", "F"]
|
||||||
extend-select = ["E402"]
|
extend-select = ["E402"]
|
||||||
ignore = ["E203", "C901"]
|
|
||||||
Reference in New Issue
Block a user