-
Notifications
You must be signed in to change notification settings - Fork 0
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
Optimize NDBC Buoy Configuration and Data Fetching #33
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…selection step Remove the manual data section selection step to streamline configuration for NDBC buoys. Automatically check all data sections during setup, then fetch data only from sections with active sensors.
…ized fetching Add constants to map sensors to their data sections for more efficient API usage. Create mappings for overlapping wave height sensors to prioritize spectral wave data over meteorological data when both are available. Add METEO_SENSORS, SPEC_WAVE_SENSORS, and OCEAN_CURRENT_SENSORS constants for better organization.
…or prioritization Add functions to deduplicate overlapping wave height sensors, prioritizing spectral wave data over meteorological data. Implement utility to determine which data sections are required based on selected sensors. Update validation to check all NDBC data sections by default for more reliable buoy detection.
…d API requests Modify coordinator to intelligently determine required data sections based on selected sensors. This ensures backward compatibility for existing configurations while optimizing API usage by only fetching from sections that contain active sensors, reducing unnecessary network requests.
…om required data sections Update the NDBC API client to fetch data only from sections that have active sensors. Accept all data sections during initialization but create API request tasks only for required sections, improving performance and reducing unnecessary data fetching.
Clean up translation files to reflect the removal of the data section selection step in the configuration flow. Retain the data section options for sensor labels, while removing the now-unnecessary step translation entries.
…ove UI experience Add explicit device registration during integration setup to ensure devices appear immediately without requiring a restart. Use the current device registry API with proper DeviceEntryType to create a service device that sensor entities will attach to, significantly improving the user experience.
Remove redundant device creation code from sensor entities.
…easurements Rename and enhance the _deduplicate_wave_height_sensors function to _deduplicate_overlapping_sensors to handle more types of overlapping measurements. Update the function to prioritize spectral wave data over meteorological data for wave height, wave period, and wave direction.
… and direction measurements Enhance sensor prioritization to include all wave-related measurements by creating a more comprehensive OVERLAPPING_SENSORS mapping. This prioritizes spectral wave data over meteorological data for wave height, wave period, and wave direction measurements.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Simplified Setup Flow: Removed the manual data section selection step for NDBC buoys, making configuration more straightforward for users while automatically checking all available data sections.
Comprehensive Wave Sensor Prioritization: Added logic to prefer higher quality spectral wave sensors over meteorological sensors when both are available. This prioritization now covers all key wave measurements:
This ensures users get the best available data quality across all wave-related measurements by default.
Optimized API Usage: Implemented smart data section detection to only fetch from data sections that have active sensors, reducing unnecessary API calls and improving performance.