Skip to content

Commit

Permalink
refactor: remove unused imports and improve error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SecKatie committed Feb 3, 2025
1 parent 2f9a100 commit d300d3a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
13 changes: 0 additions & 13 deletions src/wyzeapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@
from inspect import iscoroutinefunction
from typing import List, Optional, Set, Callable

from .const import (
PHONE_SYSTEM_TYPE,
APP_VERSION,
SC,
APP_VER,
SV,
PHONE_ID,
APP_NAME,
OLIVE_APP_ID,
APP_INFO,
)
from .crypto import olive_create_signature
from .exceptions import TwoFactorAuthenticationEnabled
from .payload_factory import olive_create_user_info_payload
from .services.base_service import BaseService
from .services.bulb_service import BulbService
from .services.camera_service import CameraService
Expand Down
1 change: 0 additions & 1 deletion src/wyzeapy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# of the attached license. You should have received a copy of
# the license with this file. If not, please write to:
# [email protected] to receive a copy
from typing import Dict, Any


class ActionNotSupported(Exception):
Expand Down
1 change: 0 additions & 1 deletion src/wyzeapy/services/camera_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from ..exceptions import UnknownApiError
from .base_service import BaseService
from .update_manager import DeviceUpdater
from ..types import Device, DeviceTypes, Event, PropertyIDs, DeviceMgmtToggleProps
from ..utils import return_event_for_device, create_pid_pair

Expand Down
4 changes: 2 additions & 2 deletions src/wyzeapy/services/update_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ async def update(self, mutex: threading.Lock):
self.device = await self.service.update(self.device)
# Callback to provide the updated info to the subscriber
self.device.callback_function(self.device)
except:
_LOGGER.exception("Unknown error happened during updating device info")
except Exception as e:
_LOGGER.exception("Unknown error happened during updating device info: %s", e)
finally:
# Release the mutex after the async call
mutex.release()
Expand Down
4 changes: 2 additions & 2 deletions src/wyzeapy/tests/test_camera_service.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from unittest.mock import AsyncMock, MagicMock
from wyzeapy.services.camera_service import CameraService, Camera, DEVICEMGMT_API_MODELS
from wyzeapy.types import DeviceTypes, PropertyIDs, Event
from wyzeapy.services.camera_service import CameraService, Camera
from wyzeapy.types import DeviceTypes, PropertyIDs
from wyzeapy.wyze_auth_lib import WyzeAuthLib


Expand Down

0 comments on commit d300d3a

Please sign in to comment.