diff --git a/src/lib.rs b/src/lib.rs index 754e496..145d2d3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,6 +44,14 @@ impl DiagnosticLevel { } } +#[pymethods] +impl DiagnosticLevel { + #[new] + pub fn new() -> Self { + Self::UNSET + } +} + #[pyclass] pub struct DiagnosticStatus { #[pyo3(get, set)] @@ -58,6 +66,20 @@ pub struct DiagnosticStatus { values: Py, } +#[pymethods] +impl DiagnosticStatus { + #[new] + pub fn new(py: Python<'_>) -> Self { + Self { + level: DiagnosticLevel::new(), + name: PyString::new(py, "").unbind(), + message: PyString::new(py, "").unbind(), + hardware_id: PyString::new(py, "").unbind(), + values: PyDict::new(py).unbind(), + } + } +} + impl DiagnosticStatus { fn from_rust<'py>( py: Python<'py>,