Skip to content

v1.0.1 - Critical Fix: Resilient API Error Handling

Choose a tag to compare

@emanuelbesliu emanuelbesliu released this 25 Feb 14:19

🔧 Critical Bug Fix Release

This patch release fixes a critical issue where the integration would fail to load when BFT's cloud API returns temporary errors.

🐛 What Was Fixed

Problem: Integration failed to load when BFT API's diagnosis endpoint returned HTTP 500 errors or network issues
Solution: Graceful error handling that allows integration to load and auto-recover

✨ Changes in v1.0.1

  • Resilient error handling: Integration now gracefully handles temporary API failures (HTTP 500, SSL errors, connection issues)
  • Auto-recovery: Entity shows as "unavailable" during API issues and automatically becomes available when service recovers
  • Better logging: Improved error messages that clarify the integration will retry automatically
  • No more setup failures: Integration loads successfully even when BFT cloud service is temporarily down

📝 Technical Details

Changed behavior in _get_command() method for diagnosis calls:

  • HTTP 500 errors → Return empty dict (was: raise exception)
  • SSL errors → Return empty dict (was: raise exception)
  • Connection errors → Return empty dict (was: raise exception)
  • Request errors → Return empty dict (was: raise exception)

The update() method already handled empty responses gracefully, so the integration:

  1. Loads successfully during Home Assistant startup
  2. Shows entity as "unavailable" if API is down
  3. Automatically recovers when API responds (polling every 5 seconds)

🚀 Upgrading from v1.0.0

HACS users:

  1. Go to HACS → Integrations
  2. Find "BFT Gate Automation"
  3. Click "Update"
  4. Restart Home Assistant

Manual installation:

  1. Download homeassistant-bft-v1.0.1.zip below
  2. Extract to custom_components/bft/
  3. Restart Home Assistant

📋 Recommended Configuration

For best reliability with the sometimes-unreliable BFT API:

cover:
  - platform: bft
    covers:
      your_gate:
        device: YOUR_DEVICE_NAME
        username: your_email@example.com
        password: your_password
        name: your_gate_name
        skip_initial_update: true  # Faster startup
        timeout: 30                # Longer timeout for slow API
        retry_count: 10            # More retries for reliability

🔗 Links

🙏 Feedback

If you encounter any issues, please open an issue.