This commit is contained in:
jokob-sk
2025-04-03 07:51:59 +11:00
parent e1f9ca05b7
commit 2889be28e4
16 changed files with 89 additions and 29 deletions

View File

@@ -75,7 +75,6 @@ class DB():
return arr
#-------------------------------------------------------------------------------
def upgradeDB(self):
"""
@@ -929,4 +928,19 @@ def get_all_devices(db):
return db.read(sql_devices_all)
#-------------------------------------------------------------------------------
def get_array_from_sql_rows(rows):
# Convert result into list of lists
arr = []
for row in rows:
if isinstance(row, sqlite3.Row):
arr.append(list(row)) # Convert row to list
elif isinstance(row, (tuple, list)):
arr.append(list(row)) # Already iterable, just convert to list
else:
arr.append([row]) # Handle single values safely
return arr
#-------------------------------------------------------------------------------