|
12 | 12 | from typing import Any |
13 | 13 | import urllib.parse |
14 | 14 |
|
15 | | -import logging |
16 | 15 | from aiohttp import ( |
17 | 16 | ClientConnectorError, |
18 | 17 | ClientOSError, |
|
59 | 58 | ) |
60 | 59 | from .models import Device, DeviceInfo, PortMapping |
61 | 60 |
|
62 | | -LOGGER = logging.getLogger(__name__) |
63 | | - |
64 | 61 |
|
65 | 62 | async def retry_login(invocation: Mapping[str, Any]) -> None: |
66 | 63 | """Retry login via backoff if an exception occurs.""" |
@@ -545,37 +542,31 @@ async def login(self): |
545 | 542 | """Login to the router using configured API mode.""" |
546 | 543 | if self.api_mode == ApiMode.REST: |
547 | 544 | self._active_api_mode = ApiMode.REST |
548 | | - LOGGER.info("API mode forced to REST") |
549 | 545 | return await self.__rest_login() |
550 | 546 |
|
551 | 547 | if self.api_mode == ApiMode.LEGACY: |
552 | 548 | self._active_api_mode = ApiMode.LEGACY |
553 | | - LOGGER.info("API mode forced to LEGACY") |
554 | 549 | return await self.__legacy_login() |
555 | 550 |
|
556 | 551 | # Auto-detect mode: try legacy first, then fall back to REST for newer firmwares. |
557 | 552 | try: |
558 | 553 | self._active_api_mode = ApiMode.LEGACY |
559 | 554 | result = await self.__legacy_login() |
560 | | - LOGGER.info("API mode auto-detected as LEGACY") |
561 | 555 | return result |
562 | 556 | except Exception as exception: # pylint: disable=broad-except |
563 | 557 | if not self.__should_fallback_to_rest(exception): |
564 | 558 | raise |
565 | 559 |
|
566 | 560 | self._active_api_mode = ApiMode.REST |
567 | | - LOGGER.info("API mode auto-detected as REST") |
568 | 561 | return await self.__rest_login() |
569 | 562 |
|
570 | 563 | async def logout(self): |
571 | 564 | """Log out of the Sagemcom F@st device.""" |
572 | 565 | if self._active_api_mode == ApiMode.REST: |
573 | | - response = await self.__rest_request("POST", "/api/v1/logout", data={"_": ""}) |
574 | | - LOGGER.info("REST logout response: %s", response) |
| 566 | + await self.__rest_request("POST", "/api/v1/logout", data={"_": ""}) |
575 | 567 | else: |
576 | 568 | actions = {"id": 0, "method": "logOut"} |
577 | | - response = await self.__api_request_async([actions], False) |
578 | | - LOGGER.info("JSON-REQ logout response: %s", response) |
| 569 | + await self.__api_request_async([actions], False) |
579 | 570 |
|
580 | 571 | self._session_id = -1 |
581 | 572 | self._server_nonce = "" |
|
0 commit comments