@@ -105,7 +105,7 @@ PYBIND11_MODULE(_libcamera, m)
return cm;
})
- .def_property_readonly("version", &PyCameraManager::version)
+ .def_property_readonly_static("version", [](py::object /* self */) { return PyCameraManager::version(); })
.def("get", &PyCameraManager::get, py::keep_alive<0, 1>())
.def_property_readonly("cameras", &PyCameraManager::cameras)
@@ -68,6 +68,10 @@ class SimpleTestMethods(BaseTestCase):
# I expected EBUSY, but looks like double release works fine
self.assertZero(ret)
+ def test_version(self):
+ cm = libcam.CameraManager.singleton()
+ self.assertIsInstance(cm.version, str)
+
class CameraTesterBase(BaseTestCase):
cm: typing.Any