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

Refactor batteries library to allow multiple definitions for model #88

Closed
3 tasks done
codyc1515 opened this issue Dec 18, 2023 · 3 comments
Closed
3 tasks done
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@codyc1515
Copy link
Contributor

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.

The definitions library of batteries is blowing out in size. I observed that some of my devices are already in that file but were not auto-detected simply due to differences in how different integrations, i.e. ZHA vs. Zigbee2MQTT, present models and manufacturers.

Describe the solution you'd like

Allow for one, or more, models and manufacturers against each key in the libraries definition file, e.g.

{
	"manufacturer": [
		"Xiaomi",
		"Aqara"
	],
	"model": [
		"Aqara human body movement and illuminance sensor (RTCGQ11LM)",
		"RTCGQ11LM"
	],
	"battery_type": "CR2450"
}

Or some similar format.

Describe alternatives you've considered

We could simply keep adding to the database but it's going to grow larger and more unmanageable over time, especially so if there were to say be a dropdown selection of models in the future to maybe choose from.

Additional context

.

@klaptafel
Copy link
Contributor

klaptafel commented Dec 18, 2023

This would work for Philips / Signify Netherlands B.V. and IKEA / IKEA of Sweden devices too.

@codyc1515
Copy link
Contributor Author

Xiaomi and Aqara would be another similar pairing.

@andrew-codechimp
Copy link
Owner

This is something I've been thinking about as well but at the moment I'm not going to implement.

The library is under 30kb so no issues on performance yet.

The schema is complex enough for many to edit and I'm regularly adding missing commas, brackets etc. Adding array's will make my maintenance a lot harder. The json validator catches things but I don't want to be hard and reject submissions as I want to grow the library rather than having people lose interest.

I may implement a GitHub Issues form to submit new devices, this wouldn't be able to handle arrays.

I may change my mind in future though :)

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

No branches or pull requests

3 participants