Make model name matching more robust.#107
Open
benprisby wants to merge 2 commits intoRaresAil:masterfrom
Open
Conversation
This was referenced Jan 18, 2025
Owner
|
Looks good, but it will affect other models, like this one for example, #51 some devices have C302S others 302S but in the end between those 2, are the same |
Author
|
Thanks for the additional info. I've extended the match logic to account for this case. It only applies for names that do not already have a letter prefix to limit the scope. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As others have reported, I noticed integration with my Vital 200S air purifier was not working as expected with this plugin. Upon debugging, the model name matching behavior was incorrectly characterizing the Vital 200S as a Core 201S because the Core 201S name
201Sis a substring of the Vital 200S oneV201Sand is checked first. This resulted in incorrect configuration and missing information like air quality and certain controls within the Apple Home app.Rather than checking if the device names are just substrings of the model strings reported by the VeSync API, a simple regex is used to ensure the name is a whole word within the model string. This ensures that:
I've tested this locally with my Vital 100S and 200S air purifiers and confirmed the 200S missing information is now populated while not breaking the 100S.
Thanks for the fantastic work on this plugin!