From 008e22c5089b5d2946f1d75833a01daa3303f147 Mon Sep 17 00:00:00 2001 From: Malene Trab Date: Tue, 16 Apr 2024 11:38:22 +0200 Subject: [PATCH] Fix warnings --- .vscode/launch.json | 4 ++-- pyworxcloud/__init__.py | 2 +- pyworxcloud/utils/devices.py | 2 +- test_with.py | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1ef9b1b..a7cd93e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "configurations": [ { "name": "test.py", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/test.py", "console": "integratedTerminal", @@ -15,7 +15,7 @@ }, { "name": "test_with.py", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/test_with.py", "console": "integratedTerminal", diff --git a/pyworxcloud/__init__.py b/pyworxcloud/__init__.py index 9da24d1..d42c022 100644 --- a/pyworxcloud/__init__.py +++ b/pyworxcloud/__init__.py @@ -420,7 +420,7 @@ def _decode_data(self, device: DeviceHandler) -> None: logger.debug("No valid data was found, skipping update for %s", device.name) return - mower = device._mower + mower = device.mower if "dat" in data: mower["last_status"]["payload"]["dat"] = data["dat"] if "uuid" in data["dat"]: diff --git a/pyworxcloud/utils/devices.py b/pyworxcloud/utils/devices.py index c50df3b..70ce076 100644 --- a/pyworxcloud/utils/devices.py +++ b/pyworxcloud/utils/devices.py @@ -40,7 +40,7 @@ def __init__( super().__init__() self._api = api - self._mower = mower + self.mower = mower self._tz = tz if not isinstance(mower, type(None)) and not isinstance(api, type(None)): diff --git a/test_with.py b/test_with.py index aeaf709..e70ceae 100644 --- a/test_with.py +++ b/test_with.py @@ -1,3 +1,5 @@ +"""Testfile demonstrating the "with method" of calling the module.""" + from os import environ from pprint import pprint