# Path: solarpi/extensions.py

# 
# Path: solarpi/weather/models.py
# class Weather(SurrogatePK, Model):
#     __tablename__ = "weather_data"
# 
#     id = Column(db.Integer(), nullable=False, primary_key=True)
#     created_at = Column(db.Text(), nullable=False, default=dt.datetime.utcnow)
#     temp = Column(db.Float(), nullable=True)
#     pressure = Column(db.Integer(), nullable=True)
#     temp_min = Column(db.Float(), nullable=True)
#     temp_max = Column(db.Float(), nullable=True)
#     humidity = Column(db.Integer(), nullable=True)
#     wind_speed = Column(db.Float(), nullable=True)
#     wind_gust = Column(db.Float(), nullable=True)
#     wind_deg = Column(db.Integer(), nullable=True)
#     clouds = Column(db.Integer(), nullable=True)
#     rain = Column(db.Integer(), nullable=True)
#     snow = Column(db.Integer(), nullable=True)
#     weather_id = Column(db.Integer(), nullable=True)


from datetime import datetime, timedelta
from solarpi.extensions import cache
from solarpi.weather.models import Weather
# -*- coding: utf-8 -*-


WEATHER_ICONS = {
    211: "wi-storm-showers",
    300: "wi-showers",
    301: "wi-showers",
    310: "wi-showers",
    500: "wi-showers",
    501: "wi-showers",
    502: "wi-rain",
    520: "wi-rain",
    521: "wi-rain",
    701: "wi-fog",
    741: "wi-fog",
    800: "wi-day-sunny",
    801: "wi-day-sunny-overcast",
    802: "wi-day-cloudy",
    803: "wi-cloudy",
    804: "wi-cloudy",
}



# Path: solarpi/extensions.py

# 
# Path: solarpi/weather/models.py
# class Weather(SurrogatePK, Model):
#     __tablename__ = "weather_data"
# 
#     id = Column(db.Integer(), nullable=False, primary_key=True)
#     created_at = Column(db.Text(), nullable=False, default=dt.datetime.utcnow)
#     temp = Column(db.Float(), nullable=True)
#     pressure = Column(db.Integer(), nullable=True)
#     temp_min = Column(db.Float(), nullable=True)
#     temp_max = Column(db.Float(), nullable=True)
#     humidity = Column(db.Integer(), nullable=True)
#     wind_speed = Column(db.Float(), nullable=True)
#     wind_gust = Column(db.Float(), nullable=True)
#     wind_deg = Column(db.Integer(), nullable=True)
#     clouds = Column(db.Integer(), nullable=True)
#     rain = Column(db.Integer(), nullable=True)
#     snow = Column(db.Integer(), nullable=True)
#     weather_id = Column(db.Integer(), nullable=True)


# Path: solarpi/weather/helper.py
from datetime import datetime, timedelta
from solarpi.extensions import cache
from solarpi.weather.models import Weather

# -*- coding: utf-8 -*-


WEATHER_ICONS = {
    211: "wi-storm-showers",
    300: "wi-showers",
    301: "wi-showers",
    310: "wi-showers",
    500: "wi-showers",
    501: "wi-showers",
    502: "wi-rain",
    520: "wi-rain",
    521: "wi-rain",
    701: "wi-fog",
    741: "wi-fog",
    800: "wi-day-sunny",
    801: "wi-day-sunny-overcast",
    802: "wi-day-cloudy",
    803: "wi-cloudy",
    804: "wi-cloudy",
}



@cache.cached(timeout=300, key_prefix="current_weather")