Skip to content

v2.0.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@henne49 henne49 released this 15 Dec 05:38
· 3 commits to main since this release
76a10ea

📌 Refactor & Enhance dbus-opendtu

Hi Team! 👋

This release introduces a series of improvements and refactorings to the dbus-opendtu project. The main highlights include enhanced code readability, better testing coverage, and streamlined business logic. Here’s a detailed breakdown:

Main Changes:

  • 🧪 Added Unit Tests:

    • Implemented unit tests for core functionalities.
    • Mocked requests.get to simulate different responses for robust testing scenarios.
    • Configured different test scenarios for comprehensive test coverage.
  • 🔄 Business Logic Updates:

    • Refactored the main Python file for better readability.
    • Centralized update triggers to avoid service-based updates for a more modular design.

🔧 Refactoring Highlights:

  • 📂 Code Structure:

    • Renamed and refactored dbus-opendtu for improved readability and maintainability.
    • Cleaned up test_dbus-opendtu.py by removing unused parameters and constants.
    • Moved constants to appropriate modules for better code organization.
    • Improved import structure for clarity and consistency.
  • 🛠️ Code Simplification:

    • Consolidated redundant code and removed unused paths in the DbusService constructor.
    • Updated logging statements for better traceability.
    • Unified file naming convention to use underscores (_) instead of hyphens (-).
    • Shifted utility functions to helper modules and included unit tests to boost test coverage.
    • Refactored _get_serial, _get_name, and _get_status_url methods for better encapsulation and readability.

🚀 Enhancements:

  • 📝 Test Coverage:

    • Achieved 66% code coverage with a focus on critical paths.
    • Added template and inverter-specific tests to cover more edge cases.
    • Adjusted ahoy_0.5.93_live.json to reflect new test configurations.
    • Relocated tests to the appropriate folder structure for clearer organization.
  • 🔍 Code Quality:

    • Replaced hardcoded values with constants to enhance maintainability.
    • Configured test coverage tools and scripts to ensure ongoing code quality.

image

🙋‍♂️ Request for Support:

I could use your help to push the project towards 100% code coverage. It's a time-consuming task, so any support would be appreciated! If you can contribute by adding tests or enhancing existing ones, that would be fantastic. Let's aim for perfection together! 🚀


Thanks for reviewing! 😊 Feel free to comment or provide feedback.

What's Changed

Full Changelog: v1.2.40...v2.0.0

What's Changed

Full Changelog: v1.2.40...v2.0.0