diff --git a/src/frequenz/client/dispatch/__main__.py b/src/frequenz/client/dispatch/__main__.py index afcec1b..92671e6 100644 --- a/src/frequenz/client/dispatch/__main__.py +++ b/src/frequenz/client/dispatch/__main__.py @@ -58,6 +58,8 @@ async def cli(ctx: click.Context, url: str, key: str) -> None: if ctx.obj is None: ctx.obj = {} + click.echo(f"Using API URL: {url}", err=True) + ctx.obj["client"] = Client( server_url=url, key=key, @@ -264,6 +266,10 @@ async def create( # Remove keys with `None` value kwargs = {k: v for k, v in kwargs.items() if v is not None} + # Required for client.create + if not kwargs.get("duration"): + kwargs["duration"] = None + dispatch = await ctx.obj["client"].create( recurrence=parse_recurrence(kwargs), **kwargs,