From 74509330968e0bd5e09b8d94ca2071d25782d259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 26 Dec 2024 15:23:03 -0800 Subject: [PATCH] Emit last_heartbeat_set as ISO string --- python/lvmecp/actor/commands/status.py | 4 +++- python/lvmecp/etc/schema.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/lvmecp/actor/commands/status.py b/python/lvmecp/actor/commands/status.py index 159de38..2f771cf 100644 --- a/python/lvmecp/actor/commands/status.py +++ b/python/lvmecp/actor/commands/status.py @@ -14,6 +14,8 @@ import click +from lvmecp.tools import timestamp_to_iso + from . import parser @@ -46,6 +48,6 @@ async def status(command: ECPCommand, no_registers: bool = False): o2_percent_spectrograph=plc.safety.o2_level_spectrograph, ) - command.info(last_heartbeat_set=command.actor._last_heartbeat) + command.info(last_heartbeat_set=timestamp_to_iso(command.actor._last_heartbeat)) return command.finish() diff --git a/python/lvmecp/etc/schema.json b/python/lvmecp/etc/schema.json index f9cc03d..742403d 100644 --- a/python/lvmecp/etc/schema.json +++ b/python/lvmecp/etc/schema.json @@ -24,7 +24,7 @@ "o2_percent_utilities": { "type": "number" }, "o2_percent_spectrograph": { "type": "number" }, "last_heartbeat_set": { - "oneOf": [{ "type": "number" }, { "type": "null" }] + "oneOf": [{ "type": "string" }, { "type": "null" }] }, "engineering_mode": { "type": "object",