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

Change Description dataclasses to frozen #730

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Apr 9, 2024

Description

SSIA

Motivation and Context

Improve typing and fix some issues.

How has this been tested?

--

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Comment on lines 138 to +140
async def async_turn_on(self, **_kwargs: Any) -> None:
"""Turn the entity on."""
await self.entity_description.set_fn(self._cloud, enabled=True)
await self.entity_description.set_fn(self._cloud, True) # noqa: FBT003
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With enabled this results in an call-arg error. set_fn is only typed as a Callback. The alternative would be to use a callback protocol which would allow for named arguments.

.../cloud/switch.py:140: error: Unexpected keyword argument "enabled"  [call-arg]

Copy link
Owner

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @cdce8p 👍

../Frenck

@frenck frenck added the enhancement Enhancement of the code, not introducing new features. label Apr 23, 2024
@frenck frenck merged commit 0d8bd7e into frenck:main Apr 23, 2024
6 of 7 checks passed
@cdce8p cdce8p deleted the description-frozen branch April 23, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants