From 66ef6ea9929781b582405b692640bd430eb4d5b7 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 30 Oct 2024 12:25:52 +0000 Subject: [PATCH] add new method for typing --- .../spinnaker_boot/system_variable_boot_values.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spinnman/messages/spinnaker_boot/system_variable_boot_values.py b/spinnman/messages/spinnaker_boot/system_variable_boot_values.py index aca5c767a..556cd0bf5 100644 --- a/spinnman/messages/spinnaker_boot/system_variable_boot_values.py +++ b/spinnman/messages/spinnaker_boot/system_variable_boot_values.py @@ -29,8 +29,12 @@ class _DataType(Enum): LONG = (8, " "_DataType" : + obj = object.__new__(cls) + obj._value_ = value + return obj + + def __init__(self, value: int, struct_code: str): self._struct_code = struct_code @property @@ -383,14 +387,14 @@ class SystemVariableBootValues(object): """ __slot__ = "_values", - def __init__(self): + def __init__(self) -> None: # Create a dict of variable values self._values = dict() for variable in SystemVariableDefinition: self._values[variable] = variable.default def set_value(self, system_variable_definition: SystemVariableDefinition, - value: Any): + value: Any) -> None: """ Save a value to the system_variable_definition Enum as the key