diff --git a/axis/vapix/interfaces/parameters/param_handler.py b/axis/vapix/interfaces/parameters/param_handler.py index 40efc33a..511799f0 100644 --- a/axis/vapix/interfaces/parameters/param_handler.py +++ b/axis/vapix/interfaces/parameters/param_handler.py @@ -30,7 +30,7 @@ def __init__(self, param_handler: "Params") -> None: def supported(self) -> bool: """Is parameter supported.""" - return self.vapix.params.get_param(self.parameter_group) != {} + return self.get_params() != {} @abstractmethod def get_params(self) -> dict[str, ApiItemT]: diff --git a/axis/vapix/models/light_control.py b/axis/vapix/models/light_control.py index aa030af9..32c33055 100644 --- a/axis/vapix/models/light_control.py +++ b/axis/vapix/models/light_control.py @@ -240,28 +240,6 @@ def from_list(cls, data: list[RangeT]) -> list["Range"]: return [Range.from_dict(range) for range in data] -@dataclass -class ApiVersion: - """Handle API version.""" - - _default_api_version: str = field(init=False) - api_version: str | None = None - - @property - def _api_version(self) -> str: - """API version or default API version.""" - if self.api_version is not None: - return self.api_version - return self._default_api_version - - -@dataclass -class _ApiVersion(ApiVersion): - """Light control API version.""" - - _default_api_version = API_VERSION - - @dataclass class GetLightInformationRequest(ApiRequest): """Request object for getting light information.""" diff --git a/tests/test_param_cgi.py b/tests/test_param_cgi.py index 098d0757..43102b40 100644 --- a/tests/test_param_cgi.py +++ b/tests/test_param_cgi.py @@ -8,17 +8,23 @@ import pytest import respx +from axis.device import AxisDevice from axis.vapix.interfaces.parameters.param_cgi import Params from .conftest import HOST @pytest.fixture -def params(axis_device) -> Params: +def params(axis_device: AxisDevice) -> Params: """Return the param cgi mock object.""" return axis_device.vapix.params +async def test_param_api_request(params: Params): + """Verify that you can list parameters.""" + assert await params._api_request() == {} + + @respx.mock async def test_params(params: Params): """Verify that you can list parameters."""