From f250cb03d3babb16d8ebc57515a6b9bbfc7774fb Mon Sep 17 00:00:00 2001 From: Lia Stratopoulos <167905060+lia-viam@users.noreply.github.com> Date: Thu, 19 Feb 2026 15:27:10 -0500 Subject: [PATCH] Fix incorrect threshold in get_robot_part sample code The comment said "less than 10 sec ago" but the comparison used 10000 (milliseconds) instead of 10 (seconds). Since time.time() and .timestamp() both return values in seconds, the threshold should be 10. Co-Authored-By: Claude Sonnet 4.6 --- src/viam/app/app_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viam/app/app_client.py b/src/viam/app/app_client.py index a1286587c..12675c2e5 100644 --- a/src/viam/app/app_client.py +++ b/src/viam/app/app_client.py @@ -1286,7 +1286,7 @@ async def get_robot_part(self, robot_part_id: str, dest: Optional[str] = None, i # Get the part's address address = my_robot_part.fqdn # Check if machine is live (last access time less than 10 sec ago) - if (time.time() - my_robot_part.last_access.timestamp()) <= 10000: + if (time.time() - my_robot_part.last_access.timestamp()) <= 10: print("Machine is live.") Args: