Skip to content

Releases: alexdelprete/ha-abb-powerone-pvi-sunspec

v4.1.6 - Maintenance Release

15 Oct 14:44
v4.1.6
6b4b8b1

Choose a tag to compare

What's Changed

Maintenance release with dependency updates and CI/CD improvements.

📦 Dependencies

  • Bumped pymodbus from 3.11.1 to 3.11.2
  • Updated Home Assistant requirement to 2025.10.0+
  • Updated development dependencies

🔧 CI/CD Improvements

  • Fixed lint workflow: upgraded to Python 3.13 for HA 2025.10.2 compatibility
  • Updated GitHub Actions dependencies

📚 Documentation

  • Restructured release documentation following best practices

⚠️ Breaking Changes

None - This is a backwards-compatible maintenance release.

🚀 Upgrade Notes

  • Safe to upgrade from v4.1.5
  • Requires Home Assistant 2025.10.0 or newer (updated from 2025.9.0)
  • No configuration changes required

Full Release Notes: docs/releases/v4.1.6.md

Full Changelog: v4.1.5...v4.1.6

Release v4.1.5

12 Oct 05:47
v4.1.5
6ef55a7

Choose a tag to compare

Release Notes - v4.1.5

What's Changed

This release includes comprehensive code quality improvements, critical bug fixes, and modernization to follow Home Assistant 2025.3.0+ best practices.

🐛 Critical Bug Fixes

Fixed Sensor Availability (v4.1.5-beta.6)

The most important fix in this release - sensors now properly show as "unavailable" when the inverter is offline (at night) instead of displaying stale data.

The Problem:

  • Sensors displayed stale data from sunset throughout the night
  • No indication that the inverter was offline
  • Users saw incorrect power readings (e.g., "1500W" at midnight)

The Solution:
Changed error handling in api.py to raise exceptions instead of returning False:

  • connect() method: Raises VSNConnectionError when inverter is unreachable
  • async_get_data() method: Raises exceptions when data read or connection fails
  • Coordinator now properly marks entities as unavailable when exceptions occur

Files changed:

Fixed Integration Lifecycle (v4.1.5-beta.3, beta.4, beta.5)

  • Fixed KeyError on integration unload - Removed invalid cleanup of non-existent hass.data[DOMAIN][entry_id]
  • Fixed RuntimeWarning - Added missing await to api.close() coroutine call
  • Fixed duplicate cleanup error - Removed incorrect async_on_unload() registration causing double cleanup
  • Fixed resource leak - Per-entry resources now properly cleaned up for all config entries
  • Fixed incorrect async/await usage - Corrected @callback decorator usage on synchronous methods

Files changed:

  • init.py: Refactored to HA 2025.3.0+ pattern

✨ Code Quality Improvements (v4.1.5-beta.1, beta.2)

Comprehensive Refactoring

  • Fixed all ruff warnings across the entire codebase
  • Created centralized logging helpers in helpers.py:
    • log_debug(), log_info(), log_warning(), log_error()
    • Standardized logging with context and kwargs
    • Converted 34+ logging calls across all modules
  • Added comprehensive type hints to all classes and instance variables
  • Improved error handling patterns:
    • Created _check_modbus_exception_response() helper
    • Created _handle_connection_exception() helper
    • Created _handle_modbus_exception() helper

Specific Fixes

  • Renamed ConnectionError to VSNConnectionError (avoid shadowing Python builtin)
  • Fixed IPv6 address validation in host_valid() function
  • Fixed all TRY300 warnings (moved return statements outside try blocks)
  • Fixed all TRY301 warnings (abstracted raise statements to helpers)
  • Fixed RET505 warnings (removed unnecessary else after return)
  • Replaced f-strings in logger calls with %s formatting (ruff G004)
  • Fixed PIE796 warnings (converted duplicate enum values to aliases)
  • Moved host_valid() utility to helpers.py for better organization

Files improved:

