Closed mvdwetering closed 6 months ago
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.
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. 🌟 🐇✨
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 methodcustom_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 methodcustom_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
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.
Update entity descriptions as documented in the dev blogpost https://developers.home-assistant.io/blog/2023/12/11/entity-description-changes/
Summary by CodeRabbit