-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_operations.py
26 lines (25 loc) · 953 Bytes
/
start_operations.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
# -*- coding: utf-8 -*-
# @Time : 12.05.22 13:40
# @Author : Tek Raj Chhetri
# @Email : [email protected]
# @Web : https://tekrajchhetri.com/
# @File : start_operations.py
# @Software: PyCharm
from sensor.sensor import Sensor
from helper.helper import Helpers
from pipeline.Pipeline import Pipeline
from subscriber.Subscribe import Subscribe
if __name__ == '__main__':
s = Sensor()
pipeline = Pipeline()
mode = Helpers().edge_intelligence_mode()["intelligence_mode"]
if mode == "edge":
while True:
sensor_data = s.read_sensor_data(mode=mode)
pipeline.validate_transform_migrate(sensor_data["humidity"])
pipeline.validate_apply_intelligence(sensor_data["humidity"])
pipeline.validate_transform_migrate(sensor_data["temperature"])
pipeline.validate_apply_intelligence(sensor_data["temperature"])
else:
s = Subscribe()
s.subscribe()