mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Update cli feature command for actions not to require a value (#1264)
This commit is contained in:
parent
cf77128853
commit
0d1193ac71
@ -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}")
|
||||||
|
Loading…
Reference in New Issue
Block a user