Skip to content
Snippets Groups Projects
Commit 1a1c128a authored by marcoemi.poleggi's avatar marcoemi.poleggi
Browse files
parent 47cdea30
Branches
No related tags found
No related merge requests found
......@@ -150,7 +150,12 @@ class Actuasim(QMainWindow):
def frame_received(self, frame):
self.logger.info('Frame received:' + str([hex(h) for h in frame[0]]))
decoded_frame = knxnet.decode_frame(frame[0])
try:
decoded_frame = knxnet.decode_frame(frame[0])
except Exception as e:
self.logger.info('Bad frame: {}'.format(e))
return
if decoded_frame.header.service_type_descriptor == knxnet.ServiceTypeDescriptor.CONNECTION_REQUEST:
self.logger.info('= Connection request:\n' + str(decoded_frame))
conn_resp = knxnet.create_frame(knxnet.ServiceTypeDescriptor.CONNECTION_RESPONSE,
......
......@@ -23,14 +23,14 @@ class BlindWidget(QWidget):
def __init__(self, individual_address, group_address, blind_position=0, animation_speed_ms=1500):
super(BlindWidget, self).__init__()
self.ui = Ui_Blind()
self.ui.setupUi(self)
self.logger = logging.getLogger()
self.individual_address = individual_address
self.group_address = group_address
self.ui = Ui_Blind()
self.ui.setupUi(self)
# Progressbar init
self.is_moving = False
self.animation_speed = animation_speed_ms
......
......@@ -45,4 +45,4 @@ class Knxserver(QObject, threading.Thread):
if __name__ == '__main__':
serv = Knxserver()
serv.start()
\ No newline at end of file
serv.start()
......@@ -25,14 +25,18 @@ class ValveWidget(QWidget):
def __init__(self, individual_address, group_address, valve_position=45, animation_speed_ms=1500):
super(ValveWidget, self).__init__()
self.ui = Ui_Valve()
self.ui.setupUi(self)
self.logger = logging.getLogger()
self.individual_address = individual_address
self.group_address = group_address
self._position = 0
self.ui = Ui_Valve()
self.ui.setupUi(self)
self.position = valve_position
self.setFixedWidth(220)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment