From e4afeb5ffeba745dbe531e861138887b443ef52e Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 14 Feb 2023 08:55:16 +0100 Subject: [PATCH] simplify auth check --- custom_components/qss/io.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/custom_components/qss/io.py b/custom_components/qss/io.py index 766832b..293ec35 100644 --- a/custom_components/qss/io.py +++ b/custom_components/qss/io.py @@ -52,12 +52,8 @@ def _insert_row_without_auth(host: str, port: int, event: Event) -> None: sender.flush() -def _check_all_auth_values_exist(auth: tuple) -> bool: - return auth.count(None) <= 0 - - def _insert_row(host: str, port: int, auth: tuple, event: Event) -> None: - if _check_all_auth_values_exist(auth) is True: + if all(auth): _insert_row_with_auth(host, port, auth, event) else: _insert_row_without_auth(host, port, event)