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

feat: redesign library api #99

Merged
merged 20 commits into from
Jan 22, 2024
Merged

feat: redesign library api #99

merged 20 commits into from
Jan 22, 2024

Conversation

EuleMitKeule
Copy link
Contributor

@EuleMitKeule EuleMitKeule commented Jan 20, 2024

This PR introduces the following changes:

  • Add Type hints for all functions and parameters
  • Unify BleakConnection and Thermostat
  • Remove homeassistant dependency from eq3btsmart
  • Simplify API for Thermostat
  • Add bluetooth device logic to integration
  • Improve handling of connection issues in integration and library
  • Prevent disconnects by using a smaller scan interval
  • Add dataclass models for configuration
  • Add structs for device commands
  • Add connection monitor for reconnect logic
  • Refactor structs to typed dataclasses
  • Remove logs from library for now
  • Use builtin type subclasses for data parsing logic

@dbuezas
Copy link
Owner

dbuezas commented Jan 20, 2024

Holy... You really want to be on each line of git blame 😆
Looking forward to see the finished code

@EuleMitKeule
Copy link
Contributor Author

Yeah, I might have went a bit overboard on some of the refactorings, but I felt some changes were necessary to improve overall quality and readability of the code. Also some minor features that were previously present are missing right now and not everything is 100% working and tested, so this will take a bit more work.
I have already tested it in Home Assistant and at least with Adapter set to AUTO and using my bluetooth proxy it seems to still behave as expected.

@dbuezas
Copy link
Owner

dbuezas commented Jan 20, 2024

Cool, I also get the same feeling with other's people code. But python isn't the language I use the moat, so I may have diverged from the python ways

@EuleMitKeule EuleMitKeule marked this pull request as ready for review January 22, 2024 23:11
@EuleMitKeule EuleMitKeule merged commit b5a12ad into develop Jan 22, 2024
3 checks passed
@EuleMitKeule EuleMitKeule deleted the refactor-code-style branch January 22, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants