From 545341418ff2095e47028746ba9671357bc38db8 Mon Sep 17 00:00:00 2001 From: Hiromasa Ihara Date: Mon, 4 Nov 2024 15:09:36 +0900 Subject: [PATCH] fix: support incase of channels attribute is missing in component object --- openems/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openems/__main__.py b/openems/__main__.py index e0b7cb6..e65928c 100644 --- a/openems/__main__.py +++ b/openems/__main__.py @@ -70,7 +70,7 @@ def get_channel_list(ctx, edge_id, component_id): edge_config = ctx.obj['client'].get_edge_config(edge_id) component = [v for (k, v) in edge_config['components'].items() if k == component_id][0] - for channel in component['channels']: + for channel in component.get('channels', []): click.echo(click.style(f'{component_id}/{channel}', fg='green'))