New version of import with uppercase filenames

Rafael
Rafael M. Martins 7 months ago
parent cd853a646a
commit e65bf2dabf
  1. 13
      py/README.md
  2. 2
      py/import.py

@ -10,6 +10,19 @@ All the lines below should be run inside the 'py' subdirectory.
By default the API will be available at http://localhost:5000.
# Notes on the sensors
* Every sensor is (physically) in a "bridge". A bridge can have up to 12 sensors.
* The bridge is connected to the "main board" (?) via inputs. The inputs are named S1, S2, .. V1, etc.
* For example: a column named V1:5 contains the values measured by the 5th sensor of whatever bridge was connected to the input V1 at that point in time.
* The only way to identify the bridge is to read a hex value that it sends in its last sensor (12th) immediately after a reset.
* A reset can be identified by the fact that the headers show up again in the middle of a file.
- However, not every time the headers show up it is a reset... the headers can be manually forced to show for whatever reason.
- So, a reset is when the headers show up AND the 12th sensor gives a hex value, then starts to count uptime from 0.
* A "family" is a logical organization of sensors that may or may not have anything to do with a bridge.
- We can assume families and bridges are unrelated, for all practical reasons.
# Database input format
* Each house in its own subfolder of 'Data'. The name of the subfolder will be used as the ID of the house.

@ -20,7 +20,7 @@ for hus_name in next(os.walk(BASEDIR))[1]:
cur = con.cursor()
cards = []
for txt in glob.glob(f"{BASEDIR+hus_name}/**/*.txt", recursive=True):
for txt in glob.glob(f"{BASEDIR+hus_name}/**/*.TXT", recursive=True):
card, year, month = os.path.split(txt)[1].split('.')[0].split('-')

Loading…
Cancel
Save