From be3bb8347a395ebe7f0989e9e3a1eeca3c47355b Mon Sep 17 00:00:00 2001 From: andrewsayre <6730289+andrewsayre@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:04:19 -0500 Subject: [PATCH] Fixexd pylint issues --- .vscode/settings.json | 5 ++++- pylintrc | 2 -- pysmartthings/app.py | 4 +--- pysmartthings/device.py | 2 +- tests/test_device.py | 6 +++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6422c07..17ee738 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "python.linting.pylintEnabled": true, "python.linting.enabled": true, - "python.formatting.provider": "black", + "python.formatting.provider": "none", "editor.formatOnPaste": false, "editor.formatOnSave": true, "editor.formatOnType": true, @@ -16,5 +16,8 @@ "when": "$(basename).py" }, "**/__pycache__": true + }, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" } } \ No newline at end of file diff --git a/pylintrc b/pylintrc index cb31740..204c9b2 100644 --- a/pylintrc +++ b/pylintrc @@ -16,7 +16,6 @@ # unnecessary-pass - readability for functions which only contain pass disable= format, - abstract-class-little-used, abstract-method, cyclic-import, duplicate-code, @@ -25,7 +24,6 @@ disable= locally-disabled, not-an-iterable, not-context-manager, - redefined-variable-type, too-few-public-methods, too-many-arguments, too-many-branches, diff --git a/pysmartthings/app.py b/pysmartthings/app.py index ee64f70..bf27acd 100644 --- a/pysmartthings/app.py +++ b/pysmartthings/app.py @@ -177,9 +177,7 @@ def app_type(self) -> str: def app_type(self, value: str): """Set the app type.""" if value not in (APP_TYPE_LAMBDA, APP_TYPE_WEBHOOK): - raise ValueError( - "value must be 'LAMBDA_SMART_APP' " "or 'WEBHOOK_SMART_APP'" - ) + raise ValueError("value must be 'LAMBDA_SMART_APP' or 'WEBHOOK_SMART_APP'") self._app_type = value @property diff --git a/pysmartthings/device.py b/pysmartthings/device.py index 918f3fc..e98a043 100644 --- a/pysmartthings/device.py +++ b/pysmartthings/device.py @@ -861,7 +861,7 @@ async def set_color( if color_hex: if not COLOR_HEX_MATCHER.match(color_hex): raise ValueError( - "color_hex was not a properly formatted " "color hex, i.e. #000000." + "color_hex was not a properly formatted color hex, i.e. #000000." ) color_map["hex"] = color_hex else: diff --git a/tests/test_device.py b/tests/test_device.py index db477fc..77ea633 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -26,8 +26,8 @@ def test_init(): device = Device() # Assert assert device.type == DEVICE_TYPE_UNKNOWN - assert device.capabilities == [] - assert device.components == {} + assert not device.capabilities + assert not device.components @staticmethod def test_apply_data(): @@ -1259,7 +1259,7 @@ def test_init(): status = DeviceStatus(None, device_id=DEVICE_ID) # Assert assert status.device_id == DEVICE_ID - assert status.attributes == {} + assert not status.attributes assert not status.switch assert not status.motion assert status.level == 0