Skip to content

Commit

Permalink
Allow interface argumetn for GetConfigMessage, similar to SetConfigMe…
Browse files Browse the repository at this point in the history
…ssage.
  • Loading branch information
adamshapiro0 committed Nov 6, 2024
1 parent 31e0934 commit 9246bbb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/fusion_engine_client/messages/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,14 +1194,21 @@ 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):
self.config_type = config_type
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()
Expand Down

0 comments on commit 9246bbb

Please sign in to comment.