Add optional Home Assistant integration for battery percentage tracking
This commit is contained in:
@@ -12,6 +12,7 @@ class Device(Base):
|
||||
battery_slots = Column(Integer, nullable=False, default=1)
|
||||
device_type = Column(String(50), nullable=True)
|
||||
notes = Column(Text, nullable=True)
|
||||
ha_entity_id = Column(String(100), nullable=True) # e.g. "sensor.tv_remote_battery"
|
||||
|
||||
batteries = relationship("Battery", back_populates="device")
|
||||
|
||||
@@ -47,6 +48,7 @@ class Battery(Base):
|
||||
charge_cycles = Column(Integer, nullable=True) # number of charge cycles
|
||||
purchase_date = Column(String(10), nullable=True) # YYYY-MM-DD when purchased
|
||||
storage_location = Column(String(100), nullable=True) # where stored when not installed
|
||||
battery_percentage = Column(Integer, nullable=True) # current charge %, set by HA poller or manually
|
||||
|
||||
device = relationship("Device", back_populates="batteries")
|
||||
capacity_tests = relationship(
|
||||
|
||||
Reference in New Issue
Block a user