Skip to content

Commit 5465e77

Browse files
Fix issue #94 (#118)
1 parent 62ce373 commit 5465e77

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

custom_components/sagemcom_fast/button.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from sagemcom_api.models import DeviceInfo as GatewayDeviceInfo
1212

1313
from . import HomeAssistantSagemcomFastData
14-
from .const import DOMAIN
14+
from .const import DOMAIN, LOGGER
1515

1616

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

4444
async def async_press(self) -> None:
4545
"""Handle the button press."""
46-
await self.client.reboot()
46+
try:
47+
await self.client.login()
48+
await self.client.reboot()
49+
except Exception as exception: # pylint: disable=broad-except
50+
LOGGER.exception(exception)
4751

4852
@property
4953
def device_info(self) -> DeviceInfo:

0 commit comments

Comments
 (0)