Svelte UI Update
This commit is contained in:
59
api/models/device.model.js
Normal file
59
api/models/device.model.js
Normal file
@@ -0,0 +1,59 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const deviceLogSchema = new Schema({
|
||||
remote_name: {
|
||||
type: String
|
||||
},
|
||||
remote_type: {
|
||||
type: String
|
||||
},
|
||||
operating_type: {
|
||||
type: String // Toggle - Homekit Reset - Reset
|
||||
},
|
||||
log_time: {
|
||||
type: String
|
||||
},
|
||||
sensor_value: {
|
||||
type: Number
|
||||
},
|
||||
battery_life: {
|
||||
type: Number
|
||||
}
|
||||
});
|
||||
|
||||
const deviceSchema = new Schema({
|
||||
device_name: {
|
||||
type: String,
|
||||
unique: true
|
||||
},
|
||||
device_type: {
|
||||
type: String
|
||||
},
|
||||
manifactor: {
|
||||
type: String
|
||||
},
|
||||
serial_number: {
|
||||
type: String,
|
||||
unique: true
|
||||
},
|
||||
model: {
|
||||
type: String
|
||||
},
|
||||
firmware_version: {
|
||||
type: String
|
||||
},
|
||||
device_ip_address: {
|
||||
type: String,
|
||||
unique: true
|
||||
},
|
||||
update_time: {
|
||||
type: String
|
||||
},
|
||||
device_log: [deviceLogSchema]
|
||||
});
|
||||
|
||||
const Device = mongoose.model("Device", deviceSchema);
|
||||
|
||||
module.exports = Device;
|
||||
Reference in New Issue
Block a user