Skip to content

Commit

Permalink
Move param_cgi to interfaces/parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Kane610 committed Dec 17, 2023
1 parent 6401047 commit e87a190
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions axis/vapix/interfaces/parameters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Parameter interface."""
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

from typing import Any, cast

from ..models.parameters.brand import BrandParam, BrandT
from ..models.parameters.image import ImageParam
from ..models.parameters.param_cgi import ParamRequest, params_to_dict
from ..models.parameters.properties import PropertyParam
from ..models.parameters.stream_profile import StreamProfileParam
from ..models.stream_profile import StreamProfile
from .api_handler import ApiHandler
from ...models.parameters.brand import BrandParam, BrandT
from ...models.parameters.image import ImageParam
from ...models.parameters.param_cgi import ParamRequest, params_to_dict
from ...models.parameters.properties import PropertyParam
from ...models.parameters.stream_profile import StreamProfileParam
from ...models.stream_profile import StreamProfile
from ..api_handler import ApiHandler

PROPERTY = "Properties.API.HTTP.Version=3"

Expand Down
1 change: 0 additions & 1 deletion axis/vapix/models/parameters/io_port.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""I/O port parameters from param.cgi."""


from dataclasses import dataclass
import enum
from typing import Any, TypedDict
Expand Down
10 changes: 5 additions & 5 deletions axis/vapix/models/parameters/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,22 @@ def decode(cls, data: dict[str, Any]) -> Self:
api_metadata=data["API"]["Metadata"]["Metadata"],
api_metadata_version=data["API"]["Metadata"]["Version"],
api_ptz_presets_version=data["API"]["PTZ"]["Presets"]["Version"],
# api_ptz_presets_version=data2.get("API"]["PTZ"]["Presets"]["Version", False),
# api_ptz_presets_version=data.get("API"]["PTZ"]["Presets"]["Version", False),
embedded_development=data["EmbeddedDevelopment"]["Version"],
# embedded_development=data.get("EmbeddedDevelopment_Version", "0.0"),
firmware_builddate=data["Firmware"]["BuildDate"],
firmware_buildnumber=data["Firmware"]["BuildNumber"],
firmware_version=data["Firmware"]["Version"],
image_format=data["Image"]["Format"],
# image_format=data2.get("Image_Format", ""),
# image_format=data.get("Image_Format", ""),
image_nbrofviews=int(data["Image"]["NbrOfViews"]),
image_resolution=data["Image"]["Resolution"],
image_rotation=data["Image"]["Rotation"],
light_control=data["LightControl"]["LightControl2"],
# light_control=data2.get("LightControl_LightControl2") == "yes",
# light_control=data.get("LightControl_LightControl2") == "yes",
ptz=data["PTZ"]["PTZ"],
# ptz=data2.get("PTZ_PTZ") == "yes",
# ptz=data.get("PTZ_PTZ") == "yes",
digital_ptz=data["PTZ"]["DigitalPTZ"],
# digital_ptz=data2.get("PTZ_DigitalPTZ") == "yes",
# digital_ptz=data.get("PTZ_DigitalPTZ") == "yes",
system_serialnumber=data["System"]["SerialNumber"],
)
2 changes: 1 addition & 1 deletion axis/vapix/vapix.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .interfaces.event_instances import EventInstances
from .interfaces.light_control import LightHandler
from .interfaces.mqtt import MqttClientHandler
from .interfaces.param_cgi import Params
from .interfaces.parameters.param_cgi import Params
from .interfaces.pir_sensor_configuration import PirSensorConfigurationHandler
from .interfaces.port_cgi import Ports
from .interfaces.port_management import IoPortManagement
Expand Down
2 changes: 1 addition & 1 deletion tests/test_param_cgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest
import respx

from axis.vapix.interfaces.param_cgi import Params
from axis.vapix.interfaces.parameters.param_cgi import Params

from .conftest import HOST

Expand Down

0 comments on commit e87a190

Please sign in to comment.