These are a list of the types, lists, objects, and values we will be creating beforehand for the smart farming app we are building.
- We need to create a type called Chart with three String properties – Label, Border color, and Background color.
We will add a fourth number property called Data. - Let’s create a list value called Chart Data 1 of the Chart type.
We will add four default data objects, thusly:
Data – 10, Label – Label 1
Data – 20, Label – Label 2
Data – 30, Label – Label 3
Data – 40, Label – Label 4
We will save the value when done. - We will now create an object called tempChart of the Chart type.
- Let’s create a second list value called ChartTemp of the Chart type.
- We will also create a third list value of the Chart type and call it ChartHumid.
- We will create another type CaseMockType. The type will have eight string properties — Number, CreatedDate, Description, Type, AssetID, Reason, Origin, and Status.
- Next up. A list called CaseMockLists, of the CaseMockType type. We will add a default data object as well.
This is what we will copy-paste in the respective fields, and of course save the value when done.
AssetID — XDX1
CreatedDate — 2018-03-28T10:36:03.000Z
Description — An issue has been reported. Please investigate the device with details: DeviceID:XDX1 with lux value of 48600.
Number — 00001678
Origin — Web
Reason — An issue has been reported. Please investigate the device with details: DeviceID:XDX1 with lux value of 48600.
Status — Open
Type — Electrical. - Last in the CaseMock line of values, though not the least, is an object, also called CaseMock.
We will add a bit of default data. Exactly the same as with the list earlier. This is what we will copy-paste in the respective fields, and of course save the value when done.
AssetID — XDX1
CreatedDate — 2018-03-28T10:36:03.000Z
Description — An issue has been reported. Please investigate the device with details: DeviceID:XDX1 with lux value of 48600.
Number — 00001678
Origin — Web
Reason — An issue has been reported. Please investigate the device with details: DeviceID:XDX1 with lux value of 48600.
Status — Open
Type — Electrical - We will create another type called ProductCatalogMock. This type will have six string properties — Name, Description, Active, Category, Code, and Color, respectively.
- Yes; we will create a list value of the ProductCatalogMock type as well. Let’s call it ProductCatalogMockList.
- Let’s add a default data object.
Active — Yes
Category — IoT
Code — 1221212
Color — White
Description — Smart light
Name — White neon - Almost done! We will create two more types. The first one is called WaveMockType. It has two string properties – DateTimeF and Lux.
- There will be a list value called Root of the WaveMockType.
We will add the following default data:
DateTimeF/Lux – 20180328 103410.918, 5000
DateTimeF/Lux – 20180328 103411.918, 4995
DateTimeF/Lux – 20180328 103409.918, 40
DateTimeF/Lux –20180328 103409.918, 300 - We want an object of the WaveMockType as well. Let’s name it tempWave.
- Let’s create another type called WaveMockType(Env). This will have three string properties – DateTimeF, Temp, and Humidity.
- We will create a list and an object value of the WaveMockType(Env) type. Let’s call the list Root(Env). This is the default data we are going to add:
DateTimeF/Humidity/Temp – 20180328 103410.918, 90, 32
DateTimeF/Humidity/Temp – 20180328 103411.918, 50, 35
DateTimeF/Humidity/Temp – 20180328 103409.918, 57, 20
DateTimeF/Humidity/Temp – 20180328 103409.918, 89, 24 - We are going to call the object tempWave(Env).
- We will create three number values called avgLums, avgTemp, and avgHum.
Aaand we are done!