Fix command parameter issue hon#63

This commit is contained in:
Andre Basche 2023-06-09 02:09:20 +02:00
parent 7b51caecca
commit 11988c73a6
7 changed files with 18 additions and 6 deletions

View file

@ -2,6 +2,7 @@ import logging
from typing import Optional, Dict, Any, List, TYPE_CHECKING, Union
from pyhon import exceptions
from pyhon.exceptions import ApiError
from pyhon.parameter.base import HonParameter
from pyhon.parameter.enum import HonParameterEnum
from pyhon.parameter.fixed import HonParameterFixed
@ -111,9 +112,12 @@ class HonCommand:
params = self.parameter_groups.get("parameters", {})
ancillary_params = self.parameter_groups.get("ancillaryParameters", {})
self.appliance.sync_to_params(self.name)
return await self.api.send_command(
result = await self.api.send_command(
self._appliance, self._name, params, ancillary_params
)
if not result:
raise ApiError("Can't send command")
return result
@property
def categories(self) -> Dict[str, "HonCommand"]: