Skip to content

Slow startup (5min websocket timeout) + TypeError in switch.py:474 with HA 2026.04 #28

@pifma

Description

@pifma

Environment

  • Home Assistant version: 2026.04
  • Integration version: v1.0.0 (via HACS)
  • Python version: 3.14
  • Hardware: Raspberry Pi (Home Assistant OS)
  • Devices: 5x Hisense split AC (model 009-199), managed via ConnectLife

Bug 1: Websocket blocks HA startup for 5 minutes

During Home Assistant startup, HisenseWebSocket._connect_ws() hangs and causes a 5-minute
timeout before HA can proceed. This blocks ALL other integrations from completing setup.

Log:
2026-04-06 18:50:39.442 WARNING (MainThread) [homeassistant.bootstrap] Setup timed out for
bootstrap waiting on {<Task pending name='Task-604'
coro=<HisenseWebSocket._connect_ws() running at
/config/custom_components/hisense_ac_plugin/websocket.py:119>
wait_for= cb=[set.remove()]>} - moving forward

Expected behavior: The websocket connection should either complete quickly or fail gracefully
without blocking HA startup. Consider using hass.async_create_background_task() instead of
blocking the setup phase.

Bug 2: TypeError in switch.py line 474 (15 occurrences per boot)

After startup, multiple TypeError: 'NoneType' object can't be awaited errors are logged
from switch.py:474. With 5 AC units × 3 switches each, this generates 15 errors per boot.

Log:
2026-04-06 18:45:21.509 ERROR (SyncWorker_5) [homeassistant] Error doing job:
Task exception was never retrieved (task: None)
Traceback (most recent call last):
File "/config/custom_components/hisense_ac_plugin/switch.py", line 474, in _async_schedule_update
await self.async_schedule_update_ha_state(True)
TypeError: 'NoneType' object can't be awaited

Expected behavior: _async_schedule_update should check if async_schedule_update_ha_state
returns a valid awaitable before awaiting it, or handle the None case gracefully.

Additional warnings (non-blocking)

The integration also logs these warnings for each device, which is expected behavior
but worth noting:
WARNING [custom_components.hisense_ac_plugin.number] No supported numbers found
WARNING [custom_components.hisense_ac_plugin.water_heater] Skipping unsupported device: 009-199 (...)
WARNING [custom_components.hisense_ac_plugin.humidifier] Skipping unsupported device: 009-199 (...)

These are just informational (009-199 are AC units, not water heaters/humidifiers), but could
be silenced to keep logs clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions