-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindi_proxy.py
40 lines (30 loc) · 963 Bytes
/
indi_proxy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import PyIndi
class MyINDIClient(PyIndi.BaseClient):
def __init__(self):
super(MyINDIClient, self).__init__()
self.device = None
def newDevice(self, d):
if d.getDeviceName() == "CCD Simulator":
print(f"Found device: {d.getDeviceName()}")
self.device = d
def newProperty(self, p):
print(f"New property: {p.getName()} for device {p.getDeviceName()}")
def newBLOB(self, bp):
# Handle new BLOB properties here
pass
def newSwitch(self, sp):
pass
def newNumber(self, np):
pass
def newText(self, tp):
pass
def newLight(self, lp):
pass
def newMessage(self, d, m):
print(f"Message from {d.getDeviceName()}: {m.message}")
# Create a client and connect to the server
client = MyINDIClient()
client.setServer("localhost", 7624)
if not client.connectServer():
print("Could not connect to INDI server")
exit(1)