Files
RaspberryPie/RaspberryPie/flaskAddons.py
T
lars d9f01ff0b8 I Don't know if it's working...
I just have no f**** clue.... There's no structure in this god damn project but let's hope for the best.
2021-05-30 10:04:04 +02:00

23 lines
1.1 KiB
Python

import datetime
import RaspberryPie.config as config
import RaspberryPie.dataHandling as dataHandling
def time(): return ""
def weatherUrls(): return [config.config["WeatherUrls"][i] for i in config.config["WeatherUrls"]]
def getLatestAirData(): return dataHandling.bGenSecretary.fetchAir()
def getLatestPicture(): return dataHandling.bGenSecretary.fetchAir()
def getDataRangeAir(start: int, end: int): return dataHandling.bGenSecretary.fetchAir(datetime.datetime.utcfromtimestamp(end), datetime.datetime.utcfromtimestamp(start))
def getDataRangePictures(start: int, end: int): return dataHandling.bGenSecretary.fetchPicture(datetime.datetime.utcfromtimestamp(end), datetime.datetime.utcfromtimestamp(start))
def getSingleAirData(time: int): return dataHandling.bGenSecretary.fetchAir(datetime.datetime.utcfromtimestamp(time))
def getSinglePicture(time: int): return dataHandling.bGenSecretary.fetchPicture(datetime.datetime.utcfromtimestamp(time))
def lastChange():
with open(config.config["FileLocations"]["lastChangeFile"], 'r') as f:
return int(f.read())