Fix deprecated API usage and modernize for Home Assistant 2025.5+ compatibility #55
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.
🔧 Fix deprecated API usage and modernize for Home Assistant 2025.5+ compatibility
Closes: #54
🤖 AI-Generated Code Improvements
This PR was generated using AI assistance to automatically identify and fix deprecated Home Assistant API calls, ensuring long-term compatibility and following current best practices.
📋 Changes Made
✅ Critical Fix for Issue #54
async_track_state_change→async_track_state_change_eventeventparameter (required for new API)🔄 Additional Modernization Improvements
async_add_devices()→async_add_entities()async_update_ha_state()→async_write_ha_state()should_pollproperty →availablepropertyunit_of_measurement→native_unit_of_measurement🎯 Why These Changes Matter
📁 Files Modified
custom_components/attributes/sensor.pycustom_components/attributes/manifest.json🧪 Testing
📚 References
This PR was generated using AI assistance to ensure comprehensive coverage of all deprecated API usage patterns.