Skip to main content

Get current config of the device

First of all, it is important to remind that each device is associated to a single software version than can be updated. Each software version is associated with a configuration that can be updated as well. The configuration depends on the model of the device and on the new implemented features.

Before upgrading a config for the first time, you need to have the template of the configuration. This template is provided by Emerit and is specific to each device model.

1. Get the current configuration of the device according to the software version

To get the current configuration of the device, you need to make a request to the Emerit API to get the template of the configuration associated to the device's software version.

query QUERY_LAST_SOFTWARE_VERSION_BY_DEVICE_ID($deviceModelId: String!) {
getLastSoftwareVersionByDeviceModelId(deviceModelId: $deviceModelId) {
id
versionNumber
sourceUrl
configTemplate
createdAt
updatedAt
}
}

In the response, you will find the config template, you can start to update it according to your needs.