Make device.battery_size NOT NULL in schema and tests
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user