homebridge-rtl 0.1.1-beta.1 → 0.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sensor.js +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-rtl",
3
- "version": "0.1.1-beta.1",
3
+ "version": "0.1.1-beta.2",
4
4
  "description": "RTL_433 based sensor for Homebridge",
5
5
  "main": "src/sensor.js",
6
6
  "scripts": {
package/src/sensor.js CHANGED
@@ -6,7 +6,7 @@ const moment = require('moment');
6
6
  var os = require("os");
7
7
  var _ = require('lodash');
8
8
  var hostname = os.hostname();
9
- var homebridgeLib = require('homebridge-lib');
9
+ //var homebridgeLib = require('homebridge-lib');
10
10
 
11
11
  let Service, Characteristic;
12
12
  var CustomCharacteristics;
@@ -17,7 +17,19 @@ var myAccessories = [];
17
17
  module.exports = (homebridge) => {
18
18
  Service = homebridge.hap.Service;
19
19
  Characteristic = homebridge.hap.Characteristic;
20
- CustomCharacteristics = new homebridgeLib.EveHomeKitTypes(homebridge).Characteristics;
20
+ //CustomCharacteristics = new homebridgeLib.EveHomeKitTypes(homebridge).Characteristics;
21
+ var LastActivation = function() {
22
+ Characteristic.call(this, 'Last Activation', 'E863F11A-079E-48FF-8F27-9C2605A29F52');
23
+ this.setProps({
24
+ format: Characteristic.Formats.UINT32,
25
+ unit: Characteristic.Units.SECONDS,
26
+ perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
27
+ });
28
+ this.value = this.getDefaultValue();
29
+ };
30
+ require('util').inherits(LastActivation, Characteristic);
31
+ LastActivation.UUID = 'E863F11A-079E-48FF-8F27-9C2605A29F52';
32
+ CustomCharacteristics = { LastActivation: LastActivation };
21
33
  FakeGatoHistoryService = require('fakegato-history')(homebridge);
22
34
 
23
35
  homebridge.registerPlatform('homebridge-rtl', 'rtl_433', rtl433Plugin);
@@ -69,7 +81,7 @@ function rtl433Server() {
69
81
  input: proc.stdout,
70
82
  terminal: false
71
83
  }).on('line', function (message) {
72
- this.log("Message", message.toString());
84
+ //this.log("Message", message.toString());
73
85
  debug("Message", message.toString());
74
86
 
75
87
  if (message.toString().startsWith('{')) {
@@ -407,8 +419,8 @@ function getDevices(unit) {
407
419
  }
408
420
  }
409
421
  if (devices.length === 0) {
410
- this.log.error("FYI: Message from unknown device ID", unit);
411
- this.log("Message", this.message.toString());
422
+ debug("FYI: Message from unknown device ID", unit);
423
+ debug("Message", this.message.toString());
412
424
  }
413
425
  return devices;
414
426
  }