Closed matthew-schultz closed 5 years ago
If in sensor_info, the api_folder column is blank, does the code works assuming no API information is necessary, skipping checking the api_table? You should account for that since it would be very confusing seeing in sensor_info something filled for a hobo.
This way, so long it is NOT NULL, the code goes and search in the api_table for the api_folder name. If it doesn't match, it throws an error saying "I can't find any API information of the folder mentioned in sensor_info's api_table. If no API information is available, please leave the sensor_info field as NULL."
If in sensor_info, the api_folder column is blank, does the code work
I think you're referring to sensor_info.script_folder? If sensor_info.script_folder is empty for a given purpose:
1) webctrl and egauge purposes won't retrieve or insert data for that purpose if sensor_info.script_folder is empty but 2) hobo __works regardless of what's in script_folder__ since it checks data_sensor_info_mapping and query_string columns in the sensor_info table.
it would be very confusing seeing in sensor_info something filled for a hobo
I was thinking that every sensor would have a value for sensor_info.script_folder. That could be an easy way for a user to see at a glance that the purpose is for a hobo sensor, even if the code didn't use that column at all.
Does it sound okay if sensor_info.script_folder has values for hobo even if the code doesn't use that value?
Do we want create a new boolean in __sensor_info__ like "uses_api_auth", to easily distinguish between what uses that table and what doesn't?
Based on our call, I misunderstood that this script_folder column was actually the one used by the cron job to also decide on the *_api.py script to run. Henceforth we do not want this column to ever be NULL.
related issue #113
I added a script_folder column to the api_authentication table, since we discussed that other api's like egauge might also need a username and password for authentication.