{"size": 653, "ext": "js", "max_stars_repo_path": "modules/Led/server.js", "max_stars_repo_name": "gtrias/IoTFlow", "max_stars_repo_stars_event_min_datetime": "2018-10-02T19:04:04.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-25T07:43:38.000Z", "max_issues_repo_path": "modules/Led/server.js", "max_issues_repo_name": "gtrias/IoTFlow", "max_issues_repo_issues_event_min_datetime": "2018-11-02T15:34:58.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-15T08:33:29.000Z", "max_forks_repo_path": "modules/Led/server.js", "max_forks_repo_name": "gtrias/IoTFlow", "max_forks_repo_forks_event_min_datetime": "2018-11-02T14:59:04.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-07T09:15:45.000Z"}
{"max_stars_count": 25, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 15.1860465116, "max_line_length": 55, "alphanum_fraction": 0.4992343032}
exports.load = function(datos, host, port, board) {
var content;
content += `
// EMPIEZA LED

var led`+datos.id+` = new five.Led(`+datos.data.msg+`);

socket.on('read`+datos.id+`', function(data){
  if(Number.isInteger(data)) {
    if(data > 255) {
      data = 255;
    }
    if(data < 0) {
      data = 0;
    }

    led`+datos.id+`.brightness(data);
  } else {
    switch (data) {
      case true:
          led`+datos.id+`.on();
        break;
      case false:
          led`+datos.id+`.off();
        break;
      case 'toggle':
          led`+datos.id+`.toggle();
      break;
      default:

    }
  }

});




// FIN LED
`;
return  content;
};
