From 79893cc00fc6b58d42c411164947b8876bc628c3 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 16 Oct 2024 20:19:43 +0900 Subject: py: Add bindings for ControlId vendor information Add python bindings for quering vendor information from a ControlId. While at it, update __repr__ so that it also prints the vendor. Example usage: >>> cid libcamera.ControlId(20, libcamera.Saturation, ControlType.Float) >>> cid.vendor 'libcamera' Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/py/libcamera/py_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/py') diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index 983b76f6..09b6f9db 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -399,11 +399,12 @@ PYBIND11_MODULE(_libcamera, m) pyControlId .def_property_readonly("id", &ControlId::id) .def_property_readonly("name", &ControlId::name) + .def_property_readonly("vendor", &ControlId::vendor) .def_property_readonly("type", &ControlId::type) .def("__str__", [](const ControlId &self) { return self.name(); }) .def("__repr__", [](const ControlId &self) { - return py::str("libcamera.ControlId({}, {}, {})") - .format(self.id(), self.name(), self.type()); + return py::str("libcamera.ControlId({}, {}.{}, {})") + .format(self.id(), self.vendor(), self.name(), self.type()); }) .def("enumerators", &ControlId::enumerators); -- cgit v1.2.1