diff --git a/lib/miflora.js b/lib/miflora.js index 27750a7..23148a8 100644 --- a/lib/miflora.js +++ b/lib/miflora.js @@ -39,7 +39,12 @@ class MiFlora { const optDuration = getOpt(options, 'duration', 10000); const optAddresses = getOpt(options, 'addresses', []); const optIgnoreUnknown = getOpt(options, 'ignoreUnknown', false); - + const clearDevices = getOpt(options, 'clearDevices', false); + + if (clearDevices) { + this._devices = {}; + } + if (Number.isNaN(optDuration)) { throw new TypeError('argument [duration] must be a number'); }