tsathishkumar / MySController-rs

Controller for MySensors, exposes WoT APIs for the sensors. It supports OTA firmware updates, and also acts as proxy for all requests.
GNU Affero General Public License v3.0
20 stars 9 forks source link

Add support for getControllerConfig() requests #9

Open tsathishkumar opened 6 years ago

tsathishkumar commented 6 years ago

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

Some sample requests and responses of other controllers will help.

flatsiedatsie commented 5 years ago

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?

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';