mvdwetering / huesyncbox

Custom integration for Home Assistant to control the Philips Hue Play HDMI Sync Box 4K or 8K
Apache License 2.0
113 stars 8 forks source link

Update entity descriptions #85

Closed mvdwetering closed 6 months ago

mvdwetering commented 6 months ago

Update entity descriptions as documented in the dev blogpost https://developers.home-assistant.io/blog/2023/12/11/entity-description-changes/

Summary by CodeRabbit

coderabbitai[bot] commented 6 months ago

Walkthrough

The update involves enhancing data integrity and consistency across several components by modifying the @dataclass decorator. Specifically, the classes for number, select, and sensor entities in the Hue Sync Box integration now require keyword-only arguments and are immutable, improving code maintainability and safety.

Changes

Files Change Summary
.../huesyncbox/number.py, select.py, sensor.py Added frozen=True, kw_only=True to @dataclass for HueSyncBoxNumberEntityDescription, HueSyncBoxSelectEntityDescription, HueSyncBoxSensorEntityDescription.

🐇✨ In the land of code, where the bits align, A rabbit hopped past, leaving changes so fine. With a flick and a hop, structures now firm, "Immutable fields!", it decreed with a squirm. Keyword args only, in data's own lair, Ensuring that chaos will not dare to flare. 🌟 🐇✨


Recent Review Details **Configuration used: CodeRabbit UI**
Commits Files that changed from the base of the PR and between 214adff3a750de6717a5a8343d0c218221ead6d3 and 25d2c9a427ee837822b77a26c983d4d14b8d3919.
Files selected for processing (3) * custom_components/huesyncbox/number.py (1 hunks) * custom_components/huesyncbox/select.py (1 hunks) * custom_components/huesyncbox/sensor.py (1 hunks)
Additional Context Used
Ruff (33)
custom_components/huesyncbox/number.py (8)
1-1: Missing docstring in public module --- 2-2: Import from `collections.abc` instead: `Callable`, `Coroutine` --- 19-19: Missing docstring in public class --- 24-24: Missing docstring in public function --- 46-46: Missing docstring in public function --- 58-58: Missing docstring in public class --- 81-81: Missing docstring in public method --- 84-84: Missing docstring in public method
custom_components/huesyncbox/select.py (18)
1-1: Missing docstring in public module --- 2-2: Import from `collections.abc` instead: `Callable`, `Coroutine` --- 25-25: Missing docstring in public class --- 31-31: Missing docstring in public class --- 36-36: First line should end with a period --- 36-36: First line should end with a period, question mark, or exclamation point --- 43-43: Missing docstring in public function --- 51-51: Missing docstring in public function --- 57-57: Missing docstring in public function --- 65-65: Missing docstring in public function --- 66-66: Unnecessary `map` usage (rewrite using a generator expression) --- 69-69: Missing docstring in public function --- 85-85: Missing docstring in public function --- 92-92: Missing docstring in public function --- 106-106: Missing docstring in public function --- 115-115: Missing docstring in public function --- 164-164: Missing docstring in public function --- 208-208: Missing docstring in public method
custom_components/huesyncbox/sensor.py (7)
1-1: Missing docstring in public module --- 2-2: Import from `collections.abc` instead: `Callable` --- 19-19: Missing docstring in public class --- 107-107: Missing docstring in public function --- 116-116: Do not use bare `except` --- 123-123: Missing docstring in public class --- 146-146: Missing docstring in public method
Additional comments not posted (3)
custom_components/huesyncbox/number.py (1)
`18-18`: Ensure the immutability and keyword-only argument enforcement by setting `frozen=True, kw_only=True` in the `@dataclass` decorator.
custom_components/huesyncbox/sensor.py (1)
`18-18`: Ensure the immutability and keyword-only argument enforcement by setting `frozen=True, kw_only=True` in the `@dataclass` decorator.
custom_components/huesyncbox/select.py (1)
`24-24`: Ensure the immutability and keyword-only argument enforcement by setting `frozen=True, kw_only=True` in the `@dataclass` decorator.
---
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.