mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 05:24:29 +00:00
Merge branch 'dev' of https://github.com/Koenkk/zigbee2mqtt into dev
This commit is contained in:
+6
-2
@@ -10,6 +10,10 @@
|
||||
"rules": {
|
||||
"require-jsdoc": "off",
|
||||
"indent": ["error", 4],
|
||||
"max-len": ["error", { "code": 120 }]
|
||||
}
|
||||
"max-len": ["error", { "code": 120 }],
|
||||
"mocha/no-exclusive-tests": "error"
|
||||
},
|
||||
"plugins": [
|
||||
"mocha"
|
||||
]
|
||||
}
|
||||
|
||||
+3
-2
@@ -11,11 +11,12 @@ node_js:
|
||||
install:
|
||||
- npm install
|
||||
|
||||
script:
|
||||
before_script:
|
||||
- npm test
|
||||
- npm run verify-homeassistant-mapping
|
||||
- npm run eslint
|
||||
|
||||
after_success:
|
||||
script:
|
||||
- ".travis/docker.sh"
|
||||
- ".travis/wiki.sh"
|
||||
- ".travis/trigger-downstream.sh"
|
||||
|
||||
@@ -304,6 +304,7 @@ const mapping = {
|
||||
'ZLED-2709': [configurations.light_brightness],
|
||||
'8718696548738': [configurations.light_brightness_colortemp],
|
||||
'4052899926110': [configurations.light_brightness_colortemp_xy],
|
||||
'Z01-CIA19NAE26': [configurations.light_brightness],
|
||||
};
|
||||
|
||||
// A map of all discoverd devices
|
||||
|
||||
Generated
+3172
-743
File diff suppressed because it is too large
Load Diff
+20
-12
@@ -17,10 +17,12 @@
|
||||
"cc2531"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"coverage": "nyc --all report --reporter=text mocha --recursive --timeout=3000",
|
||||
"docgen": "node support/docgen.js",
|
||||
"verify-homeassistant-mapping": "node support/verify-homeassistant-mapping.js",
|
||||
"eslint": "node_modules/.bin/eslint ."
|
||||
"eslint": "node_modules/.bin/eslint .",
|
||||
"start": "node index.js",
|
||||
"test": "mocha --recursive",
|
||||
"verify-homeassistant-mapping": "node support/verify-homeassistant-mapping.js"
|
||||
},
|
||||
"author": "Koen Kanters",
|
||||
"license": "GPL-3.0",
|
||||
@@ -29,18 +31,24 @@
|
||||
},
|
||||
"homepage": "https://github.com/Koenkk/zigbee2mqtt/wiki",
|
||||
"dependencies": {
|
||||
"object-assign-deep": "*",
|
||||
"mqtt": "*",
|
||||
"winston": "2.4.2",
|
||||
"zigbee-shepherd": "git+https://github.com/Koenkk/zigbee-shepherd.git#7673fc5a285dc93d2e466bc2aa7134220e1fb134",
|
||||
"zigbee-shepherd-converters": "*",
|
||||
"json2yaml": "*",
|
||||
"zcl-packet": "git+https://github.com/Koenkk/zcl-packet.git#b7d5b4478a88cd3fc65328c6dc94572c277c7d3e",
|
||||
"git-last-commit": "*",
|
||||
"js-yaml": "*",
|
||||
"git-last-commit": "*"
|
||||
"json2yaml": "*",
|
||||
"mqtt": "*",
|
||||
"object-assign-deep": "*",
|
||||
"winston": "2.4.2",
|
||||
"zcl-packet": "git+https://github.com/Koenkk/zcl-packet.git#b7d5b4478a88cd3fc65328c6dc94572c277c7d3e",
|
||||
"zigbee-shepherd": "git+https://github.com/Koenkk/zigbee-shepherd.git#7673fc5a285dc93d2e466bc2aa7134220e1fb134",
|
||||
"zigbee-shepherd-converters": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "*",
|
||||
"chai-spies": "*",
|
||||
"eslint": "*",
|
||||
"eslint-config-google": "*"
|
||||
"eslint-config-google": "*",
|
||||
"eslint-plugin-mocha": "*",
|
||||
"mocha": "*",
|
||||
"nyc": "*",
|
||||
"proxyquire": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/* global describe, it */
|
||||
|
||||
const chai = require('chai');
|
||||
const proxyquire = require('proxyquire').noPreserveCache();
|
||||
const data = () => proxyquire('../lib/util/data.js', {});
|
||||
const path = require('path');
|
||||
|
||||
describe('Data', () => {
|
||||
describe('Get path', () => {
|
||||
it('Should return correct path', () => {
|
||||
const expected = path.normalize(path.join(__dirname, '..', 'data'));
|
||||
const actual = data().getPath();
|
||||
chai.assert.strictEqual(actual, expected);
|
||||
});
|
||||
|
||||
it('Should return correct path when ZIGBEE2MQTT_DATA set', () => {
|
||||
const expected = path.join('var', 'zigbee2mqtt');
|
||||
process.env.ZIGBEE2MQTT_DATA = expected;
|
||||
const actual = data().getPath();
|
||||
chai.assert.strictEqual(actual, expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user