From c37d2a6574a4e37fac73b27b1e6bfbbf2dedfd89 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Tue, 7 Jun 2022 16:49:33 -0500 Subject: [PATCH] Allow sensors to be remote machines --- yaqc_cmds/sensors/_sensors.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yaqc_cmds/sensors/_sensors.py b/yaqc_cmds/sensors/_sensors.py index fff353e..90cd2b7 100644 --- a/yaqc_cmds/sensors/_sensors.py +++ b/yaqc_cmds/sensors/_sensors.py @@ -117,7 +117,11 @@ class Driver(pc.Driver): def __init__(self, sensor, yaqd_port): super().__init__() - self.client = yaqc.Client(yaqd_port) + host = "localhost" + if isinstance(yaqd_port, str): + host, yaqd_port = yaqd_port.split(":", 1) + yaqd_port = int(yaqd_port) + self.client = yaqc.Client(yaqd_port, host=host) # attributes self.name = self.client.id()["name"] self.enqueued = sensor.enqueued