This commit is contained in:
xyj 2023-12-14 10:48:29 +08:00
parent 3ab0ddc2db
commit dd16d45784
2 changed files with 2 additions and 2 deletions

View File

@ -165,7 +165,7 @@ def local():
# print("当前风向为:", int(return_data_hex[10:14], 16))#单位mm
# 6号设备是8方位
if subscribe_topic == zhanguan_device_name:
winddirection_data = int(return_data_hex[10:14], 16)
winddirection_data = int(return_data_hex[6:10], 16)
else:
winddirection_data = int(return_data_hex[6:10], 16) / 10
time.sleep(5)

View File

@ -169,7 +169,7 @@ def get_data():
# print("当前风向为:", int(return_data_hex[10:14], 16) ) #单位mm
# 6号设备是8方位
if subscribe_topic == zhanguan_device_name:
winddirection_data = int(return_data_hex[10:14], 16)
winddirection_data = int(return_data_hex[6:10], 16)
else:
winddirection_data = int(return_data_hex[6:10], 16) / 10
time.sleep(5)