mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-23 22:32:40 +00:00
Add support for version numbers and hash
This commit is contained in:
1 parent
3591f4f976
commit
b6aabcca64
3 files changed
+15
-2
No files matched your search
+2
-1
@@ -60,4 +60,5 @@ typings/
|
||||
# data
|
||||
data/database.db
|
||||
data/config.json
|
||||
data/log*.txt
|
||||
data/log*.txt
|
||||
data/hash.json
|
||||
+10
-1
@@ -5,7 +5,15 @@ const settings = require('./util/settings');
|
||||
const zigbeeShepherdConverters = require('zigbee-shepherd-converters');
|
||||
const homeassistant = require('./homeassistant');
|
||||
const objectAssignDeep = require(`object-assign-deep`);
|
||||
|
||||
const data = require('./util/data');
|
||||
const pjson = require('../package.json');
|
||||
let version = `${pjson.version}`;
|
||||
try {
|
||||
const hjson = require(data.joinPath('hash.json')).id;
|
||||
version = version + `:${hjson}`;
|
||||
} catch (error) {
|
||||
logger.debug('Error parsing git hash version', error);
|
||||
}
|
||||
const mqttConfigRegex = new RegExp(`${settings.get().mqtt.base_topic}/bridge/config/\\w+`, 'g');
|
||||
const mqttDeviceRegex = new RegExp(`${settings.get().mqtt.base_topic}/[\\w\\s\\d]+/set`, 'g');
|
||||
const mqttDevicePrefixRegex = new RegExp(`${settings.get().mqtt.base_topic}/[\\w\\s\\d]+/[\\w\\s\\d]+/set`, 'g');
|
||||
@@ -39,6 +47,7 @@ class Controller {
|
||||
}
|
||||
|
||||
start() {
|
||||
logger.info(`Starting ... ${version}`);
|
||||
this.zigbee.start(this.handleZigbeeMessage, (error) => {
|
||||
if (error) {
|
||||
logger.error('Failed to start');
|
||||
|
||||
Reference in new issue
Block a user