forked from artekw/viess2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvcontrold.py
33 lines (24 loc) · 801 Bytes
/
vcontrold.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
import time
import datetime
import telnetlib
import re
class vclient(object):
def __init__(self, host, port):
self.telnet_client = telnetlib.Telnet(host, port)
#self.command = cmd
def publish(self, cmd):
#vclient(HOST, PORT)
for v in vals:
self.telnet_client.read_until('vctrld>')
self.telnet_client.write(v + '\n')
print(self.telnet_client.read_some())
#out = self.telnet_client.read_until('Grad Celsius')
#print(out)
HOST = '192.168.168.16' # vcontrold telnet host
PORT = '3002' # vcontrold port
vals = ['getAussentemperatur', 'getWWTempIst']
vals2 = {'command': 'getAussentemperatur', 'command': 'getWWTempIst'}
vc = vclient(HOST, PORT)
vc.publish(vals)
#for v in vals:
# vc.publish(v)