36 lines
827 B
Python
36 lines
827 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import time
|
|
import sys
|
|
import json
|
|
|
|
# from deviceManager import DeviceManager
|
|
# from requests import Requests
|
|
from mqtt import MqttThread
|
|
from db_test import run
|
|
|
|
class Main():
|
|
def __init__(self, controller_id = 'b8:27:eb:18:f8:cc', mqtt_ip = '192.168.2.1') -> None:
|
|
# setup mqtt thread
|
|
self._mqttThread = MqttThread(self, controller_id, mqtt_ip, 1883, 'test')
|
|
self._mqttThread.run()
|
|
|
|
def get_analysis_data(self, input:str):
|
|
run()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
# if len(sys.argv) < 3:
|
|
# print('please input controller_id & ip')
|
|
# sys.exit()
|
|
|
|
main = Main()
|
|
|
|
try:
|
|
while True:
|
|
pass
|
|
except (KeyboardInterrupt, SystemExit):
|
|
print("Received keyboard interrupt, quitting ...")
|
|
exit(0)
|