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()