Fix QNAP fail to load (#144675)

* Update coordinator.py

* Update coordinator.py

@peternash

* Update coordinator.py

* Update coordinator.py

* Update coordinator.py

* Update coordinator.py
This commit is contained in:
disforw 2025-05-19 15:47:01 -04:00 committed by GitHub
parent 7464e3944e
commit 761bb65ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ from contextlib import contextmanager, nullcontext
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Any from typing import Any
import warnings
from qnapstats import QNAPStats from qnapstats import QNAPStats
import urllib3 import urllib3
@ -37,7 +38,8 @@ def suppress_insecure_request_warning():
Was added in here to solve the following issue, not being solved upstream. Was added in here to solve the following issue, not being solved upstream.
https://github.com/colinodell/python-qnapstats/issues/96 https://github.com/colinodell/python-qnapstats/issues/96
""" """
with urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning): with warnings.catch_warnings():
warnings.simplefilter("ignore", urllib3.exceptions.InsecureRequestWarning)
yield yield