Skip to content

Commit

Permalink
fix: convert int device_id to str (#172)
Browse files Browse the repository at this point in the history
* fix: convert int device_id to str

* Update custom_components/midea_ac_lan/config_flow.py

Co-authored-by: Simone Chemelli <[email protected]>

---------

Co-authored-by: Simone Chemelli <[email protected]>
  • Loading branch information
wuwentao and chemelli74 authored Jun 26, 2024
1 parent 79a1c06 commit b2b04d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/midea_ac_lan/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2b04d3

Please sign in to comment.