Bump aioshelly to 4.1.0 (#80795)

This commit is contained in:
Shay Levy 2022-10-23 07:57:25 +03:00 committed by GitHub
parent 4837e22262
commit 8fa64a7a89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 8 deletions

View File

@ -8,7 +8,7 @@ from typing import Any, cast
import aioshelly
from aioshelly.block_device import BlockDevice
from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError
from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError, RpcCallError
from aioshelly.rpc_device import RpcDevice
from homeassistant.config_entries import ConfigEntry
@ -510,7 +510,11 @@ class ShellyRpcCoordinator(DataUpdateCoordinator):
try:
await self.device.trigger_ota_update(beta=beta)
except DeviceConnectionError as err:
raise HomeAssistantError(f"Error starting OTA update: {repr(err)}") from err
raise HomeAssistantError(
f"OTA update connection error: {repr(err)}"
) from err
except RpcCallError as err:
raise HomeAssistantError(f"OTA update request error: {repr(err)}") from err
except InvalidAuthError:
self.entry.async_start_reauth(self.hass)
else:
@ -553,7 +557,7 @@ class ShellyRpcPollingCoordinator(DataUpdateCoordinator):
LOGGER.debug("Polling Shelly RPC Device - %s", self.name)
try:
await self.device.update_status()
except DeviceConnectionError as err:
except (DeviceConnectionError, RpcCallError) as err:
raise UpdateFailed(f"Device disconnected: {repr(err)}") from err
except InvalidAuthError:
self.entry.async_start_reauth(self.hass)

View File

@ -6,7 +6,7 @@ from dataclasses import dataclass
from typing import Any, cast
from aioshelly.block_device import Block
from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError
from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError, RpcCallError
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
@ -426,7 +426,11 @@ class ShellyRpcEntity(entity.Entity):
except DeviceConnectionError as err:
self.coordinator.last_update_success = False
raise HomeAssistantError(
f"Call RPC for entity {self.name} failed, method: {method}, params: {params}, error: {repr(err)}"
f"Call RPC for {self.name} connection error, method: {method}, params: {params}, error: {repr(err)}"
) from err
except RpcCallError as err:
raise HomeAssistantError(
f"Call RPC for {self.name} request error, method: {method}, params: {params}, error: {repr(err)}"
) from err
except InvalidAuthError:
self.coordinator.entry.async_start_reauth(self.hass)

View File

@ -3,7 +3,7 @@
"name": "Shelly",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/shelly",
"requirements": ["aioshelly==4.0.0"],
"requirements": ["aioshelly==4.1.0"],
"dependencies": ["http"],
"zeroconf": [
{

View File

@ -255,7 +255,7 @@ aiosenseme==0.6.1
aiosenz==1.0.0
# homeassistant.components.shelly
aioshelly==4.0.0
aioshelly==4.1.0
# homeassistant.components.skybell
aioskybell==22.7.0

View File

@ -230,7 +230,7 @@ aiosenseme==0.6.1
aiosenz==1.0.0
# homeassistant.components.shelly
aioshelly==4.0.0
aioshelly==4.1.0
# homeassistant.components.skybell
aioskybell==22.7.0