基本上,我有几个设备需要从中提取数据。当温度测量值低于或超过设定限制时,我会收到多封电子邮件。我希望有一个for
循环将所有当前低于或超过限制的设备状态包含在一封电子邮件中。
body = for device_name, 1 do
device_name++ -- I get error here because unexpected symbol near 'for'
"Device Name: " ..device_name.. "\nDevice Location: " ..device_location..
"\n--------------------------------------------------------------" ..
"\nCurrent Temperature: " ..temperature.." F".. "\nTemperature Limit: ("..
t_under_limit.. "-" ..t_over_limit.. " F)" .."\n\nCurrent Humidity Level: " ..
humidity .. "%".. "\nHumidity Limit: (" .. h_under_limit.. "-" ..h_over_limit.. "%)"
.. "\n\n-------Time Recorded at: " ..os.date().. "-------"})
end, -- end for