lib/devices/gateway.js
function generateKey() {
	let result = '';
	for(let i=0; i<16; i++) {
		let idx = Math.floor(Math.random() * CHARS.length);
		result += CHARS[idx];
	}
	return result;
}
function generateKey() {
	let result = '';
	for(let i=0; i<16; i++) {
		let idx = Math.floor(Math.random() * CHARS.length);
		result += CHARS[idx];
	}
	return result;
}
function generateKey ( ) { let result = '' ; for ( let i = 0 ; i < 16 ; i ++ ) { let idx = Math . floor ( Math . random ( ) * CHARS . length ) ; result += CHARS [ idx ] ; } return result ; }
Generate a key for use with the local developer API. This does not generate
a secure key, but the Mi Home app does not seem to do that either.
Generate a key for use with the local developer API . This does not generate a secure key but the Mi Home app does not seem to do that either .