added support for home assistant postgres database and convenience function to get state of entity
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""SQLAlchemy model for the 'statistics_meta' table in the Home Assistant PostgreSQL database."""
|
||||
|
||||
from sqlalchemy import Column, BigInteger, String, Boolean, SmallInteger
|
||||
|
||||
from .base import Base
|
||||
|
||||
|
||||
class StatisticsMeta(Base):
|
||||
"""SQLAlchemy model for the 'statistics_meta' table."""
|
||||
|
||||
__tablename__ = "statistics_meta"
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
statistic_id = Column(String(255), nullable=True)
|
||||
source = Column(String(32), nullable=True)
|
||||
unit_of_measurement = Column(String(255), nullable=True)
|
||||
unit_class = Column(String(255), nullable=True)
|
||||
has_mean = Column(Boolean, nullable=True)
|
||||
has_sum = Column(Boolean, nullable=True)
|
||||
name = Column(String(255), nullable=True)
|
||||
mean_type = Column(SmallInteger, nullable=False)
|
||||
Reference in New Issue
Block a user