def add_sensor_notification(self, notification_message): Base.metadata.create_all(engine) session = Session() notification = Notification(notification_message) session.add(notification) session.commit() session.close()
def add_reading(self, temperature_reading, humidity_reading): Base.metadata.create_all(engine) session = Session() reading = SensorsReading(humidity_reading, temperature_reading) session.add(reading) session.commit() session.close()
def add_detection_result_image(self, name, detection_result_id, type_id): Base.metadata.create_all(engine) session = Session() image = ImageAttachment(name, detection_result_id, type_id) session.add(image) session.commit() session.close()
def add_movement(self, movement): Base.metadata.create_all(engine) session = Session() session.add(movement) session.commit() generated_id = movement.id session.close() return generated_id
def add_movement_notification(self, notification_entity): Base.metadata.create_all(engine) session = Session() session.add(notification_entity) session.commit() generated_id = notification_entity.id session.close() return generated_id
def add_detection_result_with_image(self, detection_result): Base.metadata.create_all(engine) session = Session() session.add(detection_result) session.commit() generated_id = detection_result.id session.close() return generated_id
def add_neural_network_file(self, neural_network_file: NeuralNetworkFile): Base.metadata.create_all(engine) session = Session() session.add(neural_network_file) session.commit() session.close()
def add_recognition_result(self, recognition_result): Base.metadata.create_all(engine) session = Session() session.add(recognition_result) session.commit() session.close()