Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match device model via regex/substring #1280

Closed
3 tasks done
AlexxIT opened this issue Mar 11, 2024 · 2 comments
Closed
3 tasks done

Match device model via regex/substring #1280

AlexxIT opened this issue Mar 11, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@AlexxIT
Copy link

AlexxIT commented Mar 11, 2024

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'm developer of integration with a lot of battery devices:
#472

I'm thinking about changing model name template. For example:

  • from zigbee WSDCGQ01LM (lumi.sensor_ht) to Zigbee: WSDCGQ01LM, lumi.sensor_ht
  • from ble CGD1 to BLE: CGD1, cgllc.clock.dove

So all your matching will be broken. Also library has a lot of duplicates:

        {
            "manufacturer": "Xiaomi",
            "model": "MiJia temperature & humidity sensor (WSDCGQ01LM)",
            "battery_type": "CR2032"
        },
        {
            "manufacturer": "Xiaomi",
            "model": "WSDCGQ01LM",
            "battery_type": "CR2032"
        }
        {
            "manufacturer": "Xiaomi",
            "model": "zigbee WSDCGQ01LM (lumi.sensor_ht)",
            "battery_type": "CR2032"
        }

Describe the solution you'd like

I think in some cases will be enough by matching only market model (re.match(r"\bWSDCGQ01LM\b") inside model string.

Describe alternatives you've considered

Additional context

@andrew-codechimp andrew-codechimp added the enhancement New feature or request label Mar 12, 2024
@andrew-codechimp
Copy link
Owner

Thanks for the context, a regex in these situations seems useful, I'll just have to think about any impacts but will add it to my list.

@andrew-codechimp andrew-codechimp added wontfix This will not be worked on and removed enhancement New feature or request labels Jun 14, 2024
@andrew-codechimp
Copy link
Owner

As there has been very few scenarios where this will prove useful it's too much overhead/testing where a few duplicate entries would not cause issues so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants