diff --git a/lib/extension/xiaomi.js b/lib/extension/xiaomi.js index 17a14b4a..539cb720 100644 --- a/lib/extension/xiaomi.js +++ b/lib/extension/xiaomi.js @@ -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() {