mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 22:11:22 +00:00
Log zigbee2mqtt version information to bridge/config (#1267)
* add coordinator_firmware to bridge/config * Add zigbee2mqtt version and commit * Whoops
This commit is contained in:
1 parent
1043053812
commit
a2a90bcdbd
4 files changed
+43
-26
No files matched your search
@@ -67,6 +67,28 @@ function getEndpointByEntityID(zigbee, entityID, epName) {
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
function getZigbee2mqttVersion(callback) {
|
||||
const git = require('git-last-commit');
|
||||
const packageJSON = require('../../package.json');
|
||||
const version = packageJSON.version;
|
||||
|
||||
git.getLastCommit((err, commit) => {
|
||||
let commitHash = null;
|
||||
|
||||
if (err) {
|
||||
try {
|
||||
commitHash = require('../.hash.json').hash;
|
||||
} catch (error) {
|
||||
commitHash = 'unknown';
|
||||
}
|
||||
} else {
|
||||
commitHash = commit.shortHash;
|
||||
}
|
||||
|
||||
callback({commitHash, version});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
millisecondsToSeconds: (milliseconds) => milliseconds / 1000,
|
||||
secondsToMilliseconds: (seconds) => seconds * 1000,
|
||||
@@ -76,4 +98,5 @@ module.exports = {
|
||||
toLocalISOString: (dDate) => toLocalISOString(dDate),
|
||||
getPostfixes: () => postfixes,
|
||||
getEndpointByEntityID,
|
||||
getZigbee2mqttVersion,
|
||||
};
|
||||
Reference in new issue
Block a user