This commit is contained in:
xyj 2023-12-09 15:28:19 +08:00
parent 89229c989e
commit 5bbb0297dd
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ def local():
'wind_speed': speedwind_data, 'wind_speed': speedwind_data,
'wind_direction': winddirection_data, 'wind_direction': winddirection_data,
'create_time': int(time.time()), 'create_time': int(time.time()),
'device_name': os.getenv('device_name') 'device_name': device_name
} }
t = LOT_DATA(**data) t = LOT_DATA(**data)
add(t) add(t)

View File

@ -186,7 +186,7 @@ def t():
'wind_speed': speedwind_data, 'wind_speed': speedwind_data,
'wind_direction': winddirection_data, 'wind_direction': winddirection_data,
'create_time': int(time.time()), 'create_time': int(time.time()),
'device_name': os.getenv('device_name') 'device_name': device_name
} }
t2 = LOT_DATA(**data) t2 = LOT_DATA(**data)
client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0) client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)
@ -214,7 +214,7 @@ def test():
'wind_speed': 1, 'wind_speed': 1,
'wind_direction': 1, 'wind_direction': 1,
'create_time': int(time.time()), 'create_time': int(time.time()),
'device_name': os.getenv('device_name') 'device_name': device_name
} }
t2 = LOT_DATA(**data) t2 = LOT_DATA(**data)
client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0) client.publish('demo', payload=json.dumps(data, ensure_ascii=False), qos=0)