diff --git a/custom_components/tuya_cloud_map_extractor/camera.py b/custom_components/tuya_cloud_map_extractor/camera.py index 7b12d31..6fdded1 100644 --- a/custom_components/tuya_cloud_map_extractor/camera.py +++ b/custom_components/tuya_cloud_map_extractor/camera.py @@ -149,6 +149,7 @@ def update(self): _LOGGER.warning("Unable to parse map data") _LOGGER.error(error) self._status = CameraStatus.FAILURE + return if map_data is not None: _LOGGER.debug("Map is ok") @@ -211,4 +212,4 @@ class CameraStatus(Enum): INITIALIZING = "Initializing" OK = "OK" OFF = "OFF" - FAILURE = "Faliure" + FAILURE = "Failure" diff --git a/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/const.py b/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/const.py index f3100ad..19eb75c 100644 --- a/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/const.py +++ b/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/const.py @@ -272,3 +272,6 @@ class DeviceIDError(Exception): class PixelValueNotDefined(Exception): pass + +class NotSupportedError(Exception): + pass \ No newline at end of file diff --git a/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py b/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py index 9b9cdd8..289f4d8 100644 --- a/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py +++ b/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py @@ -13,6 +13,7 @@ from .v1 import decode_v1, to_array_v1, decode_path_v1 from .custom0 import decode_custom0, to_array_custom0, decode_path_custom0 from .tuya import get_download_link +from .const import NotSupportedError from .common import decode_header _LOGGER = logging.getLogger(__name__) @@ -36,7 +37,7 @@ def parse_map(response: requests.models.Response): elif header["version"] == [1]: mapDataArr = decode_v1(data, header) else: - raise RuntimeError + raise NotSupportedError("Map version " + str(header["version"]) +" is not supported.") return header, mapDataArr