To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit fa7a89b3 authored by Henrik Menne's avatar Henrik Menne
Browse files

typing get_ain

parent 6e73432c
......@@ -15,7 +15,7 @@ from __future__ import annotations
import logging
from collections.abc import Sequence
from typing import Union
from typing import Union, Tuple
from aenum import Enum, IntEnum
......@@ -124,7 +124,7 @@ class LabJack(SingleCommDevice):
ONE_TENTH = 0.1
ONE_HUNDREDTH = 0.01
def get_ain(self, *channels: int) -> float:
def get_ain(self, *channels: int) -> Tuple[float]:
"""
Read currently measured value (voltage, resistance, ...) from one or more
of analog inputs.
......@@ -139,7 +139,7 @@ class LabJack(SingleCommDevice):
# or `tuple` of `float`; defensively casting in case this changes in future
if isinstance(ret_val, Sequence) and not isinstance(ret_val, str):
return tuple(float(val) for val in ret_val)
return float(ret_val)
return tuple(float(ret_val))
def set_ain_range(self, channel: int, ain_range: AInRange) -> None:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment