homebridge-rtl 0.1.0-beta.0 → 0.1.0-beta.1

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.
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "homebridge-rtl",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.0-beta.1",
4
4
  "description": "RTL_433 based sensor for Homebridge",
5
- "main": "sensor.js",
5
+ "main": "src/sensor.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "watch": "nodemon"
7
+ "lint": "eslint --max-warnings=0 .",
8
+ "lint:fix": "eslint --fix --max-warnings=0 .",
9
+ "watch": "nodemon",
10
+ "test": "jest --detectOpenHandles",
11
+ "test-coverage": "jest --coverage"
9
12
  },
10
13
  "repository": {
11
14
  "type": "git",
@@ -26,7 +29,7 @@
26
29
  "url": "https://github.com/northernman54/homebridge-rtl/issues"
27
30
  },
28
31
  "engines": {
29
- "homebridge": "^1.6.0",
32
+ "homebridge": "^1.6.0 || ^2.0.0-beta.0",
30
33
  "node": "^18.20.4 || ^20.15.1 || ^22.0.0"
31
34
  },
32
35
  "homepage": "https://github.com/northernman54/homebridge-rtl#readme",
@@ -37,16 +40,23 @@
37
40
  "mcuiot-logger": "0.0.12",
38
41
  "moment": "^2.18.1",
39
42
  "nodemon": "^3.1.7",
40
- "semver": "^7.6.3"
43
+ "semver": "^7.6.3",
44
+ "homebridge-lib": "^6.0.1"
41
45
  },
42
- "directories": {
43
- "lib": "lib"
46
+ "devDependencies": {
47
+ "@eslint/js": "^9.14.0",
48
+ "eslint": "^8.57.1",
49
+ "eslint-plugin-format": "^0.1.2",
50
+ "eslint-plugin-jest": "^28.8.3",
51
+ "globals": "^15.12.0",
52
+ "jest": "^29.7.0",
53
+ "nodemon": "^3.1.7"
44
54
  },
45
55
  "nodemonConfig": {
46
56
  "watch": [
47
57
  "src"
48
58
  ],
49
- "ext": "ts",
59
+ "ext": "js",
50
60
  "ignore": [],
51
61
  "exec": "~/npm/bin/homebridge -U ./test/hbConfig -T -D -P .",
52
62
  "signal": "SIGTERM",
@@ -6,9 +6,10 @@ 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
10
 
10
11
  let Service, Characteristic;
11
- var CustomCharacteristic;
12
+ var CustomCharacteristics;
12
13
  var FakeGatoHistoryService;
13
14
 
14
15
  var myAccessories = [];
@@ -16,7 +17,7 @@ var myAccessories = [];
16
17
  module.exports = (homebridge) => {
17
18
  Service = homebridge.hap.Service;
18
19
  Characteristic = homebridge.hap.Characteristic;
19
- CustomCharacteristic = require('./lib/CustomCharacteristic.js')(homebridge);
20
+ CustomCharacteristics = new homebridgeLib.EveHomeKitTypes(homebridge).Characteristics;
20
21
  FakeGatoHistoryService = require('fakegato-history')(homebridge);
21
22
 
22
23
  homebridge.registerPlatform('homebridge-rtl', 'rtl_433', rtl433Plugin);
@@ -133,10 +134,11 @@ Rtl433Accessory.prototype = {
133
134
  this.lastUpdated = Date.now();
134
135
  clearTimeout(this.timeout);
135
136
  this.timeout = setTimeout(deviceTimeout.bind(this), this.deviceTimeout * 60 * 1000);
137
+ var entry, batteryOk;
136
138
  switch (this.type) {
137
139
  case "temperature":
138
140
  var humidity;
139
- var entry = {
141
+ entry = {
140
142
  time: moment().unix(),
141
143
  temp: roundInt(data.temperature_C)
142
144
  }
@@ -161,7 +163,7 @@ Rtl433Accessory.prototype = {
161
163
  }
162
164
 
163
165
  if (data.battery !== undefined || data.battery_ok != undefined) {
164
- var batteryOk = data.battery === "OK" || data.battery_ok === 1
166
+ batteryOk = data.battery === "OK" || data.battery_ok === 1
165
167
  this.sensorService
166
168
  .setCharacteristic(Characteristic.StatusLowBattery, batteryOk ? Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL : Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW);
167
169
  }
@@ -177,7 +179,7 @@ Rtl433Accessory.prototype = {
177
179
  }
178
180
  break;
179
181
  case "humidity":
180
- var entry = {
182
+ entry = {
181
183
  time: moment().unix(),
182
184
  humidity: roundInt(data.humidity)
183
185
  }
@@ -195,7 +197,7 @@ Rtl433Accessory.prototype = {
195
197
  .setCharacteristic(Characteristic.CurrentRelativeHumidity, roundInt(data.humidity))
196
198
 
197
199
  if (data.battery !== undefined || data.battery_ok != undefined) {
198
- var batteryOk = data.battery === "OK" || data.battery_ok === 1
200
+ batteryOk = data.battery === "OK" || data.battery_ok === 1
199
201
  this.sensorService
200
202
  .setCharacteristic(Characteristic.StatusLowBattery, batteryOk ? Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL : Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW);
201
203
  }
@@ -217,7 +219,7 @@ Rtl433Accessory.prototype = {
217
219
 
218
220
  var value = (data.motion === "true" || data.motion === 1 ? true : false);
219
221
  if (this.sensorService.getCharacteristic(Characteristic.MotionDetected).value !== value) {
220
- this.sensorService.getCharacteristic(CustomCharacteristic.LastActivation)
222
+ this.sensorService.getCharacteristic(CustomCharacteristics.LastActivation)
221
223
  .updateValue(moment().unix() - this.loggingService.getInitialTime());
222
224
  }
223
225
  this.sensorService.getCharacteristic(Characteristic.MotionDetected)
@@ -232,7 +234,7 @@ Rtl433Accessory.prototype = {
232
234
  this.motionTimeout = setTimeout(function () {
233
235
  var value = false;
234
236
  if (this.sensorService.getCharacteristic(Characteristic.MotionDetected).value !== value) {
235
- this.sensorService.getCharacteristic(CustomCharacteristic.LastActivation)
237
+ this.sensorService.getCharacteristic(CustomCharacteristics.LastActivation)
236
238
  .updateValue(moment().unix() - this.loggingService.getInitialTime());
237
239
  }
238
240
  this.sensorService.getCharacteristic(Characteristic.MotionDetected)
@@ -279,7 +281,7 @@ Rtl433Accessory.prototype = {
279
281
  informationService
280
282
  .setCharacteristic(Characteristic.Manufacturer, "homebridge-rtl_433")
281
283
  .setCharacteristic(Characteristic.SerialNumber, hostname + "-" + this.name)
282
- .setCharacteristic(Characteristic.FirmwareRevision, require('./package.json').version);
284
+ .setCharacteristic(Characteristic.FirmwareRevision, require('../package.json').version);
283
285
  // Thermostat Service
284
286
 
285
287
  switch (this.type) {
@@ -342,7 +344,7 @@ Rtl433Accessory.prototype = {
342
344
  case "motion":
343
345
  this.sensorService = new Service.MotionSensor(this.name);
344
346
 
345
- this.sensorService.addCharacteristic(CustomCharacteristic.LastActivation);
347
+ this.sensorService.addCharacteristic(CustomCharacteristics.LastActivation);
346
348
 
347
349
  this.timeoutCharacteristic = Characteristic.MotionDetected;
348
350
  this.timeout = setTimeout(deviceTimeout.bind(this), this.deviceTimeout * 60 * 1000); // 5 minutes
@@ -360,7 +362,7 @@ Rtl433Accessory.prototype = {
360
362
  // console.log("get door this--->",this);
361
363
 
362
364
  this.sensorService = new Service.ContactSensor(this.name);
363
- this.sensorService.addCharacteristic(CustomCharacteristic.LastActivation);
365
+ this.sensorService.addCharacteristic(CustomCharacteristics.LastActivation);
364
366
 
365
367
  //this.timeoutCharacteristic = Characteristic.ContactSensorState;
366
368
  //this.timeout = setTimeout(deviceTimeout.bind(this), this.deviceTimeout * 60 * 1000); // 5 minutes
@@ -1,85 +0,0 @@
1
- #!/bin/env node
2
-
3
- /**
4
- * This scripts queries the npm registry to pull out the latest version for a given tag.
5
- */
6
-
7
- const assert = require('node:assert')
8
- const child_process = require('node:child_process')
9
- const fs = require('node:fs')
10
- const process = require('node:process')
11
-
12
- const semver = require('semver')
13
-
14
- const BRANCH_VERSION_PATTERN = /^([A-Z]+)-(\d+\.\d+\.\d+)$/i
15
-
16
- // Load the contents of the package.json file
17
- const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf8'))
18
-
19
- const refArgument = process.argv[2]
20
- const tagArgument = process.argv[3] || 'latest'
21
-
22
- if (refArgument == null) {
23
- console.error('ref argument is missing')
24
- console.error('Usage: npm-version-script.js <ref> [tag]')
25
- process.exit(1)
26
- }
27
-
28
- /**
29
- * Queries the NPM registry for the latest version for the provided tag.
30
- * @param tag The tag to query for.
31
- * @returns {string} Returns the version.
32
- */
33
- function getTagVersionFromNpm(tag) {
34
- try {
35
- return child_process.execSync(`npm info ${packageJSON.name} version --tag="${tag}"`).toString('utf8').trim()
36
- } catch (e) {
37
- console.error(`Failed to query the npm registry for the latest version for tag: ${tag}`)
38
- // throw e;
39
- return '0.0.0'
40
- }
41
- }
42
-
43
- function desiredTargetVersion(ref) {
44
- // ref is a GitHub action ref string
45
- if (ref.startsWith('refs/pull/')) {
46
- throw new Error('The version script was executed inside a PR!')
47
- }
48
-
49
- assert(ref.startsWith('refs/heads/'))
50
- const branchName = ref.slice('refs/heads/'.length)
51
-
52
- const results = branchName.match(BRANCH_VERSION_PATTERN)
53
- if (results != null) {
54
- if (results[1] !== tagArgument) {
55
- console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`)
56
- }
57
-
58
- return results[2]
59
- }
60
-
61
- throw new Error(`Malformed branch name for ref: ${ref}. Can't derive the base version. Use a branch name like: beta-x.x.x or alpha-x.x.x`)
62
- }
63
-
64
- // derive the base version from the branch ref
65
- const baseVersion = desiredTargetVersion(refArgument)
66
-
67
- // query the npm registry for the latest version of the provided tag name
68
- const latestReleasedVersion = getTagVersionFromNpm(tagArgument) // e.g. 0.7.0-beta.12
69
- const latestReleaseBase = semver.inc(latestReleasedVersion, 'patch') // will produce 0.7.0 (removing the preid, needed for the equality check below)
70
-
71
- let publishTag
72
- if (semver.eq(baseVersion, latestReleaseBase)) { // check if we are releasing another version for the latest beta or alpha
73
- publishTag = latestReleasedVersion // set the current latest beta or alpha to be incremented
74
- } else {
75
- publishTag = baseVersion // start of with a new beta or alpha version
76
- }
77
-
78
- // save the package.json
79
- packageJSON.version = publishTag
80
- fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2))
81
-
82
- // perform the same change to the package-lock.json
83
- const packageLockJSON = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'))
84
- packageLockJSON.version = publishTag
85
- fs.writeFileSync('package-lock.json', JSON.stringify(packageLockJSON, null, 2))
@@ -1,125 +0,0 @@
1
- name:
2
- 'Build, Publish and Release'
3
-
4
- #
5
- # Automatically publish beta releases on pushes, require a manual workflow action for production releases
6
- #
7
- # Does the following
8
- # 1 - Run the documentation script against the package
9
- # 2 - Create the npm package using the package.json version tag ( or for beta releases, adds a beta tag and increments as needed )
10
- # 3 - Publish the npm package
11
- # 4 - For releases against the latest branch, create a github release as well
12
-
13
- on:
14
- push:
15
- branches: [beta-*.*.*, beta]
16
- workflow_dispatch:
17
-
18
- jobs:
19
- get_tags:
20
- runs-on: ubuntu-latest
21
-
22
- steps:
23
- # checkout repo
24
- - uses: actions/checkout@v4
25
-
26
- # get branch / tag name
27
- - name: Get Branch / Tag Name
28
- id: get_branch
29
- run: |
30
- export BRANCH_NAME=$(if [[ ${GITHUB_REF} =~ "refs/tags/" ]]; then echo ${GITHUB_REF/refs\/tags\//}; else echo ${GITHUB_REF/refs\/heads\//}; fi)
31
- echo $BRANCH_NAME
32
- echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
33
-
34
- # generate the image tag
35
- - name: Get Image Tag
36
- id: get_tag
37
- run: |
38
- export TARGET_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.BRANCH_NAME }}" = "main" ]; then echo "main"; else echo "${{ steps.get_branch.outputs.BRANCH_NAME }}" | awk -F- '{ print $1 }'; fi)
39
- echo $TARGET_IMAGE_TAG
40
- echo "TARGET_IMAGE_TAG=${TARGET_IMAGE_TAG}" >> $GITHUB_OUTPUT
41
-
42
- outputs:
43
- BRANCH_NAME: ${{ steps.get_branch.outputs.BRANCH_NAME }}
44
- TARGET_IMAGE_TAG: ${{ steps.get_tag.outputs.TARGET_IMAGE_TAG }}
45
-
46
- create_documentation:
47
- runs-on: ubuntu-latest
48
-
49
- steps:
50
- # checkout repo
51
- - uses: actions/checkout@v4
52
- with:
53
- persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
54
- fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
55
-
56
- - uses: actions/setup-node@v4
57
- with:
58
- node-version: lts/*
59
-
60
- - name: Retrieve github-markdown-toc
61
- run: |
62
- wget -q https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc
63
- chmod a+x gh-md-toc
64
-
65
- - name: Create Table of Contents
66
- run: |
67
- npm run-script document --if-present
68
- rm gh-md-toc
69
-
70
- - name: Commit files
71
- run: |
72
- git config --local user.email "github-actions[bot]@users.noreply.github.com"
73
- git config --local user.name "github-actions[bot]"
74
- git add * || true
75
- git commit -a -m "Update TOC" || true
76
-
77
- - name: Push changes
78
- uses: ad-m/github-push-action@master
79
- with:
80
- github_token: ${{ secrets.GITHUB_TOKEN }}
81
- branch: ${{ github.ref }}
82
-
83
- publish_prod_release:
84
- permissions:
85
- id-token: write
86
- needs: [get_tags, create_documentation]
87
- name: Publish Release Version
88
- if: ${{ needs.get_tags.outputs.BRANCH_NAME == 'main' }}
89
- uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
90
- with:
91
- install_cmd: npm ci
92
- secrets:
93
- npm_auth_token: ${{ secrets.NPM_TOKEN }}
94
-
95
- publish_test_release:
96
- permissions:
97
- id-token: write
98
- needs: [get_tags, create_documentation]
99
- name: Publish Test Version - ${{ needs.get_tags.outputs.BRANCH_NAME }}
100
- if: ${{ needs.get_tags.outputs.BRANCH_NAME != 'main' }}
101
- uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
102
- with:
103
- tag: ${{ needs.get_tags.outputs.TARGET_IMAGE_TAG }}
104
- dynamically_adjust_version: true
105
- npm_version_command: pre
106
- pre_id: ${{ needs.get_tags.outputs.TARGET_IMAGE_TAG }}
107
- install_cmd: npm ci
108
- secrets:
109
- npm_auth_token: ${{ secrets.NPM_TOKEN }}
110
-
111
- publish_github_release:
112
- needs: [publish_prod_release]
113
- runs-on: ubuntu-latest
114
- steps:
115
- - uses: actions/checkout@v4
116
- - name: Create Release
117
- uses: softprops/action-gh-release@v1
118
- env:
119
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120
- with:
121
- tag_name: ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
122
- name: Release ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
123
- generate_release_notes: true
124
- draft: false
125
- prerelease: false
@@ -1,181 +0,0 @@
1
- var inherits = require('util').inherits;
2
- var Service, Characteristic;
3
-
4
- module.exports = function(homebridge) {
5
- Service = homebridge.hap.Service;
6
- Characteristic = homebridge.hap.Characteristic;
7
-
8
- var CustomCharacteristic = {};
9
-
10
- // Motion Sensor
11
- // Persistence of motion indication in seconds.
12
-
13
- CustomCharacteristic.Duration = function() {
14
- Characteristic.call(this, 'Duration', CustomCharacteristic.Duration.UUID);
15
- this.setProps({
16
- format: Characteristic.Formats.UINT16,
17
- unit: "seconds",
18
- minValue: 5,
19
- maxValue: 15 * 3600,
20
- validValues: [
21
- 5, 10, 20, 30,
22
- 1 * 60, 2 * 60, 3 * 60, 5 * 60, 10 * 60, 20 * 60, 30 * 60,
23
- 1 * 3600, 2 * 3600, 3 * 3600, 5 * 3600, 10 * 3600, 12 * 3600, 15 * 3600
24
- ],
25
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY, Characteristic.Perms.WRITE]
26
- });
27
- this.value = this.getDefaultValue();
28
- };
29
- CustomCharacteristic.Duration.UUID = 'E863F12D-079E-48FF-8F27-9C2605A29F52';
30
- inherits(CustomCharacteristic.Duration, Characteristic);
31
-
32
- // Motion Sensor
33
- // Time of last activation
34
-
35
- CustomCharacteristic.LastActivation = function() {
36
- Characteristic.call(this, 'Last Activation', CustomCharacteristic.LastActivation.UUID);
37
- this.setProps({
38
- format: Characteristic.Formats.UINT32,
39
- unit: "seconds",
40
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
41
- });
42
- this.value = this.getDefaultValue();
43
- };
44
- CustomCharacteristic.LastActivation.UUID = 'E863F11A-079E-48FF-8F27-9C2605A29F52';
45
- inherits(CustomCharacteristic.LastActivation, Characteristic);
46
-
47
- // Motion Sensor
48
- // Sensitivity of sensor
49
-
50
- CustomCharacteristic.Sensitivity = function() {
51
- Characteristic.call(this, 'Sensitivity', CustomCharacteristic.Sensitivity.UUID);
52
- this.setProps({
53
- format: Characteristic.Formats.UINT8,
54
- unit: "seconds",
55
- minValue: 0,
56
- maxValue: 7,
57
- validValues: [0, 4, 7],
58
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY, Characteristic.Perms.WRITE]
59
- });
60
- this.value = this.getDefaultValue();
61
- };
62
- CustomCharacteristic.Sensitivity.UUID = 'E863F120-079E-48FF-8F27-9C2605A29F52';
63
- inherits(CustomCharacteristic.Sensitivity, Characteristic);
64
-
65
- // Door
66
-
67
- CustomCharacteristic.ResetTotal = function() {
68
- Characteristic.call(this, 'Reset Total', CustomCharacteristic.ResetTotal.UUID);
69
- this.setProps({
70
- format: Characteristic.Formats.UINT32,
71
- unit: "seconds",
72
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY, Characteristic.Perms.WRITE]
73
- });
74
- this.value = this.getDefaultValue();
75
- };
76
- CustomCharacteristic.ResetTotal.UUID = 'E863F112-079E-48FF-8F27-9C2605A29F52';
77
- inherits(CustomCharacteristic.ResetTotal, Characteristic);
78
-
79
-
80
- CustomCharacteristic.OpenDuration = function() {
81
- Characteristic.call(this, 'Open Duration', CustomCharacteristic.OpenDuration.UUID);
82
- this.setProps({
83
- format: Characteristic.Formats.UINT32,
84
- unit: "seconds",
85
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY, Characteristic.Perms.WRITE]
86
- });
87
- this.value = this.getDefaultValue();
88
- };
89
- CustomCharacteristic.OpenDuration.UUID = 'E863F118-079E-48FF-8F27-9C2605A29F52';
90
- inherits(CustomCharacteristic.OpenDuration, Characteristic);
91
-
92
- CustomCharacteristic.ClosedDuration = function() {
93
- Characteristic.call(this, 'Closed Duration', CustomCharacteristic.ClosedDuration.UUID);
94
- this.setProps({
95
- format: Characteristic.Formats.UINT32,
96
- unit: "seconds",
97
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY, Characteristic.Perms.WRITE]
98
- });
99
- this.value = this.getDefaultValue();
100
- };
101
- CustomCharacteristic.ClosedDuration.UUID = 'E863F119-079E-48FF-8F27-9C2605A29F52';
102
- inherits(CustomCharacteristic.ClosedDuration, Characteristic);
103
-
104
- CustomCharacteristic.TimesOpened = function() {
105
- Characteristic.call(this, 'Times Opened', CustomCharacteristic.TimesOpened.UUID);
106
- this.setProps({
107
- format: Characteristic.Formats.UINT32,
108
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
109
- });
110
- this.value = this.getDefaultValue();
111
- };
112
- CustomCharacteristic.TimesOpened.UUID = 'E863F129-079E-48FF-8F27-9C2605A29F52';
113
- inherits(CustomCharacteristic.TimesOpened, Characteristic);
114
-
115
- CustomCharacteristic.AtmosphericPressureLevel = function() {
116
- Characteristic.call(this, 'Air Pressure', CustomCharacteristic.AtmosphericPressureLevel.UUID);
117
- this.setProps({
118
- format: Characteristic.Formats.UINT16,
119
- unit: "mbar",
120
- minValue: 700,
121
- maxValue: 1200,
122
- minStep: 1,
123
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
124
- });
125
- this.value = this.getDefaultValue();
126
- };
127
- CustomCharacteristic.AtmosphericPressureLevel.UUID = 'E863F10F-079E-48FF-8F27-9C2605A29F52';
128
- inherits(CustomCharacteristic.AtmosphericPressureLevel, Characteristic);
129
-
130
-
131
- // courtesy of https://github.com/robi-van-kinobi/homebridge-cubesensors
132
- CustomCharacteristic.AtmosphericPressureSensor = function(displayName, subtype) {
133
- Service.call(this, displayName, CustomCharacteristic.AtmosphericPressureSensor.UUID, subtype);
134
-
135
- // Required Characteristics
136
- this.addCharacteristic(CustomCharacteristic.AtmosphericPressureLevel);
137
-
138
- // Optional Characteristics
139
- this.addOptionalCharacteristic(Characteristic.StatusActive);
140
- this.addOptionalCharacteristic(Characteristic.StatusFault);
141
- this.addOptionalCharacteristic(Characteristic.StatusLowBattery);
142
- this.addOptionalCharacteristic(Characteristic.StatusTampered);
143
- this.addOptionalCharacteristic(Characteristic.Name);
144
- };
145
- CustomCharacteristic.AtmosphericPressureSensor.UUID = 'B77831FD-D66A-46A4-B66D-FD7EE8DFE3CE';
146
- inherits(CustomCharacteristic.AtmosphericPressureSensor, Service);
147
-
148
- CustomCharacteristic.ValvePosition = function() {
149
- Characteristic.call(this, 'Valve position', 'E863F12E-079E-48FF-8F27-9C2605A29F52');
150
- this.setProps({
151
- format: Characteristic.Formats.UINT8,
152
- unit: Characteristic.Units.PERCENTAGE,
153
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
154
- });
155
- this.value = this.getDefaultValue();
156
- };
157
- inherits(CustomCharacteristic.ValvePosition, Characteristic);
158
-
159
- CustomCharacteristic.ProgramCommand = function() {
160
- Characteristic.call(this, 'Program command', 'E863F12C-079E-48FF-8F27-9C2605A29F52');
161
- this.setProps({
162
- format: Characteristic.Formats.DATA,
163
- perms: [Characteristic.Perms.WRITE, Characteristic.Perms.NOTIFY]
164
- });
165
- this.value = this.getDefaultValue();
166
- };
167
- inherits(CustomCharacteristic.ProgramCommand, Characteristic);
168
-
169
- CustomCharacteristic.ProgramData = function() {
170
- Characteristic.call(this, 'Program data', 'E863F12F-079E-48FF-8F27-9C2605A29F52');
171
- this.setProps({
172
- format: Characteristic.Formats.DATA,
173
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY]
174
- });
175
- this.value = this.getDefaultValue();
176
- };
177
- inherits(CustomCharacteristic.ProgramData, Characteristic);
178
-
179
-
180
- return CustomCharacteristic;
181
- };
@@ -1 +0,0 @@
1
- [{"component":"HomebridgeStatusWidgetComponent","x":0,"y":7,"cols":5,"rows":7,"mobileOrder":10,"hidePort":true,"hideOnMobile":false,"draggable":true},{"component":"ChildBridgeWidgetComponent","x":15,"y":9,"cols":5,"rows":5,"mobileOrder":35,"hideOnMobile":false,"draggable":true},{"component":"CpuWidgetComponent","x":5,"y":8,"cols":5,"rows":3,"mobileOrder":40,"hideOnMobile":false,"draggable":true},{"component":"MemoryWidgetComponent","x":5,"y":11,"cols":5,"rows":3,"mobileOrder":50,"hideOnMobile":false,"draggable":true},{"component":"NetworkWidgetComponent","x":10,"y":11,"cols":5,"rows":3,"mobileOrder":55,"hideOnMobile":false,"draggable":true},{"component":"UptimeWidgetComponent","x":10,"y":8,"cols":5,"rows":3,"mobileOrder":60,"hideOnMobile":false,"draggable":true},{"component":"SystemInfoWidgetComponent","x":15,"y":0,"cols":5,"rows":9,"mobileOrder":70,"hideOnMobile":false,"draggable":true},{"component":"HapQrcodeWidgetComponent","x":0,"y":0,"cols":5,"rows":7,"mobileOrder":100,"hideOnMobile":false,"draggable":true},{"component":"HomebridgeLogsWidgetComponent","x":5,"y":0,"cols":10,"rows":8,"mobileOrder":1000,"hideOnMobile":true,"draggable":true}]
@@ -1 +0,0 @@
1
- {"secretKey":"de1a0f965770285a6dec91739fc725a91d6e0cb91a4aaae8116e8f140d44edc3"}
@@ -1,10 +0,0 @@
1
- [
2
- {
3
- "id": 1,
4
- "username": "test",
5
- "name": "test",
6
- "hashedPassword": "df121e72b850a058bd68f3d05b1f94dc985821a3885b5da38e263654f29843f98bb6d8e594f6042ff871a424602a9bff50dffa97f258bdc1dca4c79e87bac20c",
7
- "salt": "64085e70da64670349f042d4c3d3cac75b20233ffeb71db68399973f60da077d",
8
- "admin": true
9
- }
10
- ]
@@ -1,46 +0,0 @@
1
- {
2
- "bridge": {
3
- "name": "Heisenberg",
4
- "username": "AA:BB:CC:DD:EE:01",
5
- "port": 51826,
6
- "pin": "031-45-154"
7
- },
8
- "description": "HomeBridge HTTP Status Control",
9
- "plugins": [
10
- "homebridge-rtl",
11
- "homebridge-config-ui-x"
12
- ],
13
- "platforms": [
14
- {
15
- "name": "Config",
16
- "port": 8581,
17
- "auth": "none",
18
- "theme": "auto",
19
- "tempUnits": "c",
20
- "lang": "auto",
21
- "sudo": false,
22
- "platform": "config"
23
- },
24
- {
25
- "platform": "rtl_433",
26
- "devices": [
27
- {
28
- "id": "1e3e8",
29
- "name": "Front Porch",
30
- "type": "motion"
31
- },
32
- {
33
- "id": "92",
34
- "name": "Outside temperature",
35
- "type": "temperature"
36
- },
37
- {
38
- "id": "834551",
39
- "name": "Front Door Sensor",
40
- "type": "contact"
41
- }
42
- ]
43
- }
44
- ],
45
- "accessories": []
46
- }