Don't call "miio.info" when a model was provided #215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #162.
The issue was that when you use a rooted vacuum with disabled access to the xiaomi cloud, a call to
miio.info
would fail. This PR checks if a model was provided via the options parameter already and if it was, skips the info enrichment.You can test if this fix works for you aswell by providing the model in your options:
const device = await miio.device({ address: 'vacuum ip', token: 'vacuum token', model: 'rockrobo.vacuum.v1' })