Profiles¶
Profiles are a way of introducing user-defined data to devices and folders.
A profile is defining fields and validations, while profile-data will hold the concrete values for the fields.
Profiles can be filled with data for folders (formerly tags) or devices.
Fields¶
Field | Type | Description |
---|---|---|
id | uuid | Id of profile |
name | string | Name of profile |
slug | string | Technical name of profile |
fields | Profile.Field | Field definitions in profile |
limit_to | string | Limitation to folders and/or devices |
inserted_at | ISO8601 | ISO 8601 String of the time the profile was created |
updated_at | ISO8601 | ISO 8601 String of the time the profile was created |
Associations¶
Association | Cardinality | Foreign Entity | Description | Can preload |
---|---|---|---|---|
mandate | one | Mandates | Mandate of profile |
Fields map¶
Profiles and ProfileData can be combined to a easy to use map structured like this:
{
"<profile 1 technical name>": {
"<field 1 technical name>": "<field 1 data>",
"<field 2 technical name>": "<field 2 data>"
},
"<profile 2 technical name>": {
"<field 1 technical name>": "<field 1 data>",
"<field 2 technical name>": "<field 2 data>"
}
}
A real-world-example that can be found in a device or folder:
{
"address": {
"street": "Mainstreet",
"housenumber": "123"
},
"distance_sensor": {
"min_distance_cm": "10",
"max_distance_cm": "1000"
}
}