createPayloadEndpointCapability()

in alexa/skills/smarthome/AlexaResponse.js [146:162]


    createPayloadEndpointCapability(opts) {

      if (opts === undefined) opts = {};

      let capability = {};
      capability['type'] = this.checkValue(opts.type, "AlexaInterface");
      capability['interface'] = this.checkValue(opts.interface, "Alexa");
      capability['version'] = this.checkValue(opts.version, "3");
      let supported = this.checkValue(opts.supported, false);
      if (supported) {
        capability['properties'] = {};
        capability['properties']['supported'] = supported;
        capability['properties']['proactivelyReported'] = this.checkValue(opts.proactivelyReported, false);
        capability['properties']['retrievable'] = this.checkValue(opts.retrievable, false);
      }
      return capability
    }