<commit_before>var hue = require("node-hue-api");
var hueapiBase = require("node-hue-api").HueApi;
var description = 'hueset_proto'
var hueIP = 'tbd';
var hueUser = 'tbd';
var hueapi = new hueapiBase();

hue.nupnpSearch(function(err, result) {
    if (err) throw err;
    hueIP = result[0].ipaddress;
    console.log('hueIP set as:', hueIP);
    console.log('Press button on Hue Bridge now.')
    configureHue();
});

function configureHue() {
    if(hueUser === 'tbd') {    
        hueapi.createUser(hueIP, description, function(err, user) {
            console.log('Awaiting Link Button Press...')
            if (err) {
                console.log(err.message);
                setTimeout(configureHue, 1000);
            } else {
                console.log(JSON.stringify(user));
                console.log('hueIP set as:', hueUser);
            }
            
        });
    } else {
        console.log('hueIP already set as:', hueUser);
    }
}<commit_msg>hueconfig final tweaks<commit_after>var hue = require("node-hue-api");
var hueapiBase = require("node-hue-api").HueApi;
var description = 'hueset_proto'
var hueIP = 'tbd';
var hueUser = 'tbd';
var hueapi = new hueapiBase();

hue.nupnpSearch(function(err, result) {
    if (err) {
        console.log(err.message);
    } else {
        hueIP = result[0].ipaddress;
        console.log('Bridge discovered. Press button on Hue Bridge now.')
        setTimeout(configureHue, 10000);
    }
    
});

function configureHue() {
    if(hueUser === 'tbd') {    
        hueapi.createUser(hueIP, description, function(err, user) {
            console.log('Awaiting Link Button Press...')
            if (err) {
                console.log(err.message);
                setTimeout(configureHue, 5000);
            } else {
                hueUser = JSON.stringify(user);
                console.log('hueUser set as:', hueUser);
                console.log('hueIP set as:', hueIP);
            }
            
        });
    } else {
        console.log('hueIP already set as:', hueUser);
    }
}
{'fraction_non_alphanumeric': 0.14139444173573867, 'fraction_numerical': 0.007313505607020965, 'mean_word_length': 2.152073732718894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2583229', 'n_tokens_mistral': 690, 'n_tokens_neox': 650, 'n_words': 140}