Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions pyindi/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ async def stdio(limit=asyncio.streams._DEFAULT_LIMIT):
return reader, writer





def printa(msg: Union[str, bytes]):
"""
This was the old way of writing to stdout
Expand Down Expand Up @@ -104,7 +101,7 @@ async def drain(self):
class INDIEnumMember(int):
"""
## INDIEnumMember
This sublcasses the int class to match
This subclasses the int class to match
the standard enum int type but adds
a string in the assignment to allow
for comparison with the raw xml
Expand Down Expand Up @@ -220,6 +217,37 @@ def fromstring(string):
raise ValueError(f"ISState must be either Off or On not {string}")


class DRIVER_INTERFACE(Enum):
"""Driver interface enum.

Used by drivers to advertise to clients which interface(s) they implement.

See https://docs.indilib.org/drivers/basics/driver-interface.html for details.
"""

GENERAL_INTERFACE = 0 # Default interface for all INDI devices
TELESCOPE_INTERFACE = 1 << 0 # Telescope interface
CCD_INTERFACE = 1 << 1 # CCD interface
GUIDER_INTERFACE = 1 << 2 # Guider interface
FOCUSER_INTERFACE = 1 << 3 # Focuser interface
FILTER_INTERFACE = 1 << 4 # Filter interface
DOME_INTERFACE = 1 << 5 # Dome interface
GPS_INTERFACE = 1 << 6 # GPS interface
WEATHER_INTERFACE = 1 << 7 # Weather interface,
AO_INTERFACE = 1 << 8 # Adaptive Optics Interface
DUSTCAP_INTERFACE = 1 << 9 # Dust Cap Interface
LIGHTBOX_INTERFACE = 1 << 10 # Light Box Interface
DETECTOR_INTERFACE = 1 << 11 # Detector interface
ROTATOR_INTERFACE = 1 << 12 # Rotator interface
SPECTROGRAPH_INTERFACE = 1 << 13 # Spectrograph interface
CORRELATOR_INTERFACE = 1 << 14 # Correlators (interferometers) interface
AUX_INTERFACE = 1 << 15 # Auxiliary interface
OUTPUT_INTERFACE = 1 << 16 # Digital Output (e.g. Relay) interface
INPUT_INTERFACE = 1 << 17 # Digital/Analog Input (e.g. GPIO) interface
POWER_INTERFACE = 1 << 18 # Power interface
SENSOR_INTERFACE = SPECTROGRAPH_INTERFACE | DETECTOR_INTERFACE | CORRELATOR_INTERFACE


class IVectorProperty(ABC):
"""
INDI Vector asbstractions
Expand Down