♻️ Modernization

Update Listener Pattern (v4.1.5-beta.5)

Refactored to official HA pattern from Config Entry Options docs:

  • Uses async_on_unload(add_update_listener()) for automatic cleanup
  • Removed manual cleanup code (handled automatically by HA)
  • Removed update_listener from RuntimeData dataclass

Callback Optimizations (v4.1.5-beta.5)

  • async_reload_entry: Changed to @callback decorator (synchronous)
  • async_update_device_registry: Changed to @callback decorator (synchronous)
  • Improved performance with fewer async context switches

Integration Unload (v4.1.5-beta.4)

Follows official HA 2025.3.0+ pattern from Config Entry States blog post:

  • Conditional cleanup with walrus operator (only if platform unload succeeds)
  • Uses async_loaded_entries(DOMAIN) for last-entry check
  • Better error handling and logging

📦 Dependencies

  • Updated ruff from 0.13.3 to 0.14.0
  • Updated softprops/action-gh-release from 2.3.4 to 2.4.0
  • Compatible with pymodbus >= 3.11.1
  • Compatible with Home Assistant 2025.3.0+

🧹 Other Changes

⚠️ Breaking Changes

Requires Home Assistant 2025.3.0 or newer

  • Dropped backwards compatibility with HA < 2025.3.0
  • Uses modern config entry state management

📋 Testing Recommendations

Sensor Availability

  1. Disconnect inverter or VSN card from network
  2. Wait for next update cycle (check scan_interval)
  3. Verify all sensors show "Unavailable"
  4. Reconnect and verify sensors restore with fresh data
  5. Monitor day/night cycle for proper availability transitions

Integration Lifecycle

  1. Test integration reload (Settings → Devices & Services → Configure → Reload)
  2. Test integration removal (verify no errors in logs)
  3. Test with multiple config entries
  4. Verify update listener triggers on options changes

🚀 Upgrade Notes

This is an official stable release - thoroughly tested through 6 beta releases.

  • Highly recommended upgrade - fixes critical sensor availability issue
  • Safe to upgrade from v4.1.0 or any v4.1.5-beta.x
  • Requires Home Assistant 2025.3.0 or newer
  • No configuration changes required
  • All changes are internal improvements and bug fixes

🎯 Summary of Beta Testing

This release went through extensive beta testing (6 beta releases) to ensure stability:

  • beta.1 & beta.2: Code quality improvements and ruff compliance
  • beta.3: Fixed unload bugs (KeyError, missing await)
  • beta.4: Modernized unload process for HA 2025.3.0+
  • beta.5: Fixed update listener lifecycle and callback optimizations
  • beta.6: Critical sensor availability fix

📝 Commits Since v4.1.0

All 30 commits from v4.1.0 to v4.1.5 including:

  • Code quality improvements and refactoring
  • Fixed all ruff warnings across codebase
  • Multiple lifecycle management fixes
  • Critical sensor availability fix
  • Dependency updates

Full Changelog: v4.1.0...v4.1.5

v4.1.5-beta.6

10 Oct 01:33
v4.1.5-beta.6
3f44bf0

Choose a tag to compare

v4.1.5-beta.6 Pre-release
Pre-release

Release Notes - v4.1.5-beta.6

What's Changed

🐛 Critical Bug Fix: Sensor Availability

This release fixes a critical bug where sensors displayed stale data at night instead of becoming unavailable when the inverter powered down.

The Problem

When the inverter shut down at night (or the VSN card became unreachable):

  • ❌ Sensors kept showing the last values from sunset
  • ❌ Users saw incorrect data (e.g., "Current Power: 1500W" at midnight)
  • ❌ No indication that the inverter was offline
  • ❌ Data appeared current but was actually frozen from hours ago

Root Cause

Three locations in api.py were returning False instead of raising exceptions when connection failed:

  1. connect() method (line 511): When check_port() failed (inverter unreachable)
  2. async_get_data() method (line 779): When data read failed
  3. async_get_data() method (line 783): When connection failed

