diff --git a/setup.py b/setup.py index 8eb34c1..f793eb2 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh: long_description = "\n" + fh.read() -VERSION = "0.0.10" +VERSION = "0.0.11" DESCRIPTION = "Stream Deck API Library" # Setting up diff --git a/streamdeckapi/api.py b/streamdeckapi/api.py index ee1d04a..c88eaa3 100644 --- a/streamdeckapi/api.py +++ b/streamdeckapi/api.py @@ -38,28 +38,6 @@ class StreamDeckApi: on_ws_connect (Callable[[], None] or None): Callback on websocket connected """ - # Type checks - if on_button_press is not None and not isinstance( - on_button_press, Callable[[str], None] - ): - raise TypeError() - if on_button_release is not None and not isinstance( - on_button_release, Callable[[str], None] - ): - raise TypeError() - if on_status_update is not None and not isinstance( - on_status_update, Callable[[SDInfo], None] - ): - raise TypeError() - if on_ws_message is not None and not isinstance( - on_ws_message, Callable[[SDWebsocketMessage], None] - ): - raise TypeError() - if on_ws_connect is not None and not isinstance( - on_ws_connect, Callable[[], None] - ): - raise TypeError() - self._host = host self._on_button_press = on_button_press self._on_button_release = on_button_release diff --git a/tests/api_test.py b/tests/api_test.py deleted file mode 100644 index aee452b..0000000 --- a/tests/api_test.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Unittests for API client.""" - -import unittest -import streamdeckapi - - -class TestApi(unittest.TestCase): - """Api Test Case.""" - - def test_constructor(self): - """Constructor test.""" - host = "host.local" - - # Test valid types - api = streamdeckapi.StreamDeckApi(host) - self.assertEqual(api.host, host) - - streamdeckapi.StreamDeckApi(host, on_button_press=None) - streamdeckapi.StreamDeckApi(host, on_button_release=None) - streamdeckapi.StreamDeckApi(host, on_status_update=None) - streamdeckapi.StreamDeckApi(host, on_ws_connect=None) - streamdeckapi.StreamDeckApi(host, on_ws_message=None) - - # Test some invalid types - for i_type in ["string", 2345, [321, 6457], {"key": "value"}]: - with self.assertRaises(TypeError): - _ = streamdeckapi.StreamDeckApi(host, on_button_press=i_type) - with self.assertRaises(TypeError): - _ = streamdeckapi.StreamDeckApi(host, on_button_release=i_type) - with self.assertRaises(TypeError): - _ = streamdeckapi.StreamDeckApi(host, on_status_update=i_type) - with self.assertRaises(TypeError): - _ = streamdeckapi.StreamDeckApi(host, on_ws_connect=i_type) - with self.assertRaises(TypeError): - _ = streamdeckapi.StreamDeckApi(host, on_ws_message=i_type)