diff --git a/custom_components/visonic/examples/complete_example.py b/custom_components/visonic/examples/complete_example.py index 6edeb81..94f29cb 100644 --- a/custom_components/visonic/examples/complete_example.py +++ b/custom_components/visonic/examples/complete_example.py @@ -249,7 +249,7 @@ def onNewSensor(self, sensor: AlSensorDevice): self.process_sensor(sensor) sensor.onChange(self.onSensorChange) - def onPanelChangeHandler(self, e): + def onPanelChangeHandler(self, e: AlCondition, data : dict): """ This is a callback function, called from the visonic library. """ if type(e) == AlIntEnum: if self.process_event is not None: @@ -338,7 +338,6 @@ async def async_create_tcp_visonic_connection(self, address, port, panelConfig : sock.settimeout(1.0) # set timeout to 1 second to flush the receive buffer sock.connect((address, port)) - pl_sock = None # Flush the buffer, receive any data and dump it try: dummy = sock.recv(10000) # try to receive 100 bytes @@ -350,7 +349,7 @@ async def async_create_tcp_visonic_connection(self, address, port, panelConfig : # set the timeout to infinite sock.settimeout(None) - vp = ClientVisonicProtocol(serial_connection = False, panelConfig=panelConfig, pl_sock = pl_sock, loop=loop) + vp = ClientVisonicProtocol(serial_connection = False, panelConfig=panelConfig, loop=loop) #print("The vp " + str(type(vp)) + " with value " + str(vp)) # create the connection to the panel as an asyncio protocol handler and then set it up in a task diff --git a/custom_components/visonic/examples/simple_example.py b/custom_components/visonic/examples/simple_example.py index 44418de..4303d28 100644 --- a/custom_components/visonic/examples/simple_example.py +++ b/custom_components/visonic/examples/simple_example.py @@ -153,7 +153,7 @@ def onNewSensor(sensor: AlSensorDevice): else: print("Sensor ", str(sensor)) -def onPanelChangeHandler(e): +def onPanelChangeHandler(self, e: AlCondition, data : dict): """ This is a callback function, called from the visonic library. """ print(f"onPanelChangeHandler {type(e)} value {e}")