Update config to_dict to exclude credentials if the hash is empty string (#626)

* Update config to_dict to exclude credentials if the hash is empty string

* Add test
This commit is contained in:
Steven B
2024-01-10 19:47:30 +00:00
committed by GitHub
parent d5a6fd8e73
commit fd2170c82c
2 changed files with 16 additions and 2 deletions

View File

@@ -165,7 +165,7 @@ class DeviceConfig:
exclude_credentials: bool = False,
) -> Dict[str, Dict[str, str]]:
"""Convert device config to dict."""
if credentials_hash or exclude_credentials:
if credentials_hash is not None or exclude_credentials:
self.credentials = None
if credentials_hash:
self.credentials_hash = credentials_hash