Update cli feature command for actions not to require a value (#1264)

This commit is contained in:
Steven B. 2024-11-15 14:38:41 +00:00 committed by GitHub
parent cf77128853
commit 0d1193ac71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -122,6 +122,12 @@ async def feature(
feat = dev.features[name] feat = dev.features[name]
if value is None and feat.type is Feature.Type.Action:
echo(f"Executing action {name}")
response = await dev.features[name].set_value(value)
echo(response)
return response
if value is None: if value is None:
unit = f" {feat.unit}" if feat.unit else "" unit = f" {feat.unit}" if feat.unit else ""
echo(f"{feat.name} ({name}): {feat.value}{unit}") echo(f"{feat.name} ({name}): {feat.value}{unit}")