MySController-rs icon indicating copy to clipboard operation
MySController-rs copied to clipboard

Add support for getControllerConfig() requests

Open tsathishkumar opened this issue 7 years ago • 2 comments

tsathishkumar avatar Oct 22 '18 04:10 tsathishkumar

@flatsiedatsie I need some help here to understand on how to handle this request.

Some sample requests and responses of other controllers will help.

tsathishkumar avatar Nov 22 '18 10:11 tsathishkumar

On it.

The only one I really care about it this Arduino command:

getControllerConfig().isMetric

The message is:

*; (node) *; (child) 3; (internal command) 0; (ACK, can also be 1) 6; (I_CONFIG command)

Form the api documentation: Reply with (M)etric or (I)mperal back to sensor.

The question then becomes: how do we know what the user prefers?

  • Ask the Mozilla Gateway? I couldn't find anything about this. In Domoticz this is a preference in the settings.
  • Ask the Raspberry Pi? But this would only work if the user has set locale (Mozilla Gateway users do not) data and/or if the device has an internet connection (my Raspberry Pi will not have an internet connection).
  • Forget about this, and just let the user set the preference in the code of the sensors? But then how will the interface know whether to show the Celcius or Fahrenheit icon?

From what I found in the Mozilla Gateway code here, it seems they expect the device to decide and name what to send, and notify the gateway of that.

      case 'degree fahrenheit':
      case 'degrees fahrenheit':
      case 'fahrenheit':
        return '°F';

      case 'degree celsius':
      case 'degrees celsius':
      case 'celsius':
        return '°C';

      case 'kelvin':
        return 'K';

flatsiedatsie avatar Nov 29 '18 14:11 flatsiedatsie