Don’t ping in Xiaomi extension when device availability is enabled. #1248

This commit is contained in:
Koen Kanters 2019-03-24 14:46:38 +01:00
parent 40596bab6a
commit 20d9bac317

View File

@ -1,5 +1,7 @@
const utils = require('../util/utils');
const interval = utils.secondsToMilliseconds(60);
const logger = require('../util/logger');
const settings = require('../util/settings');
/**
* This extensions handles Xiaomi devices.
@ -28,7 +30,14 @@ class Xiaomi {
}
});
this.startTimer();
/**
* Device availability already pings Xiaomi devices.
*/
if (!settings.get().advanced.availability_timeout) {
this.startTimer();
} else {
logger.debug('Disabled pinging of Xiaomi devices in Xiaomi extension because availability is enabled');
}
}
startTimer() {