Updated tests and added core live value handling

Removed useless tests, will need to complete a more comprehensive test
suite however this is not the priority right now

Added a live value dict in the core whose values are populated by the
core's input thread
This commit is contained in:
2026-08-05 20:42:19 +01:00
parent a882b29654
commit 561f42aca2
9 changed files with 104 additions and 79 deletions
+19 -4
View File
@@ -12,7 +12,7 @@ from rich.logging import RichHandler
from dynalab_core.protocols.common import VersionDescriptor
from dynalab_core.protocols.constants import PROTOCOL_VERSION
from dynalab_core.protocols.json.wire import read_message, write_message
from dynalab_core.protocols.packets.data import ValueDescriptor
from dynalab_core.protocols.packets.data import ValueBatch, ValueDescriptor
from dynalab_core.protocols.packets.handshake import (
ConnectorHello,
DynaLabHello,
@@ -26,9 +26,9 @@ PORT = 8765
# Set to None to send as quickly as possible.
# For a controlled rate, use something like 5_000.0.
TARGET_FREQUENCY_HZ: float | None = None
TARGET_FREQUENCY_HZ: float | None = 1000
FREQUENCY_SAMPLE_SIZE = 500
FREQUENCY_SAMPLE_SIZE = 20000
CONNECTOR_VERSION = VersionDescriptor(
type="alpha",
@@ -116,11 +116,26 @@ def value_sender_thread(
next_send_time += period
message = ValueDescriptor(
value = ValueDescriptor(
signal_id=signal_id,
value=2.0,
)
message = ValueBatch(
values=[
value,
value,
value,
value,
value,
value,
value,
value,
value,
value,
]
)
future = asyncio.run_coroutine_threadsafe(
send_message(
writer,