Skip to content

Commit

Permalink
Update utilities.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MapoDan authored Jan 29, 2021
1 parent f9731f6 commit 9b57182
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions custom_components/file_restore/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ def create_file_and_directory(file_path, name) -> bool:
file_data.write(data)
_LOGGER.info("File and/or directory was missing. Proceeded with creation.")
return True

def null_data_cleaner(original_data: dict, data: dict) -> dict:
""" this is to remove all null parameters from data that are added during option flow """
for key in data.keys():
if data[key] == "null":
original_data[key] = ""
else:
original_data[key]=data[key]
return original_data

0 comments on commit 9b57182

Please sign in to comment.