Add core device, child and camera modules to smartcamera (#1193)

Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
Steven B.
2024-10-24 17:22:45 +01:00
committed by GitHub
parent 8ee8c17bdc
commit 28361c1727
11 changed files with 427 additions and 47 deletions

View File

@@ -0,0 +1,23 @@
"""Module for child devices."""
from ...device_type import DeviceType
from ..smartcameramodule import SmartCameraModule
class ChildDevice(SmartCameraModule):
"""Implementation for child devices."""
NAME = "childdevice"
QUERY_GETTER_NAME = "getChildDeviceList"
QUERY_MODULE_NAME = "childControl"
def query(self) -> dict:
"""Query to execute during the update cycle.
Default implementation uses the raw query getter w/o parameters.
"""
return {self.QUERY_GETTER_NAME: {self.QUERY_MODULE_NAME: {"start_index": 0}}}
async def _check_supported(self) -> bool:
"""Additional check to see if the module is supported by the device."""
return self._device.device_type is DeviceType.Hub