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

Cleanup: Formatting, Type Safety & Annotations, Deduplications #34

Merged
merged 11 commits into from
Mar 5, 2025

Conversation

Flight-Lab
Copy link
Owner

No description provided.

…es.py

Refactored error classes in errors.py to import the ApiError data class from types.py instead of redefining it. This change eliminates code duplication and ensures a single source of truth for the ApiError definition.
Add comprehensive type annotations to constants and collections throughout const.py:
- Import and use Platform enum from homeassistant.const instead of string literals
- Add proper type hints for all sensor lists and mappings
- Use Final from typing module to ensure constants remain immutable
- Maintain specific type imports from types.py for domain-specific types

These changes improve type safety, IDE autocompletion, and static analysis 
capabilities without modifying actual functionality.
- Add proper type annotations for collections (list, dict) in const.py
- Import specific type definitions from types.py (DataSectionType, TimezoneType, UnitSystemType)
- Use inline type annotations for standard collections
- Fix missing type annotation on OCEAN_CURRENT_SENSORS
- Improve code readability and type safety for static analysis
… type definitions

- Add a new CompositeSensorGroupsType TypedDict for defining relationships between
composite sensors such as wind and current measurements
- Ensure the ApiError dataclass is properly defined for centralized error
handling across the integration
@Flight-Lab Flight-Lab merged commit 93c2734 into main Mar 5, 2025
2 checks passed
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