mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-14 15:14:28 -04:00
Fix some minor issues
This commit is contained in:
parent
4e88bc7a9f
commit
44f40c531e
6 changed files with 12 additions and 8 deletions
|
@ -250,9 +250,11 @@ class TestAPI(HonAPI):
|
|||
|
||||
def _load_json(self, appliance: HonAppliance, file: str) -> Dict[str, Any]:
|
||||
directory = f"{appliance.appliance_type}_{appliance.appliance_model_id}".lower()
|
||||
path = f"{self._path}/{directory}/{file}.json"
|
||||
with open(path, "r", encoding="utf-8") as json_file:
|
||||
return json.loads(json_file.read())
|
||||
if (path := self._path / directory / f"{file}.json").exists():
|
||||
with open(path, "r", encoding="utf-8") as json_file:
|
||||
return json.loads(json_file.read())
|
||||
_LOGGER.warning(f"Can't open {str(path)}")
|
||||
return {}
|
||||
|
||||
async def load_appliances(self) -> List[Dict[str, Any]]:
|
||||
result = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue