# Path: solarpi/electricity/models.py
# class Electricity(SurrogatePK, Model):
#     __tablename__ = "electricity_data"
#     id = Column(db.Integer(), nullable=False, primary_key=True)
#     created_at = Column(db.Text(), nullable=False, default=dt.datetime.utcnow)
#     meter_180 = Column(db.Float(), nullable=True)
#     meter_280 = Column(db.Float(), nullable=True)
#     active_power = Column(db.Float(), nullable=True)
# 
# Path: solarpi/extensions.py



from datetime import datetime, timedelta
from sqlalchemy import func
from solarpi.electricity.models import Electricity
from solarpi.extensions import cache, db
# -*- coding: utf-8 -*-




@cache.cached(timeout=300, key_prefix="todays_electricity")
def get_todays_electricity():
    return (

# Path: solarpi/electricity/models.py
# class Electricity(SurrogatePK, Model):
#     __tablename__ = "electricity_data"
#     id = Column(db.Integer(), nullable=False, primary_key=True)
#     created_at = Column(db.Text(), nullable=False, default=dt.datetime.utcnow)
#     meter_180 = Column(db.Float(), nullable=True)
#     meter_280 = Column(db.Float(), nullable=True)
#     active_power = Column(db.Float(), nullable=True)
# 
# Path: solarpi/extensions.py



# Path: solarpi/electricity/helper.py
from datetime import datetime, timedelta
from sqlalchemy import func
from solarpi.electricity.models import Electricity
from solarpi.extensions import cache, db

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




@cache.cached(timeout=300, key_prefix="todays_electricity")
def get_todays_electricity():
    return (

        Electricity.query.with_entities(