Skip to content

v1.1.0 - Multi-Profile Support for Feelfit Integration

Choose a tag to compare

@Sanji78 Sanji78 released this 16 Feb 08:58
e074a47

Multi-Profile Support for Feelfit Integration

Overview

This PR adds comprehensive multi-profile support to the Feelfit Home Assistant integration, allowing users to monitor multiple family members from a single Feelfit account.

Features Added

1. Multi-Profile Selection

  • During initial setup, users can select which profiles to monitor
  • Displays all available profiles with their names
  • Primary profile is pre-selected by default
  • Support for up to 5 profiles per account

2. Dynamic Profile Management

  • New Options Flow accessible via Settings → Devices → Feelfit → CONFIGURE
  • Enable/disable profiles at runtime without removing the integration
  • Changes take effect after automatic reload (~10-15 seconds)

3. Automatic Cleanup

  • Devices and entities are automatically removed when profiles are deactivated
  • No orphaned entities left behind
  • Clean device registry management

4. Enhanced Entity Tracking

  • Entity unique_id now includes profile_user_id for precise identification
  • Format: {entry_id}_{sensor_key}_{profile_user_id}
  • Enables selective entity removal per profile

Technical Changes

Modified Files

  • config_flow.py: Added profile selection step and options flow handler
  • __init__.py: Implemented async_update_options() with device registry cleanup
  • sensor.py: Updated all sensor classes to include profile_user_id in unique_id
  • api.py: No functional changes, code cleanup only
  • const.py: Added CONF_SELECTED_PROFILES and CONF_PROFILES_LIST constants

Code Quality

  • Removed all inline comments for production readiness
  • Maintained docstrings for Home Assistant compatibility
  • Full type hints throughout
  • Syntax verified for all files

User Experience

Setup Flow

  1. Enter Feelfit credentials
  2. Select profiles to monitor (checkboxes)
  3. Integration creates separate devices for each profile

Runtime Management

  1. Navigate to Settings → Devices & Services → Feelfit
  2. Click CONFIGURE (gear icon)
  3. Toggle profile checkboxes
  4. Submit → automatic reload
  5. Disabled profile devices disappear completely

Testing

  • ✅ Profile selection during setup
  • ✅ Multiple profiles active simultaneously
  • ✅ Options flow profile activation
  • ✅ Options flow profile deactivation
  • ✅ Device removal on profile disable
  • ✅ Integration reload after options change

Breaking Changes

None - Existing installations will continue to work with the primary profile only. Users must reconfigure to enable multi-profile support.

Migration Notes

For users who want to use the new entity removal feature:

  1. Remove the Feelfit integration completely
  2. Restart Home Assistant
  3. Re-add the integration
  4. Select desired profiles

This ensures all entities have the new unique_id format with profile_user_id.

Screenshots

image image