diff --git a/sfm/server.py b/sfm/server.py index 7f0c663..c34b149 100644 --- a/sfm/server.py +++ b/sfm/server.py @@ -629,8 +629,7 @@ def device_monitor_status( Returns is_monitoring bool, battery voltage, and memory usage (total + free bytes). Battery and memory are only present when the unit is idle (not monitoring). """ - transport = _make_transport(port=port, baud=baud, host=host, tcp_port=tcp_port) - with MiniMateClient(transport=transport) as client: + with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client: try: client.connect() except Exception as exc: @@ -662,8 +661,7 @@ def device_monitor_start( Sends SUB 0x96 and waits for ack SUB 0x69. """ - transport = _make_transport(port=port, baud=baud, host=host, tcp_port=tcp_port) - with MiniMateClient(transport=transport) as client: + with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client: try: client.connect() except Exception as exc: @@ -685,8 +683,7 @@ def device_monitor_stop( Sends SUB 0x97 and waits for ack SUB 0x68. """ - transport = _make_transport(port=port, baud=baud, host=host, tcp_port=tcp_port) - with MiniMateClient(transport=transport) as client: + with _build_client(port=port, baud=baud, host=host, tcp_port=tcp_port) as client: try: client.connect() except Exception as exc: