Skip to content

Fix: 'HomeAssistant' object has no attribute 'helpers' - HA 2025.5+ compatibility#55

Open
f-is-h wants to merge 1 commit into
cozylife:masterfrom
f-is-h:fix-ha-2025-5-compatibility
Open

Fix: 'HomeAssistant' object has no attribute 'helpers' - HA 2025.5+ compatibility#55
f-is-h wants to merge 1 commit into
cozylife:masterfrom
f-is-h:fix-ha-2025-5-compatibility

Conversation

@f-is-h
Copy link
Copy Markdown

@f-is-h f-is-h commented May 22, 2025

🔧 Fix for Home Assistant 2025.5+ Compatibility

This PR resolves the critical compatibility issue that prevents the integration from loading in Home Assistant 2025.5 and later versions.

🐛 Problem

Starting with Home Assistant 2025.5, the hass.helpers attribute has been completely removed, causing this error:

'HomeAssistant' object has no attribute 'helpers'
Error during setup of component hass_cozylife_local_pull

✅ Solution

This PR modernizes the integration to use current Home Assistant APIs:

  • Replaced deprecated hass.helpers.discovery.load_platformhass.helpers.discovery.async_load_platform
  • Updated synchronous setup() functionasync_setup() with proper async support
  • Modernized platform loading → Uses async_setup_platform() in light.py and switch.py
  • Enhanced error handling → Better async exception handling throughout
  • Updated manifest.json → Added modern HA requirements and version bump to 0.3.0

🏠 Home Assistant Compatibility

  • Home Assistant 2025.5+ (Fully Compatible)
  • Maintains backward compatibility with earlier versions
  • All original functionality preserved

📋 Changes Made

  1. __init__.py: Complete rewrite with async support and modern platform loading
  2. light.py: Updated to async_setup_platform() with improved error handling
  3. switch.py: Updated to async_setup_platform() with improved error handling
  4. manifest.json: Version bump and metadata updates

🧪 Tested On

  • Home Assistant 2025.5.2
  • All device types (RGBCW Light, CW Light, Switch & Plug)
  • Both UDP discovery and manual IP configuration

📖 For Users Experiencing This Issue

If you need this fix immediately, you can use our updated repository:

🚀 Quick Install

cd /config/custom_components/
git clone https://github.com/f-is-h/hass_cozylife_local_pull.git

📝 Configuration (same as before)

hass_cozylife_local_pull:
  lang: en
  ip:
    - "192.168.1.99"

🔄 After Installation

  1. Restart Home Assistant
  2. Your CozyLife devices should appear automatically

Repository with fix: https://github.com/f-is-h/hass_cozylife_local_pull
Compatible with: Home Assistant 2025.5+ and earlier versions

Closes #54

…tibility

- Replaced deprecated hass.helpers.discovery.load_platform with async_load_platform
- Updated synchronous setup() function to async_setup() with proper async support
- Modernized platform loading in light.py and switch.py with async_setup_platform()
- Enhanced error handling with async exception handling throughout
- Updated manifest.json with modern HA requirements and version bump to 0.3.0
- Maintains backward compatibility with earlier Home Assistant versions
- All original functionality preserved

Resolves Home Assistant 2025.5+ compatibility issue where hass.helpers attribute was removed.

Fixes: HomeAssistant object has no attribute helpers
Compatible with: Home Assistant 2025.5+ and earlier versions
@ivanvmoreno
Copy link
Copy Markdown

LGTM! Tested on HA 2025.5.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIXED] 'HomeAssistant' object has no attribute 'helpers' error in Home Assistant 2025.5+

2 participants