<commit_before>// MQTT Setup
var mqtt = require('mqtt');
console.log("Connecting to MQTT broker...");
var mqtt = require('mqtt');
var options = {
  port: 1883,
  host: 'localhost',
  clientId: 'Pump'
};
var client = mqtt.connect(options);
console.log(options.clientId+" Connected to MQTT broker");

var Accessory = require('../').Accessory;
var Service = require('../').Service;
var Characteristic = require('../').Characteristic;
var uuid = require('../').uuid;

// here's a fake hardware device that we'll expose to HomeKit
var ACCESSORY = {
  powerOn: false,

  setPowerOn: function(on) {
    console.log("Turning the "+options.clientId+" %s!", on ? "on" : "off");
    if (on) {
      client.publish(options.clientId, 'on');
      ACCESSORY.powerOn = on;
   	}
    else {
	    client.publish(options.clientId,'off');
      ACCESSORY.powerOn = false;
   };

  },
  identify: function() {
    console.log("Identify the "+options.clientId+"!");
  }
}

// Generate a consistent UUID for our light Accessory that will remain the same even when
// restarting our server. We use the `uuid.generate` helper function to create a deterministic
// UUID based on an arbitrary "namespace" and the word "Christmaslight".
var accessoryUUID = uuid.generate('hap-nodejs:accessories:'+options.clientId);

// This is the Accessory that we'll return to HAP-NodeJS that represents our fake light.
var accessory = exports.accessory = new Accessory(options.clientId, accessoryUUID);

// Add properties for publishing (in case we're using Core.js and not BridgedCore.js)
accessory.username = "1B:3C:1C:8D:6E:FF";
accessory.pincode = "031-45-154";

// set some basic properties (these values are arbitrary and setting them is optional)
accessory
  .getService(Service.AccessoryInformation)
  .setCharacteristic(Characteristic.Manufacturer, "Flexzuu")
  .setCharacteristic(Characteristic.Model, "Rev-1")
  .setCharacteristic(Characteristic.SerialNumber, "A1S2NASF88EW");

// listen for the "identify" event for this Accessory
accessory.on('identify', function(paired, callback) {
  ACCESSORY.identify();
  callback(); // success
});
<commit_msg>Add log for debugging<commit_after>// MQTT Setup
var mqtt = require('mqtt');
console.log("Connecting to MQTT broker...");
var mqtt = require('mqtt');
var options = {
  port: 1883,
  host: 'localhost',
  clientId: 'Pump'
};
var client = mqtt.connect(options);
console.log(options.clientId+" Connected to MQTT broker");

var Accessory = require('../').Accessory;
var Service = require('../').Service;
var Characteristic = require('../').Characteristic;
var uuid = require('../').uuid;

// here's a fake hardware device that we'll expose to HomeKit
var ACCESSORY = {
  powerOn: false,

  setPowerOn: function(on) {
    console.log("Turning the "+options.clientId+" %s!", on ? "on" : "off");
    if (on) {
      client.publish(options.clientId, 'on');
      ACCESSORY.powerOn = on;
   	}
    else {
	    client.publish(options.clientId,'off');
      ACCESSORY.powerOn = false;
   };

  },
  identify: function() {
    console.log("Identify the "+options.clientId+"!");
  }
}

// Generate a consistent UUID for our light Accessory that will remain the same even when
// restarting our server. We use the `uuid.generate` helper function to create a deterministic
// UUID based on an arbitrary "namespace" and the word "Christmaslight".
var accessoryUUID = uuid.generate('hap-nodejs:accessories:'+options.clientId);
console.log(accessoryUUID);
// This is the Accessory that we'll return to HAP-NodeJS that represents our fake light.
var accessory = exports.accessory = new Accessory(options.clientId, accessoryUUID);

// Add properties for publishing (in case we're using Core.js and not BridgedCore.js)
accessory.username = "1B:3C:1C:8D:6E:FF";
accessory.pincode = "031-45-154";

// set some basic properties (these values are arbitrary and setting them is optional)
accessory
  .getService(Service.AccessoryInformation)
  .setCharacteristic(Characteristic.Manufacturer, "Flexzuu")
  .setCharacteristic(Characteristic.Model, "Rev-1")
  .setCharacteristic(Characteristic.SerialNumber, "A1S2NASF88EW");

// listen for the "identify" event for this Accessory
accessory.on('identify', function(paired, callback) {
  ACCESSORY.identify();
  callback(); // success
});

{'fraction_non_alphanumeric': 0.1378826828698294, 'fraction_numerical': 0.010282776349614395, 'mean_word_length': 4.383647798742138, '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': '96715', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1324, 'n_words': 386}