Without exceptions, the coordinator never raised UpdateFailed, so Home Assistant:

  • Didn't mark entities as unavailable
  • Kept displaying stale coordinator.data values
  • Never indicated the integration was offline

The Solution

Changed all three failure points to raise exceptions instead of returning False:

# Before (Silent Failure):
if await self.check_port():
    # connect...
    return True
return False  # ❌ Sensors show stale data

# After (Proper Exception):
if await self.check_port():
    # connect...
    return True
raise VSNConnectionError(...)  # ✅ Sensors become unavailable

Changes Made

api.py (5 changes):

  • connect() line 511: Raise VSNConnectionError when port check fails (inverter unreachable)
  • async_get_data() line 779: Raise ModbusError when data read fails
  • async_get_data() line 783: Raise VSNConnectionError when connection fails
  • Updated docstring example to use proper exception handling pattern
  • Updated docstring to reflect exception-based error handling

config_flow.py (2 changes):

  • Added imports: VSNConnectionError, ModbusError
  • Updated exception handling to catch custom exceptions during setup validation

Expected Behavior After Fix

Night (Inverter Offline):

  1. VSN card unreachable → check_port() times out ✅
  2. connect() raises VSNConnectionError
  3. Coordinator catches exception → raises UpdateFailed
  4. Home Assistant marks entities as unavailable
  5. Sensors display: "Unavailable" instead of stale values ✅

Morning (Inverter Online):
6. VSN card responds → connection succeeds ✅
7. Data read succeeds ✅
8. Sensors become available with fresh data ✅
9. Coordinator resumes normal updates ✅

Technical Details

Why This Bug Occurred:

The Home Assistant DataUpdateCoordinator has specific behavior:

  • If async_update_data() raises UpdateFailed → Entities become unavailable
  • If async_update_data() returns any value (even False) → coordinator.data stays unchanged → Sensors keep stale values ❌

Our code was returning False on connection failures, which triggered the second behavior.

Flow Comparison:

Old Flow (Buggy):
check_port() → timeout
connect() → return False
async_get_data() → return False
coordinator.async_update_data() → return False (no exception!)
coordinator.data → unchanged (keeps old values)
sensors → display stale data ❌

New Flow (Fixed):
check_port() → timeout
connect() → raise VSNConnectionError
async_get_data() → propagate exception
coordinator.async_update_data() → raise UpdateFailed
coordinator → marks entities unavailable
sensors → display "Unavailable" ✅

Other Changes

  • Chore: Added .zed folder to .gitignore

Breaking Changes

None - this is a bug fix that improves existing behavior.

Testing Recommendations

  1. Test Offline Behavior:

    • Disconnect inverter or VSN card from network
    • Wait for next update cycle (check scan_interval)
    • Verify all sensors show "Unavailable"
    • Check logs for VSNConnectionError
  2. Test Online Recovery:

    • Reconnect inverter/VSN card
    • Wait for next update cycle
    • Verify sensors show current values (not stale data)
    • Verify proper data updates continue
  3. Test Day/Night Cycle:

    • Monitor sensors from sunset through night to sunrise
    • Verify sensors go unavailable when inverter shuts down
    • Verify sensors restore when inverter starts in morning
    • Confirm no stale data displayed during night

Upgrade Notes

This is a beta release - please test in a non-production environment first.

  • Highly recommended upgrade - fixes critical data accuracy issue
  • Safe to upgrade from v4.1.5-beta.5
  • No configuration changes required
  • Will properly show sensor status at night

Known Issues

None

Commits Since v4.1.5-beta.5

  • cf4cb3b - Add .zed folder to .gitignore
  • 5bf495e - Fix sensor availability: raise exceptions instead of returning False

Full Changelog: v4.1.5-beta.5...v4.1.5-beta.6

v4.1.5-beta.5

