-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
django: db: add initial resources to certain tables
Certain database resources are static and generic and can be added at initial setup. Particularly LwM2M resources from the standard resource model are always identical. Having those resources already in the database helps to test fota update via the admin dashboard. Signed-off-by: Jonas Remmert <jremmert@gmx.net>
- Loading branch information
Showing
2 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
[ | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3303, | ||
"resource_id": 5700, | ||
"name": "temperature", | ||
"data_type": "float" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3303, | ||
"resource_id": 5701, | ||
"name": "humidity", | ||
"data_type": "float" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 0, | ||
"name": "manufacturer", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 1, | ||
"name": "model_number", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 2, | ||
"name": "serial_number", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 3, | ||
"name": "firmware_version", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 6, | ||
"name": "power_source", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 7, | ||
"name": "power_source_v", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 8, | ||
"name": "power_source_i", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 9, | ||
"name": "battery_level", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 10, | ||
"name": "memory_free", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 11, | ||
"name": "error_code", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 13, | ||
"name": "current_time", | ||
"data_type": "time" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 14, | ||
"name": "utc_offset", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 15, | ||
"name": "timezone", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 16, | ||
"name": "binding_mode", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 17, | ||
"name": "device_type", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 18, | ||
"name": "hardware_version", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 19, | ||
"name": "software_version", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 20, | ||
"name": "battery_status", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 3, | ||
"resource_id": 21, | ||
"name": "memory_total", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 5, | ||
"resource_id": 1, | ||
"name": "package_uri", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 5, | ||
"resource_id": 2, | ||
"name": "update", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 5, | ||
"resource_id": 3, | ||
"name": "state", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 5, | ||
"resource_id": 4, | ||
"name": "update_result", | ||
"data_type": "int" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 5, | ||
"resource_id": 5, | ||
"name": "package_name", | ||
"data_type": "string" | ||
} | ||
}, | ||
{ | ||
"model": "sensordata.resourcetype", | ||
"fields": { | ||
"object_id": 5, | ||
"resource_id": 6, | ||
"name": "package_version", | ||
"data_type": "string" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters