Enforce parent device hierarchy: slots/size unset, battery summary, sub-component toggle

This commit is contained in:
2026-06-08 12:57:31 -05:00
parent 75fe4fe575
commit 2a54cd8297
5 changed files with 135 additions and 33 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ class Device(Base):
name = Column(String(100), nullable=False, unique=True)
battery_slots = Column(Integer, nullable=False, default=1)
device_type = Column(String(50), nullable=True)
battery_size = Column(String(20), nullable=False) # AA, AAA, 9V, CR2032 …
battery_size = Column(String(20), nullable=True) # AA, AAA, 9V, CR2032 …; null for parent-only devices
location = Column(String(100), nullable=True)
notes = Column(Text, nullable=True)
ha_entity_id = Column(String(100), nullable=True) # e.g. "sensor.tv_remote_battery"