From b2b04d3ff39a00e4bada9d081b509c604c3e3af9 Mon Sep 17 00:00:00 2001 From: Hello World Date: Wed, 26 Jun 2024 15:21:02 +0800 Subject: [PATCH] fix: convert int device_id to str (#172) * fix: convert int device_id to str * Update custom_components/midea_ac_lan/config_flow.py Co-authored-by: Simone Chemelli --------- Co-authored-by: Simone Chemelli --- custom_components/midea_ac_lan/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/midea_ac_lan/config_flow.py b/custom_components/midea_ac_lan/config_flow.py index 0c21dfa7..3004e518 100644 --- a/custom_components/midea_ac_lan/config_flow.py +++ b/custom_components/midea_ac_lan/config_flow.py @@ -124,8 +124,8 @@ def __init__(self) -> None: def _save_device_config(self, data: dict[str, Any]) -> None: """Save device config to json file with device id.""" storage_path = Path(self.hass.config.path(STORAGE_PATH)) - Path.mkdir(storage_path, parents=True, exist_ok=True) - record_file = Path(storage_path, data[CONF_DEVICE_ID], ".json") + storage_path.mkdir(parents=True, exist_ok=True) + record_file = storage_path.joinpath(f"{data[CONF_DEVICE_ID]!s}.json") save_json(record_file.name, data) def _load_device_config(self, device_id: str) -> Any: # noqa: ANN401