Skip to content

Commit 1a0d3df

Browse files
committed
feat: Update cli with v1 status trait
1 parent 4370d30 commit 1a0d3df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roborock/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ async def home_data_cache() -> HomeData:
117117

118118
click.echo("MQTT session started. Querying devices...")
119119
for device in devices:
120+
if not (status_trait := device.traits.get("status")):
121+
click.echo(f"Device {device.name} does not have a status trait")
122+
continue
120123
try:
121-
status = await device.get_status()
124+
status = await status_trait.get_status()
122125
except RoborockException as e:
123126
click.echo(f"Failed to get status for {device.name}: {e}")
124127
else:

0 commit comments

Comments
 (0)