<commit_before># homebridge-globalcache-gc100
THIS PLUGIN DOESN'T WORK YET!

The goal of this homebridge plugin is to make it possible to turn a TV and/or Stereo on or off with Siri.

*The hardware topology looks like this:*
  iOS Device -> homebridge server -|-> Global Cache 100 IR -> Stereo IR blaster
                                   |-> Global Cache 100 RS232 -> Television serial port


_"Siri turn on the Stereo"_ should then run this code:

  var net = require('net');
  
  var HOST = '10.0.1.155';
  var IR_PORT = 4998;
  var RS232_PORT = 4999;
  var client = new net.Socket();
  
  // Marantz Stereo ON IR command:
  var command = 'sendir,4:1,1,37000,4,1,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,2731,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,1200';
  
  client.connect(IR_PORT, HOST, function(){
  	console.log('CONNECTED TO: ' + HOST + ':' + IR_PORT);
  		// Send the IR command to the GC100
  		client.write(command+"\r");
  }).on('data', function(data) {
  	// log the response from the GC100
  	console.log('DATA: ' + data);
  	// Close the connection
  	client.destroy();
  });


In order to achieve this goal, I need to create a new platform for homebridge (https://github.com/nfarina/homebridge)



HYPOTHETICAL config.json:
Add this to .homebridge/config.json:

  "platforms": [
  	{
  		"platform": "globalcache-gc100",
  		"name": "gc100",
  		"host": "10.0.1.155",
  		"ir_port": "4998",
  		"rs232_port": "4999",
  
  		"ir_devices": [
  			{ "name": "<NAME>",
  				"commands": [
  					{"on": "sendir,4:1,1,37000,4,1,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,2731,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,1200"},
  					{"off": "sendir,4:1,2,37000,4,1,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,64,64,2731,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,64,64,1200"}
  				]
  			}
  		],
  
  		"rs232_devices": [
  			{ "name": "Panasonic TV",
  				"commands": [
  					{"on" : "PON"},
  					{"off" : "POF"}
  				]
  			}
  		]
  	}
  ]
<commit_msg>Updated readme to explain the intention of this plugin/platform<commit_after># homebridge-globalcache-gc100
**THIS PLUGIN DOESN'T WORK YET!**

The goal of this homebridge plugin is to make it possible to turn a TV and/or Stereo on or off with Siri.

**The hardware topology looks like this:**
    iOS Device -> homebridge server -|-> Global Cache 100 IR -> Stereo IR blaster
                                     |-> Global Cache 100 RS232 -> Television serial port


_"Siri turn on the Stereo"_ should then run this code:

```javascript
var net = require('net');

var HOST = '10.0.1.155';
var IR_PORT = 4998;
var RS232_PORT = 4999;
var client = new net.Socket();

// Marantz Stereo ON IR command:
var command = 'sendir,4:1,1,37000,4,1,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,2731,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,1200';

client.connect(IR_PORT, HOST, function(){
	console.log('CONNECTED TO: ' + HOST + ':' + IR_PORT);
		// Send the IR command to the GC100
		client.write(command+"\r");
}).on('data', function(data) {
	// log the response from the GC100
	console.log('DATA: ' + data);
	// Close the connection
	client.destroy();
});
```

In order to achieve this goal, I need to create a new platform for homebridge (https://github.com/nfarina/homebridge)



**HYPOTHETICAL config.json:**

_Add this to .homebridge/config.json:_

```javascript
"platforms": [
	{
		"platform": "globalcache-gc100",
		"name": "gc100",
		"host": "10.0.1.155",
		"ir_port": "4998",
		"rs232_port": "4999",

		"ir_devices": [
			{ "name": "<NAME>",
				"commands": [
					{"on": "sendir,4:1,1,37000,4,1,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,2731,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,32,32,64,32,1200"},
					{"off": "sendir,4:1,2,37000,4,1,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,64,64,2731,32,32,32,32,32,32,64,32,32,32,32,32,32,161,32,32,32,64,32,32,64,32,32,32,32,32,32,32,32,32,32,64,64,1200"}
				]
			}
		],

		"rs232_devices": [
			{ "name": "Panasonic TV",
				"commands": [
					{"on" : "PON"},
					{"off" : "POF"}
				]
			}
		]
	}
]
```

{'fraction_non_alphanumeric': 0.2066239316239316, 'fraction_numerical': 0.22863247863247863, 'mean_word_length': 4.368119266055046, 'pattern_counts': {'":': 28, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6970085', 'n_tokens_mistral': 2767, 'n_tokens_neox': 2106, 'n_words': 342}