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

Clean up #479

Merged
merged 1 commit into from
Dec 15, 2023
Merged

Clean up #479

merged 1 commit into from
Dec 15, 2023

Conversation

cgtobi
Copy link
Collaborator

@cgtobi cgtobi commented Dec 15, 2023

No description provided.

@cgtobi cgtobi requested a review from jabesq as a code owner December 15, 2023 10:27
@cgtobi cgtobi merged commit f5c90f5 into development Dec 15, 2023
5 checks passed
@cgtobi cgtobi deleted the cleanup branch December 15, 2023 10:27
Copy link

@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.

PR Type: Refactoring

PR Summary: The pull request introduces a change in the 'fix_id' function within the 'helpers.py' module. It modifies the condition that checks for the presence of the '_id' key in a dictionary representing a station. The new condition uses the 'get' method to safely access the '_id' key and proceeds only if the key is not present or its value is None.

General suggestions:

  • Ensure that the change in behavior is intentional. The new condition will treat stations with '_id' explicitly set to None differently than before. If the previous behavior should be preserved, consider adjusting the condition to check for both the absence of '_id' and its value being None.
  • The PR title 'Clean up' is quite generic. It would be beneficial to provide a more descriptive title that reflects the specific nature of the changes made, such as 'Refactor _id presence check in fix_id function'.
  • A brief PR description explaining the rationale behind the change and its impact on the codebase would help reviewers understand the context and the intent of the refactoring.

Your trial expires on December 16, 2023. Please email [email protected] to continue using Sourcery ✨

@@ -19,7 +19,7 @@ def fix_id(raw_data: RawData) -> dict[str, Any]:
for station in raw_data:
if not isinstance(station, dict):
continue
if "_id" not in station:
if station.get("_id") is None:
Copy link

Choose a reason for hiding this comment

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

question (llm): The change from direct key access to using get is safer in terms of avoiding a KeyError, but it changes the behavior. Previously, if '_id' was present but set to None, it would not continue, but now it will. Ensure this behavior change is intentional and correct.

cgtobi added a commit that referenced this pull request Dec 15, 2023
* cd: Run publish-to-test-pypi only on development branch

* fix devcontainer (#468)

* Add start and end times to room class (#469)

* Remove deprecated code (#461)

* Remove deprecated code

* Remove old codeql config

* Remove unused fixture

* Minor clean up

* Refactor async_post_request

Signed-off-by: Tobias Sauerwein <[email protected]>

---------

Signed-off-by: Tobias Sauerwein <[email protected]>

* Split tests and clean up (#471)

* split tests

* clean up cruft

* Fix NLPD to provide energy readings

* Add BNLD - Bticino dimmable light

* Update readme (#472)

* Clean up somfy shutter
* Add new bticino scope
* update readme

* chore(deps): Bump actions/setup-python from 4.7.1 to 5.0.0 (#474)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.7.1...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add missing device type mapping for NIS (#476)

* Add power data to NLPD entities (#477)

* Clean up (#479)

---------

Signed-off-by: Tobias Sauerwein <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Hugo Dupras <[email protected]>
Co-authored-by: deosrc <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cgtobi added a commit that referenced this pull request Dec 20, 2023
* cd: Run publish-to-test-pypi only on development branch

* fix devcontainer (#468)

* Add start and end times to room class (#469)

* Remove deprecated code (#461)

* Remove deprecated code

* Remove old codeql config

* Remove unused fixture

* Minor clean up

* Refactor async_post_request

Signed-off-by: Tobias Sauerwein <[email protected]>

---------

Signed-off-by: Tobias Sauerwein <[email protected]>

* Split tests and clean up (#471)

* split tests

* clean up cruft

* Fix NLPD to provide energy readings

* Add BNLD - Bticino dimmable light

* Update readme (#472)

* Clean up somfy shutter
* Add new bticino scope
* update readme

* chore(deps): Bump actions/setup-python from 4.7.1 to 5.0.0 (#474)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.7.1...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add missing device type mapping for NIS (#476)

* Add power data to NLPD entities (#477)

* Clean up (#479)

* Update CHANGELOG.md

* Fix nlfe (#480)

* Add missing NLFE Legrand dimmer switch

* clean up

* Update changelog

---------

Signed-off-by: Tobias Sauerwein <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Hugo Dupras <[email protected]>
Co-authored-by: deosrc <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

1 participant