07 Oct 22:50
v4.1.5-beta.5
2be5eea

Choose a tag to compare

v4.1.5-beta.5 Pre-release
Pre-release

Release Notes - v4.1.5-beta.5

What's Changed

🐛 Bug Fixes

Fixed Update Listener Management

  • Fixed duplicate cleanup error that caused "Error unloading entry" during integration unload
    • Removed incorrect async_on_unload() registration that caused double cleanup
    • Now follows official HA pattern: async_on_unload(add_update_listener()) for automatic cleanup
  • Fixed incorrect await usage on synchronous @callback methods
    • async_reload_entry: Removed incorrect await on async_schedule_reload()
    • async_update_device_registry: Changed from async def to @callback def

♻️ Refactoring

Update Listener Pattern Modernization

  • Refactored to official HA pattern from Config Entry Options docs
  • Removed update_listener from RuntimeData (no longer needed with automatic cleanup)
  • Removed manual cleanup in async_unload_entry (handled automatically by HA)
  • Removed unused hass.data[DOMAIN] initialization (using runtime_data pattern)

Callback Optimizations

  • async_reload_entry: Changed from async def to @callback def
    • Removed incorrect await on async_schedule_reload() (it's synchronous)
    • Added @callback decorator and return type hint
  • async_update_device_registry: Changed from async def to @callback def
    • Only calls synchronous methods (async_get, async_get_or_create)
    • Performance improvement and better type accuracy
    • Fixed typo: "Regiser" → "Register"

Code Cleanup

  • Removed unused Callable import
  • Simplified RuntimeData dataclass (only stores coordinator)
  • Cleaner, more maintainable code following HA best practices

📦 Dependencies

  • Bumped ruff from 0.13.3 to 0.14.0 (#311)
  • Bumped softprops/action-gh-release from 2.3.4 to 2.4.0 (#310)

Technical Details

Before (Problematic)

# Setup
update_listener = config_entry.add_update_listener(async_reload_entry)
config_entry.async_on_unload(update_listener)  # Wrong: registers removal callable
config_entry.runtime_data = RuntimeData(coordinator, update_listener)

# Unload
config_entry.runtime_data.update_listener()  # Manual cleanup
# Then HA tries to call it again via async_on_unload → ERROR!

After (Correct)

# Setup
config_entry.runtime_data = RuntimeData(coordinator)
config_entry.async_on_unload(
    config_entry.add_update_listener(async_reload_entry)
)  # Correct: automatic cleanup

# Unload
# Nothing needed - HA handles cleanup automatically!

Breaking Changes

None - this is a bug fix and optimization release.

Improvements

  • Fixed integration unload errors - no more "Error unloading entry" messages
  • Better performance - fewer async context switches with @callback optimizations
  • Cleaner code - follows official HA patterns and best practices
  • More maintainable - automatic cleanup reduces error-prone manual management
  • Type safety - proper use of @callback vs async def

Testing Recommendations

  • Test integration reload (Settings → Devices & Services → Configure → Reload)
  • Test integration removal (verify no errors in logs)
  • Test with multiple config entries
  • Verify update listener triggers on options changes

Upgrade Notes

This is a beta release - please test in a non-production environment first.

  • Safe to upgrade from v4.1.5-beta.4
  • Fixes critical unload errors introduced in beta.4
  • No configuration changes required
  • All changes are internal improvements

Known Issues

None

Commits Since v4.1.5-beta.4

  • 8ad1461 - Optimize async_update_device_registry: change to @callback
  • 04a14ee - Fix async_reload_entry: use callback decorator and remove await
  • 0a9575d - Style fixes by ruff
  • a106406 - Refactor update_listener to follow official HA pattern
  • 2cd12bf - Bump ruff from 0.13.3 to 0.14.0 (#311)
  • 83f327d - Bump softprops/action-gh-release from 2.3.4 to 2.4.0 (#310)
  • 7b36fc5 - Fix async_unload_entry: remove duplicate update_listener cleanup

Full Changelog: v4.1.5-beta.4...v4.1.5-beta.5

v4.1.5-beta.4

07 Oct 01:00
v4.1.5-beta.4
e33d776

Choose a tag to compare

v4.1.5-beta.4 Pre-release
Pre-release

Release Notes - v4.1.5-beta.4

What's Changed

🔄 Integration Lifecycle Improvements

This release modernizes the integration's unload process to follow the official Home Assistant 2025.3.0+ recommended pattern, fixing resource leaks and improving reliability.

Major Refactor: async_unload_entry()

  • Follows official HA 2025.3.0+ pattern from Config Entry States blog post
  • Conditional cleanup with walrus operator: Only cleans up runtime_data (API connection, update listener) if platform unload succeeds
  • Fixed resource leak: Per-entry resources are now properly cleaned up for all config entries, not just the last one
  • Removed backwards compatibility code for HA < 2025.3.0
  • Simplified last-entry check: Uses async_loaded_entries(DOMAIN) directly
  • Improved logging: Better tracking of success/failure paths for debugging

Technical Details

Before (problematic):

# Always cleaned up resources, even if platform unload failed
unload_ok = await async_unload_platforms(...)
await api.close()  # Wrong: cleanup even if unload_ok=False
listener()

After (correct):

# Only cleanup if platform unload succeeds
if unload_ok := await async_unload_platforms(...):
    await api.close()  # Correct: conditional cleanup
    listener()

Breaking Changes

⚠️ Requires Home Assistant 2025.3.0 or newer

  • Dropped backwards compatibility with HA < 2025.3.0
  • Uses modern config entry state management

Bug Fixes

  • Fixed resource leak when multiple config entries exist
    • Previously: Only the last entry being unloaded would close API connections
    • Now: Every entry properly closes its API connection when unloaded
  • Fixed potential errors when platform unload fails
    • Previously: Would cleanup runtime_data even if entry remained loaded
    • Now: Skips cleanup if unload fails, preventing errors

Improvements

  • Cleaner, more maintainable code (-15 lines)
  • Better adherence to HA best practices
  • More reliable multi-entry scenarios
  • Enhanced debug logging

Testing

  • Test unloading individual config entries with multiple entries configured
  • Test reload functionality
  • Verify API connections are properly closed for all entries
  • Test failure scenarios (platform unload failures)

Upgrade Notes

This is a beta release - please test in a non-production environment first.

  • Required: Home Assistant 2025.3.0 or newer
  • Safe to upgrade from v4.1.5-beta.3
  • Fixes will prevent resource leaks in multi-entry setups
  • No configuration changes required

Full Changelog: v4.1.5-beta.3...v4.1.5-beta.4

v4.1.5-beta.3

07 Oct 00:03
v4.1.5-beta.3
d72ed8e

Choose a tag to compare

v4.1.5-beta.3 Pre-release
Pre-release

Release Notes - v4.1.5-beta.3

What's Changed

🐛 Bug Fixes

This release fixes critical bugs in the integration's unload process that could cause errors when removing or reloading the integration.

Fixed Issues

  • Fixed KeyError on integration unload (__init__.py)

    • Removed invalid cleanup of hass.data[DOMAIN][entry_id] which doesn't exist
    • Integration uses runtime_data instead, which is automatically cleaned up
    • Fixes error: KeyError: '54dcc9b0ac601ef0a7d78ebcd861cc76'
  • Fixed RuntimeWarning on API connection close (__init__.py)

    • Added missing await to api.close() coroutine call
    • Fixes warning: coroutine 'ABBPowerOneFimerAPI.close' was never awaited
  • Code style improvements (helpers.py)

    • Minor ruff style fixes for code quality

Technical Details

  • All fixes are in the integration lifecycle management
  • No breaking changes
  • No changes to functionality or features
  • Improved error handling and cleanup process

Testing

  • Test integration reload to ensure no KeyError
  • Test integration removal to ensure clean shutdown
  • No functional changes to inverter communication

Upgrade Notes

This is a beta release - please test in a non-production environment first.

  • Safe to upgrade from v4.1.5-beta.1 or v4.1.5-beta.2
  • Fixes will prevent errors during integration reload/removal
  • No configuration changes required

Full Changelog: v4.1.5-beta.2...v4.1.5-beta.3

v4.1.5-beta.2

06 Oct 00:53
3fe8245

Choose a tag to compare

v4.1.5-beta.2 Pre-release
Pre-release

Release Notes

What's Changed

🔧 Code Quality & Maintainability Release

This release focuses on code quality improvements, fixing all ruff warnings, and improving code maintainability without changing functionality.

Bug Fixes

  • ✅ Fixed IPv6 address validation in host_valid() function (config_flow.py) - was only accepting IPv4

Code Quality Improvements

  • ✅ Renamed ConnectionError to VSNConnectionError to avoid shadowing Python builtin (ruff A001)
  • ✅ Fixed SIM222 warning in config_flow.py by correcting boolean logic
  • ✅ Fixed all TRY300 warnings by moving return statements outside try blocks:
    • api.py - Multiple instances fixed
    • coordinator.py - Fixed in async_update_data() method
  • ✅ Fixed all TRY301 warnings by abstracting raise statements to helper functions
  • ✅ Removed unnecessary parentheses from raised exceptions (coordinator.py)
  • ✅ Removed unnecessary else after return statements (RET505):
    • sensor.py - Fixed in entity_category() and native_value() methods
  • ✅ Removed blind except Exception handlers for more precise error handling
  • ✅ Replaced f-strings in logger calls with %s formatting (ruff G004)
  • ✅ Converted all _LOGGER.debug(f"...") calls to use _log_debug() helper in api.py
  • ✅ Fixed connect() method return logic to properly return False instead of raising exception
  • ✅ Fixed read_holding_registers() to return ExceptionResponse instead of raising
  • ✅ Created helper methods for consistent exception handling:
    • _check_modbus_exception_response() - Check for ExceptionResponse
    • _handle_connection_exception() - Handle ConnectionException
    • _handle_modbus_exception() - Handle ModbusException
  • ✅ Added comprehensive type hints to all classes:
    • Added type hints to exception class instance variables (VSNConnectionError, ModbusError, ExceptionError)
    • Added type hints to ABBPowerOneFimerAPI class instance variables
    • Improved IDE autocomplete and type checking support
  • ✅ Created centralized logging helpers module (helpers.py):
    • log_debug() - Standardized debug logging with context and kwargs
    • log_info() - Standardized info logging with context and kwargs
    • log_warning() - Standardized warning logging with context and kwargs
    • log_error() - Standardized error logging with context and kwargs
  • ✅ Refactored all modules to use centralized logging helpers:
    • api.py - All logging calls converted to direct helper usage (no internal wrappers)
    • coordinator.py - 6 logging calls converted
    • sensor.py - 9 logging calls converted
    • config_flow.py - 7 logging calls converted
    • init.py - 12 logging calls converted
  • ✅ Moved host_valid() utility function from config_flow.py to helpers.py:
    • Better code organization and reusability
    • Added type hints and comprehensive docstring
    • Fixed Pylance type checking error (ensured all code paths return bool)
    • Fixed TRY300 warning by simplifying logic (direct return of boolean expression)
    • Removed duplicate imports from config_flow.py
  • ✅ Fixed Pylance type checker warning in ConfigFlow class definition:
    • Added # type: ignore[call-arg] comment for domain parameter
    • Suppresses false positive from type checker (code is correct per HA standards)
  • ✅ Improved code structure following Python best practices and ruff recommendations
  • ✅ Fixed PIE796 warnings by converting duplicate enum values to aliases:
    • pymodbus_constants.py - Made OFF alias of READY (both represent value 0)
    • Removed unused SLAVE_ON and SLAVE_OFF constants
  • ✅ Removed unnecessary variable assignments before return statements:
    • pymodbus_payload.py - Simplified to_coils() and bit_chunks() by returning list comprehensions directly

Technical Details

  • All changes are non-functional improvements focused on code quality and maintainability
  • No breaking changes
  • No user-facing changes
  • Improved code structure and error handling patterns
  • Better adherence to Python best practices and ruff linting standards

Testing

  • All existing functionality remains unchanged
  • No new features or bug fixes in this release
  • Recommended to test as usual to ensure no regressions

v4.1.5-beta.1 - Code Quality & Maintainability Release

05 Oct 21:49
v4.1.5-beta.1
e115b45

Choose a tag to compare

Release Notes

What's Changed

🔧 Code Quality & Maintainability Release

This release focuses on code quality improvements, fixing all ruff warnings, and improving code maintainability without changing functionality.

Bug Fixes

  • ✅ Fixed IPv6 address validation in host_valid() function (config_flow.py) - was only accepting IPv4

Code Quality Improvements

  • ✅ Renamed ConnectionError to VSNConnectionError to avoid shadowing Python builtin (ruff A001)
  • ✅ Fixed SIM222 warning in config_flow.py by correcting boolean logic
  • ✅ Fixed all TRY300 warnings by moving return statements outside try blocks:
    • api.py - Multiple instances fixed
    • coordinator.py - Fixed in async_update_data() method
  • ✅ Fixed all TRY301 warnings by abstracting raise statements to helper functions
  • ✅ Removed unnecessary parentheses from raised exceptions (coordinator.py)
  • ✅ Removed unnecessary else after return statements (RET505):
    • sensor.py - Fixed in entity_category() and native_value() methods
  • ✅ Removed blind except Exception handlers for more precise error handling
  • ✅ Replaced f-strings in logger calls with %s formatting (ruff G004)
  • ✅ Converted all _LOGGER.debug(f"...") calls to use _log_debug() helper in api.py
  • ✅ Fixed connect() method return logic to properly return False instead of raising exception
  • ✅ Fixed read_holding_registers() to return ExceptionResponse instead of raising
  • ✅ Created helper methods for consistent exception handling:
    • _check_modbus_exception_response() - Check for ExceptionResponse
    • _handle_connection_exception() - Handle ConnectionException
    • _handle_modbus_exception() - Handle ModbusException
  • ✅ Added comprehensive type hints to all classes:
    • Added type hints to exception class instance variables (VSNConnectionError, ModbusError, ExceptionError)
    • Added type hints to ABBPowerOneFimerAPI class instance variables
    • Improved IDE autocomplete and type checking support
  • ✅ Created centralized logging helpers module (helpers.py):
    • log_debug() - Standardized debug logging with context and kwargs
    • log_info() - Standardized info logging with context and kwargs
    • log_warning() - Standardized warning logging with context and kwargs
    • log_error() - Standardized error logging with context and kwargs
  • ✅ Refactored all modules to use centralized logging helpers:
    • api.py - All logging calls converted to direct helper usage (no internal wrappers)
    • coordinator.py - 6 logging calls converted
    • sensor.py - 9 logging calls converted
    • config_flow.py - 7 logging calls converted
    • init.py - 12 logging calls converted
  • ✅ Moved host_valid() utility function from config_flow.py to helpers.py:
    • Better code organization and reusability
    • Added type hints and comprehensive docstring
    • Fixed Pylance type checking error (ensured all code paths return bool)
    • Fixed TRY300 warning by simplifying logic (direct return of boolean expression)
    • Removed duplicate imports from config_flow.py
  • ✅ Fixed Pylance type checker warning in ConfigFlow class definition:
    • Added # type: ignore[call-arg] comment for domain parameter
    • Suppresses false positive from type checker (code is correct per HA standards)
  • ✅ Improved code structure following Python best practices and ruff recommendations

Technical Details

  • All changes are non-functional improvements focused on code quality and maintainability
  • No breaking changes
  • No user-facing changes
  • Improved code structure and error handling patterns
  • Better adherence to Python best practices and ruff linting standards

Testing

  • All existing functionality remains unchanged
  • No new features or bug fixes in this release
  • Recommended to test as usual to ensure no regressions

v4.1.0 - Home Assistant 2025.9.x Compatibility Release

22 Sep 21:41
v4.1.0
3a0ecf6

Choose a tag to compare

🎯 Major Updates

  • Home Assistant 2025.9.x Compatibility: Full support for Home Assistant 2025.9.x with updated pymodbus 3.11.x compatibility
  • Enhanced Stability: Multiple bug fixes and improvements for better reliability

🐛 Bug Fixes

  • Fixed backward compatibility for slave_id to device_id migration
  • Fixed pymodbus 3.10 and 3.11.x constants deprecation issues
  • Fixed config_flow parameter handling
  • Fixed scan_interval bounds logic
  • Improved timeout logic with proper ModBusError exception handling on read failures

⚡ Performance Improvements

  • Raised temperature threshold to 70°C for better thermal management
  • Optimized timeout and exception handling for more reliable Modbus communication

📦 Dependencies

  • Updated pymodbus requirement to >=3.11.1 for Home Assistant 2025.9.x compatibility
  • Updated ruff from 0.12.5 to 0.13.1
  • Updated pip requirement to >=21.0,<25.3
  • Updated actions/setup-python from 5.6.0 to 6.0.0
  • Updated actions/checkout from 4.2.2 to 5.0.0

🔧 Requirements

  • Home Assistant: 2025.9.0 or later
  • Python: 3.12+
  • pymodbus: >=3.11.1

📋 Full Changelog

See all changes since v4.0.0: v4.0.0...v4.1.0

v4.0.1-beta.3 - Beta Release with Backward Compatibility Fix

07 Sep 17:34
v4.0.1-beta.3
bb02bbd

Choose a tag to compare

⚠️ BETA RELEASE - NOT FOR PRODUCTION USE

This is a pre-release version for testing purposes only. Please use in a test environment before deploying to production.

What's Changed in v4.0.1-beta.3

🔧 Critical Fix: Backward Compatibility

This beta release fixes the TypeError that occurred when upgrading from older versions that used slave_id in their configuration.

Bug Fixes in this release

  • Fixed: TypeError when loading existing configurations with slave_id instead of device_id
  • Added: Automatic migration from slave_id to device_id for existing installations
  • Added: Backward compatibility handling in coordinator and config flow
  • Updated: Config entry version to 2 with proper migration support

Features from v4.0.1-beta.2

  • ✅ Full compatibility with pymodbus 3.11.x (HomeAssistant 2025.9.x ready)
  • ✅ Updated all Modbus API calls to use device_id parameter instead of deprecated slave
  • ✅ Improved timeout handling logic for better connection stability
  • ✅ Raised temperature threshold to 70°C for better compatibility
  • ✅ Fixed type hints for timeout parameters

Dependencies

  • Updated pymodbus requirement to >=3.11.1 (matching HomeAssistant 2025.9.x)

Migration Notes

  • Existing configurations will be automatically migrated from slave_id to device_id
  • No manual intervention required
  • Configuration remains backward compatible

🧪 Testing Required

This is a BETA release. Please:

  • Test with HomeAssistant 2025.9.x
  • Verify your inverter communication works correctly
  • Test upgrading from older versions
  • Report any issues to the issue tracker
  • DO NOT use in production until thoroughly tested

Known Limitations

  • This is a beta release and may contain bugs
  • Not recommended for production use
  • Requires testing with various inverter models

Full Changelog: v4.0.1-beta.2...v4.0.1-beta.3