[Edge drivers] Issue changing the device profile

Creating this post to discuss this issue reported here:

@Mariano_Colmenarejo, sorry for the delay. I tried to replicate this issue and I couldn’t. Could you share your preference’s definition, please?

I tested with two profiles which had the same preference name but a different range:

//profile 1:
  - title: "intRangeChange"
    name: "intRangeChange"
    description: "Test range change in pref"
    required: false
    preferenceType: integer
    definition:
      minimum: 2200
      maximum: 4000
//profile 2:
  - title: "intRangeChange"
    name: "intRangeChange"
    description: "Test range change in pref"
    required: false
    preferenceType: integer
    definition:
      minimum: 2700
      maximum: 6500

I changed the device profile assigned to the device back and forth using the Switch capability as trigger and the “Settings” menu never dissappeared.

Hi @nayelyz

You don’t have the problem if you don’t have a defined value or default value.

In the 2200-4000 profile, set the value to 2200 or set it as default.

Now try to switch to profile 2700-6500. The preferences will not be displayed.

It happens the same as if you have defined a preference as an integral type and you enter a value or define a default.

If you switch to a profile where that same preference is set to number type, the settings will also not be displayed until you clear the preference or uninstall and reinstall the device.

This case is rarer, but it can even occur if you want to modify the driver to put, for example, the adjustment of temperature reports with decimals instead of an integer.

In my first drivers it is entered with integer, range from 10 to 600, which is equivalent to 0.1°c and 6.0°c
In new drivers it is entered directly with decimals 0.1 to 6.0.
In old drivers I can’t change it to type number because users would be left without preferences until they uninstall and reinstall the device.
To avoid this, I could change the name of the preference, but if the user has selected a report of 300, for example, he would lose it and go to default without knowing it.

Hi, @Mariano_Colmenarejo

Sorry for the late response. We were able to replicate the issue, with some small differences. We already reported this to the team and they are looking into it.

1 Like