{"size": 682, "ext": "js", "max_stars_repo_path": "examples/color.js", "max_stars_repo_name": "WeeJeWel/node-hyperion-client", "max_stars_repo_stars_event_min_datetime": "2015-12-06T17:48:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-29T00:18:15.000Z", "max_issues_repo_path": "node_modules/hyperion-client/examples/color.js", "max_issues_repo_name": "djqkdaos/smartmirror_190507", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/hyperion-client/examples/color.js", "max_forks_repo_name": "djqkdaos/smartmirror_190507", "max_forks_repo_forks_event_min_datetime": "2017-10-30T10:06:00.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-20T20:55:03.000Z"}
{"max_stars_count": 9, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 22.7333333333, "max_line_length": 93, "alphanum_fraction": 0.5439882698}
"use strict";

var Hyperion = require('..');

var hyperion = new Hyperion( process.argv[2] || 'emile-pi.local', process.argv[3] || 19444 );
	hyperion.on('connect', function(){
		console.log('connected');
		
		for( var i = 0; i < 10; i++ ) {
			(function(i){
				setTimeout(function(){
		
					var color = [];
					for( var j = 0; j < 3; j++ ) {
						color[j] = Math.floor(Math.random()*255);
					}
					
					console.log("Setting to color", color)
					hyperion.setColor(color, function( err, result ){
						console.log(i, 'err', err, 'result', result)
					})
					
				}, i * 200);
			})(i)
		}
		
	})
	hyperion.on('error', function(error){
		console.error('error:', error)
	})