mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-01-19 02:50:44 +00:00
Improve logging for test api
This commit is contained in:
parent
e0774677eb
commit
cfee10df5f
|
@ -278,10 +278,12 @@ class TestAPI(HonAPI):
|
|||
async def load_appliances(self) -> List[Dict[str, Any]]:
|
||||
result = []
|
||||
for appliance in self._path.glob("*/"):
|
||||
with open(
|
||||
appliance / "appliance_data.json", "r", encoding="utf-8"
|
||||
) as json_file:
|
||||
result.append(json.loads(json_file.read()))
|
||||
file = appliance / "appliance_data.json"
|
||||
with open(file, "r", encoding="utf-8") as json_file:
|
||||
try:
|
||||
result.append(json.loads(json_file.read()))
|
||||
except json.decoder.JSONDecodeError as error:
|
||||
_LOGGER.error("%s - %s", str(file), error)
|
||||
return result
|
||||
|
||||
async def load_commands(self, appliance: HonAppliance) -> Dict[str, Any]:
|
||||
|
@ -318,4 +320,5 @@ class TestAPI(HonAPI):
|
|||
parameters: Dict[str, Any],
|
||||
ancillary_parameters: Dict[str, Any],
|
||||
) -> bool:
|
||||
_LOGGER.info("%s - %s", str(parameters), str(ancillary_parameters))
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue