Make device.battery_size NOT NULL in schema and tests

This commit is contained in:
2026-04-19 19:00:33 -05:00
parent 3e75bb3ab4
commit 52d1105997
3 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -13,7 +13,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=True) # AA, AAA, 9V, CR2032 …
battery_size = Column(String(20), nullable=False) # AA, AAA, 9V, CR2032 …
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"