Bump aioshelly to version 13.4.1 (#142477)

* Bymp aioshelly to 13.4.1

* Catch InvalidHostError

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Maciej Bieniek 2025-04-08 08:58:08 +02:00 committed by Franck Nijhof
parent d59200a9f5
commit 485b28d9ea
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
6 changed files with 9 additions and 3 deletions

View File

@ -12,6 +12,7 @@ from aioshelly.exceptions import (
CustomPortNotSupported, CustomPortNotSupported,
DeviceConnectionError, DeviceConnectionError,
InvalidAuthError, InvalidAuthError,
InvalidHostError,
MacAddressMismatchError, MacAddressMismatchError,
) )
from aioshelly.rpc_device import RpcDevice from aioshelly.rpc_device import RpcDevice
@ -157,6 +158,8 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
self.info = await self._async_get_info(host, port) self.info = await self._async_get_info(host, port)
except DeviceConnectionError: except DeviceConnectionError:
errors["base"] = "cannot_connect" errors["base"] = "cannot_connect"
except InvalidHostError:
errors["base"] = "invalid_host"
except Exception: # noqa: BLE001 except Exception: # noqa: BLE001
LOGGER.exception("Unexpected exception") LOGGER.exception("Unexpected exception")
errors["base"] = "unknown" errors["base"] = "unknown"

View File

@ -8,7 +8,7 @@
"integration_type": "device", "integration_type": "device",
"iot_class": "local_push", "iot_class": "local_push",
"loggers": ["aioshelly"], "loggers": ["aioshelly"],
"requirements": ["aioshelly==13.4.0"], "requirements": ["aioshelly==13.4.1"],
"zeroconf": [ "zeroconf": [
{ {
"type": "_http._tcp.local.", "type": "_http._tcp.local.",

View File

@ -51,6 +51,7 @@
"error": { "error": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"invalid_host": "[%key:common::config_flow::error::invalid_host%]",
"unknown": "[%key:common::config_flow::error::unknown%]", "unknown": "[%key:common::config_flow::error::unknown%]",
"firmware_not_fully_provisioned": "Device not fully provisioned. Please contact Shelly support", "firmware_not_fully_provisioned": "Device not fully provisioned. Please contact Shelly support",
"custom_port_not_supported": "Gen1 device does not support custom port.", "custom_port_not_supported": "Gen1 device does not support custom port.",

2
requirements_all.txt generated
View File

@ -371,7 +371,7 @@ aioruuvigateway==0.1.0
aiosenz==1.0.0 aiosenz==1.0.0
# homeassistant.components.shelly # homeassistant.components.shelly
aioshelly==13.4.0 aioshelly==13.4.1
# homeassistant.components.skybell # homeassistant.components.skybell
aioskybell==22.7.0 aioskybell==22.7.0

View File

@ -353,7 +353,7 @@ aioruuvigateway==0.1.0
aiosenz==1.0.0 aiosenz==1.0.0
# homeassistant.components.shelly # homeassistant.components.shelly
aioshelly==13.4.0 aioshelly==13.4.1
# homeassistant.components.skybell # homeassistant.components.skybell
aioskybell==22.7.0 aioskybell==22.7.0

View File

@ -11,6 +11,7 @@ from aioshelly.exceptions import (
CustomPortNotSupported, CustomPortNotSupported,
DeviceConnectionError, DeviceConnectionError,
InvalidAuthError, InvalidAuthError,
InvalidHostError,
) )
import pytest import pytest
@ -308,6 +309,7 @@ async def test_form_auth(
("exc", "base_error"), ("exc", "base_error"),
[ [
(DeviceConnectionError, "cannot_connect"), (DeviceConnectionError, "cannot_connect"),
(InvalidHostError, "invalid_host"),
(ValueError, "unknown"), (ValueError, "unknown"),
], ],
) )