Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fabienduval
Copy link
Contributor

@fabienduval fabienduval commented May 8, 2025

Summary by Sourcery

Add fixtures for several modules.

Tests:

  • Increase the number of tracked modules and rooms in home test

Summary by Sourcery

Add more test fixtures for home module to increase test coverage

New Features:

  • Added DeviceType.NLPD to the set of tracked device types

Tests:

  • Expanded test fixtures to include additional device types and increase the number of tracked rooms and modules

@fabienduval fabienduval requested review from cgtobi and jabesq as code owners May 8, 2025 20:17
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 8, 2025

Reviewer's Guide

This pull request updates the test_async_home test by adding support for a new device type (DeviceType.NLPD), which involved increasing the expected number of rooms and modules. Corresponding fixture files (homesdata.json and homestatus_91763b24c43d3e344f424e8b.json) were also modified to align with these test adjustments.

File-Level Changes

Change Details Files
Updated home tests by adding a new device type and adjusting assertions for room and module counts.
  • Added DeviceType.NLPD to the set of device types.
  • Increased the expected room count from 8 to 9.
  • Increased the expected module count from 40 to 51.
tests/test_home.py
Modified fixture files to support the updated test expectations.
  • Updated homesdata.json with new fixture data.
  • Updated homestatus_91763b24c43d3e344f424e8b.json with new fixture data.
fixtures/homesdata.json
fixtures/homestatus_91763b24c43d3e344f424e8b.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@fabienduval fabienduval changed the title Tests: add fixtures for several modules. Draft: Tests: add fixtures for several modules. May 8, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @fabienduval - I've reviewed your changes - here's some feedback:

  • Update the PR title to accurately reflect the substantial refactoring of module classifications, not just fixture additions.
  • Multiple modules have had capability-defining mixins (e.g., RfMixin, SwitchMixin, DimmableMixin) removed; confirm these changes accurately reflect their intended functionality.
  • Verify if DeviceType.NLD should remain uncategorized after its DeviceCategory mapping was removed.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

DeviceType.NIS,
DeviceType.NBO,
DeviceType.NPC,
DeviceType.NLPD,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Consider adding specific assertions for NLPD module instances.

Rather than just checking that DeviceType.NLPD is in expected_types, fetch an NLPD instance from async_home.modules (via your new fixtures) and assert its key attributes or state. This verifies not only recognition but also correct parsing and representation of its data.

@fabienduval fabienduval marked this pull request as draft May 8, 2025 20:42
@fabienduval fabienduval force-pushed the fduval_nld branch 2 times, most recently from a5c2c44 to 65bf5e6 Compare May 8, 2025 20:52
Copy link
Collaborator

@cgtobi cgtobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you for your contribution @fabienduval

@fabienduval fabienduval marked this pull request as ready for review May 9, 2025 13:21
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @fabienduval - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@cgtobi
Copy link
Collaborator

cgtobi commented May 9, 2025

This PR needs to be rebased before it can be merged.

@fabienduval fabienduval changed the title Draft: Tests: add fixtures for several modules. Tests: add fixtures for several modules. May 11, 2025
@jabesq jabesq merged commit a3fd978 into jabesq-org:development May 11, 2025
5 checks passed
@fabienduval fabienduval deleted the fduval_nld branch May 11, 2025 20:07
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.

3 participants