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
+3 -1
View File
@@ -792,7 +792,9 @@ def create_app(config_object="config"):
device.battery_slots = slots
device.notes = notes
device.device_type = device_type
device.battery_size = request.form.get("battery_size", "").strip() or None
new_battery_size = request.form.get("battery_size", "").strip() or None
if new_battery_size is not None:
device.battery_size = new_battery_size
device.location = request.form.get("location", "").strip() or None
device.ha_entity_id = request.form.get("ha_entity_id", "").strip() or None
db.commit()