Skip to content

Commit

Permalink
- improve type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
intrueder committed Jan 17, 2023
1 parent 072da65 commit 37f181f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cuesdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import platform
from ctypes import (c_int32, c_uint32, c_void_p, byref, sizeof,
create_string_buffer)
from typing import (Any, List, Collection, Mapping, Optional, Union, Callable)
from typing import (Any, Collection, Sequence, Optional, Callable)

from .enums import (CorsairAccessLevel, CorsairDataType, CorsairError,
CorsairDevicePropertyId)
Expand All @@ -23,7 +23,7 @@

__all__ = ['CueSdk']

napi: CorsairNativeApi = None
napi: CorsairNativeApi


def get_library_path(lib_name):
Expand Down Expand Up @@ -101,7 +101,7 @@ def get_session_details(self):

def get_devices(self, device_filter: CorsairDeviceFilter):
if not device_filter:
return CorsairError(CorsairError.CE_InvalidArguments)
return (None, CorsairError(CorsairError.CE_InvalidArguments))

df = CorsairDeviceFilterNative(
deviceTypeMask=device_filter.device_type_mask)
Expand Down Expand Up @@ -233,7 +233,7 @@ def request_control(self, device_id: str,
return CorsairError(
napi.CorsairRequestControl(to_native_id(device_id), access_level))

def release_control(self, device_id: str = None) -> CorsairError:
def release_control(self, device_id: Optional[str]) -> CorsairError:
return CorsairError(napi.CorsairReleaseControl(
to_native_id(device_id)))

Expand Down Expand Up @@ -292,7 +292,7 @@ def set_led_colors_buffer(

def set_led_colors_flush_buffer_async(
self,
callback: Callable[[CorsairError], None] = None) -> CorsairError:
callback: Optional[Callable[[CorsairError], None]]) -> CorsairError:
if not callback:
return CorsairError(
napi.CorsairSetLedColorsFlushBufferAsync(None, None))
Expand All @@ -307,7 +307,7 @@ def raw_handler(ctx, e):
napi.CorsairSetLedColorsFlushBufferAsync(async_callback, None))

def get_led_colors(self, device_id: str,
led_colors: Collection[CorsairLedColor]):
led_colors: Sequence[CorsairLedColor]):
if not device_id:
return (None, CorsairError(CorsairError.CE_InvalidArguments))

Expand Down

0 comments on commit 37f181f

Please sign in to comment.