diff --git a/__pycache__/sainsmartrelay.cpython-311.pyc b/__pycache__/sainsmartrelay.cpython-311.pyc index ee29d68..a0f130e 100644 Binary files a/__pycache__/sainsmartrelay.cpython-311.pyc and b/__pycache__/sainsmartrelay.cpython-311.pyc differ diff --git a/bjoerntest10.py b/bjoerntest10.py index f52c431..2582b30 100644 --- a/bjoerntest10.py +++ b/bjoerntest10.py @@ -1089,7 +1089,8 @@ class RelayControl(QtWidgets.QMainWindow): # self.yolo_stream = YOLOv8CameraStream(model_path="models/yolov8m_seg_e300.pt", logging_level="high") # # self.yolo_stream.start() # Start the YOLOv8 stream # self.timer.start(30) # Start the timer to update the frame every 30ms (about 33 FPS) - r.turn_on(1) + print("Turn on light clicked") + self.r.turn_on(1) def spot_off(self): # # Stop the camera stream and processing @@ -1099,7 +1100,8 @@ class RelayControl(QtWidgets.QMainWindow): # self.yolo_stream = None # Reset the YOLOv8 stream object # self.scene.clear() # Clear the displayed frame from the graphicsView # print("Camera stream stopped and resources released.") - r.turn_off(1) + print("Turn off light clicked") + self.r.turn_off(1) if __name__ == "__main__": import sys @@ -1110,6 +1112,8 @@ if __name__ == "__main__": # Initialize the CameraStreamApp with the UI camera_app = CameraStreamApp(ui) + # initialize relay app + relay_app = RelayControl(ui) MainWindow.show() sys.exit(app.exec_()) \ No newline at end of file