Compare commits

...

1 Commits

Author SHA1 Message Date
Claude a610a0bb8e Fix Daikin integration PermissionError during setup
Handle PermissionError that can occur when the pydaikin library
attempts UDP discovery in restricted container environments.
The error is now caught and treated as a temporary failure
(ConfigEntryNotReady) allowing the setup to retry.

Fixes #155084

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 14:58:15 +00:00
2 changed files with 19 additions and 0 deletions
@@ -58,6 +58,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: DaikinConfigEntry) -> bo
except ClientConnectionError as err:
_LOGGER.debug("ClientConnectionError to %s", host)
raise ConfigEntryNotReady from err
except PermissionError as err:
_LOGGER.debug("PermissionError connecting to %s: %s", host, err)
raise ConfigEntryNotReady from err
coordinator = DaikinCoordinator(hass, entry, device)
+16
View File
@@ -226,3 +226,19 @@ async def test_timeout_error(hass: HomeAssistant, mock_daikin) -> None:
await hass.async_block_till_done()
assert config_entry.state is ConfigEntryState.SETUP_RETRY
async def test_permission_error(hass: HomeAssistant, mock_daikin) -> None:
"""Test permission error on setup."""
config_entry = MockConfigEntry(
domain=DOMAIN,
unique_id=MAC,
data={CONF_HOST: HOST, KEY_MAC: MAC},
)
config_entry.add_to_hass(hass)
mock_daikin.side_effect = PermissionError
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
assert config_entry.state is ConfigEntryState.SETUP_RETRY