bec_lib.config_helper.ConfigHelper#

class ConfigHelper(connector: RedisConnector, service_name: str = None)[source]#

Bases: object

Config Helper

Helper class for updating and saving the BEC device configuration.

Parameters:
  • connector (RedisConnector) – Redis connector.

  • service_name (str, optional) – Name of the service. Defaults to None.

Methods

load_demo_config

Load BEC device demo_config.yaml for simulation.

save_current_session

Save the current session as a yaml file to disk.

send_config_request

send request to update config Returns:

update_session_with_file

Update the current session with a yaml file from disk.

wait_for_config_reply

wait for config reply

wait_for_service_response

wait for service response

load_demo_config()[source]#

Load BEC device demo_config.yaml for simulation.

save_current_session(file_path: str)[source]#

Save the current session as a yaml file to disk.

Parameters:

file_path (str) – Full path to the yaml file.

send_config_request(action: str = 'update', config=None) None[source]#

send request to update config Returns:

update_session_with_file(file_path: str, save_recovery: bool = True) None[source]#

Update the current session with a yaml file from disk.

Parameters:
  • file_path (str) – Full path to the yaml file.

  • save_recovery (bool, optional) – Save the current session before updating. Defaults to True.

wait_for_config_reply(RID: str, timeout=10) RequestResponseMessage[source]#

wait for config reply

Parameters:
  • RID (str) – request id

  • timeout (int, optional) – timeout in seconds. Defaults to 10.

Returns:

reply message

Return type:

RequestResponseMessage

wait_for_service_response(RID: str, timeout=10) ServiceResponseMessage[source]#

wait for service response

Parameters:
  • RID (str) – request id

  • timeout (int, optional) – timeout in seconds. Defaults to 10.

Returns:

reply message

Return type:

ServiceResponseMessage