Skip to content

Commit

Permalink
Fix issue #94 (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakonyiferenc authored Mar 23, 2024
1 parent 62ce373 commit 5465e77
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/sagemcom_fast/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sagemcom_api.models import DeviceInfo as GatewayDeviceInfo

from . import HomeAssistantSagemcomFastData
from .const import DOMAIN
from .const import DOMAIN, LOGGER


async def async_setup_entry(
Expand Down Expand Up @@ -43,7 +43,11 @@ def __init__(self, gateway: GatewayDeviceInfo, client: SagemcomClient) -> None:

async def async_press(self) -> None:
"""Handle the button press."""
await self.client.reboot()
try:
await self.client.login()
await self.client.reboot()
except Exception as exception: # pylint: disable=broad-except
LOGGER.exception(exception)

@property
def device_info(self) -> DeviceInfo:
Expand Down

0 comments on commit 5465e77

Please sign in to comment.