def __init__(self, device_info: DeviceInfo, project_name: str, progress: int = 0, to_finish: int = 0, notes: str = '') -> None: self.progress = progress self.to_finish = to_finish self.project_name = project_name self.notes = notes self.device_info = device_info.toJSON()
def __init__(self, id: str, device_info: DeviceInfo) -> None: self.device_info = device_info.toJSON() self.timestamp = timestamp() self.id = id
import threading from threading import Thread from globals import Globals from device_info import DeviceInfo import json from heartbeat import HeartBeat import time from event import Event if __name__ == '__main__': Globals() device = DeviceInfo( device_id='10', device_name='workstation 10', notes='I don not have any notes!') print(device.toJSON()) while(True): hb = HeartBeat('10',device) thread = hb.run_in_background() thread.join() print(hb.toJSON()) time.sleep(10)