INNER CODE UNIT · Python
handle_command_list
arnonym/ha-plugins · ha-sip/src/main.py:32
def handle_command_list(command_client: CommandClient, command_handler: CommandHandler) -> None:
command_list = command_client.get_command_list()
for command in command_list:
command_handler.handle_command(command, None)
def load_menu_from_file(file_name: Optional[str], sip_account_index: int) -> Optional[incoming_call.IncomingCallConfig]:
if not file_name:
log(sip_account_index, 'No file name for incoming call config specified.')
return None
try:
with open(file_name) as stream:
content = yaml.safe_load(stream)
log(sip_account_index, f'Loaded menu for incoming call from "{file_name}".')
return content
except BaseException as e:
log(sip_account_index, f'Error loading menu for incoming call: {e}')
return None