From 9246bbbc9cad1758b0a59bff74f50abb3c9b514a Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Tue, 25 Jun 2024 15:16:01 -0400 Subject: [PATCH] Allow interface argumetn for GetConfigMessage, similar to SetConfigMessage. --- python/fusion_engine_client/messages/configuration.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/fusion_engine_client/messages/configuration.py b/python/fusion_engine_client/messages/configuration.py index 9815c7c4..a7407b8b 100644 --- a/python/fusion_engine_client/messages/configuration.py +++ b/python/fusion_engine_client/messages/configuration.py @@ -1194,7 +1194,9 @@ def __validate_interface_header(self): def __init__(self, config_type: Union[ConfigType, _ConfigClassGenerator.ConfigClass] = ConfigType.INVALID, - request_source: ConfigurationSource = ConfigurationSource.ACTIVE, interface_header: Optional[InterfaceConfigSubmessage]=None): + request_source: ConfigurationSource = ConfigurationSource.ACTIVE, + interface: Optional[InterfaceID] = None, + interface_header: Optional[InterfaceConfigSubmessage] = None): self.request_source = request_source if isinstance(config_type, ConfigType): @@ -1202,6 +1204,11 @@ def __init__(self, else: self.config_type = config_type.GetType() + if interface_header is None and interface is not None: + if issubclass(config_type, _ConfigClassGenerator.InterfaceConfigClass): + interface_header = InterfaceConfigSubmessage(interface=interface, subtype=config_type.GetSubtype()) + else: + raise ValueError('Interface configuration subtype not specified. Cannot construct header.') self.interface_header = interface_header self.__validate_interface_header()