Skip to content

2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Feb 20:21

icon

SMS Notifications via SMS.to — v2.0.0 🚀


📣 Overview

Version 2.0.0 is a complete architectural refactor of the SMS.to integration.

The integration now follows modern Home Assistant development standards and removes all deprecated patterns. Functionality remains the same:

  • ✅ Send SMS notifications
  • ✅ Monitor account balance
  • ✅ Track total SMS sent

The difference is under the hood: cleaner code, proper coordinator usage, safer HTTP handling, and long-term compatibility.


🔄 What’s New in v2.0.0

✅ DataUpdateCoordinator Implementation

  • Replaced deprecated @Throttle with DataUpdateCoordinator
  • Both sensors (Balance + Total SMS Sent) update in a single coordinated cycle
  • Update interval: 5 minutes
  • Partial data handling: if one endpoint fails, available data is still exposed

Impact:
More reliable updates, no silent failures, and proper HA-native behavior.


✅ Modern Sensor Architecture

  • Migrated from Entity to:
    • SensorEntity
    • CoordinatorEntity
  • Declarative definitions via SensorEntityDescription
  • statenative_value
  • unit_of_measurementnative_unit_of_measurement
  • Added:
    • has_entity_name = True
    • translation_key
    • SensorStateClass (MEASUREMENT for balance, TOTAL for messages)
  • Proper DeviceInfo dataclass usage
  • Missing data now returns None (entity becomes unavailable)
    • No more "Error" or "Unavailable" string states

Impact:
Fully aligned with current and upcoming HA core requirements.


✅ Shared aiohttp Client Session

  • Removed per-request aiohttp.ClientSession() creation
  • Now uses Home Assistant’s async_get_clientsession()
  • Eliminates unclosed session warnings and resource leaks

Impact:
Correct HTTP lifecycle management and improved stability.


✅ Clean & Structured API Client

  • Removed unused BaseNotificationService inheritance
  • Deleted dead async_get_service() function
  • Centralized API URLs in const.py
  • Unified HTTP error mapping and handling

Impact:
More maintainable, predictable, and easier to extend.


✅ Improved Config Flow

  • Uses _abort_if_unique_id_configured() for duplicate detection
  • Modern Options Flow pattern (no config_entry in constructor)
  • Test message step validates configuration before entry creation

Impact:
Cleaner configuration lifecycle and proper HA compliance.


✅ Robust Service Registration

  • notify.smsto now includes:
    • Voluptuous runtime validation
    • Full UI schema (Developer Tools support)
  • Service is only removed when the last config entry is unloaded
  • Supports multiple integration entries

Impact:
Stable multi-account support and better developer experience.


✅ General Code Cleanup

  • Removed duplicate imports
  • Consistent logging prefixes:
    • Coordinator:
    • SMSToNotificationService
    • notify.smsto
  • All constants centralized in const.py
  • Added ro.json translations for Romanian support

Impact:
Cleaner codebase and easier long-term maintenance.