From 2b5bd0e31753b22479a8253e4b24da94022d76ff Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:44:56 +0200 Subject: [PATCH 1/9] adding const.py and update types.py to separate const and types Signed-off-by: Sandro Cantarella --- SCR/valetudo_map_parser/hypfer_handler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/SCR/valetudo_map_parser/hypfer_handler.py b/SCR/valetudo_map_parser/hypfer_handler.py index a125d4a..69b1383 100644 --- a/SCR/valetudo_map_parser/hypfer_handler.py +++ b/SCR/valetudo_map_parser/hypfer_handler.py @@ -16,6 +16,7 @@ from .config.async_utils import AsyncPIL from .config.drawable_elements import DrawableElement from .config.shared import CameraShared +from .const import COLORS from .config.types import ( LOGGER, CalibrationPoints, From c6ab4ee95be9efcf6b2dd3fdf129c43cdb997cbb Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:06:54 +0100 Subject: [PATCH 2/9] last files for 12 isort / ruff and lint Signed-off-by: Sandro Cantarella --- SCR/valetudo_map_parser/hypfer_handler.py | 1 - SCR/valetudo_map_parser/rand256_handler.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/SCR/valetudo_map_parser/hypfer_handler.py b/SCR/valetudo_map_parser/hypfer_handler.py index 69b1383..a125d4a 100644 --- a/SCR/valetudo_map_parser/hypfer_handler.py +++ b/SCR/valetudo_map_parser/hypfer_handler.py @@ -16,7 +16,6 @@ from .config.async_utils import AsyncPIL from .config.drawable_elements import DrawableElement from .config.shared import CameraShared -from .const import COLORS from .config.types import ( LOGGER, CalibrationPoints, diff --git a/SCR/valetudo_map_parser/rand256_handler.py b/SCR/valetudo_map_parser/rand256_handler.py index 3ed2a74..8e150e8 100644 --- a/SCR/valetudo_map_parser/rand256_handler.py +++ b/SCR/valetudo_map_parser/rand256_handler.py @@ -15,7 +15,6 @@ from .config.async_utils import AsyncPIL from .config.drawable_elements import DrawableElement -from .const import COLORS, DEFAULT_IMAGE_SIZE, DEFAULT_PIXEL_SIZE from .config.types import ( LOGGER, Colors, @@ -31,6 +30,7 @@ initialize_drawing_config, point_in_polygon, ) +from .const import COLORS, DEFAULT_IMAGE_SIZE, DEFAULT_PIXEL_SIZE from .map_data import RandImageData from .reimg_draw import ImageDraw from .rooms_handler import RandRoomsHandler From e6b006c8ffb6768475f7050f6a9a24e6c500f454 Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Fri, 19 Dec 2025 08:07:11 +0100 Subject: [PATCH 3/9] remove duplicate import of const Signed-off-by: Sandro Cantarella --- SCR/valetudo_map_parser/rand256_handler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/SCR/valetudo_map_parser/rand256_handler.py b/SCR/valetudo_map_parser/rand256_handler.py index 8e150e8..d1df01c 100644 --- a/SCR/valetudo_map_parser/rand256_handler.py +++ b/SCR/valetudo_map_parser/rand256_handler.py @@ -30,7 +30,6 @@ initialize_drawing_config, point_in_polygon, ) -from .const import COLORS, DEFAULT_IMAGE_SIZE, DEFAULT_PIXEL_SIZE from .map_data import RandImageData from .reimg_draw import ImageDraw from .rooms_handler import RandRoomsHandler From a5ca57172820a8526d0b04f8342001e7621919e9 Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Sat, 20 Dec 2025 13:59:48 +0100 Subject: [PATCH 4/9] const was not properly imported Signed-off-by: SCA075 <82227818+sca075@users.noreply.github.com> --- SCR/valetudo_map_parser/rand256_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SCR/valetudo_map_parser/rand256_handler.py b/SCR/valetudo_map_parser/rand256_handler.py index d1df01c..8a68f09 100644 --- a/SCR/valetudo_map_parser/rand256_handler.py +++ b/SCR/valetudo_map_parser/rand256_handler.py @@ -15,6 +15,7 @@ from .config.async_utils import AsyncPIL from .config.drawable_elements import DrawableElement +from .const import COLORS, DEFAULT_IMAGE_SIZE, DEFAULT_PIXEL_SIZE from .config.types import ( LOGGER, Colors, @@ -542,4 +543,4 @@ def get_calibration_data(self, rotation_angle: int = 0) -> Any: calibration_point = {"vacuum": vacuum_point, "map": map_point} self.calibration_data.append(calibration_point) - return self.calibration_data + return self.calibration_data \ No newline at end of file From 0d4f63c615dbe43bd0c2fd80ac26f29fbecf4bca Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Sat, 20 Dec 2025 17:17:49 +0100 Subject: [PATCH 5/9] minor changes in rand256_handler.py, shared.py removed snapshot at init bump version in pyproject.toml added to __init__.py Trims and Floor Data Signed-off-by: SCA075 <82227818+sca075@users.noreply.github.com> --- SCR/valetudo_map_parser/__init__.py | 4 +++- SCR/valetudo_map_parser/config/shared.py | 4 ---- SCR/valetudo_map_parser/rand256_handler.py | 2 +- pyproject.toml | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/SCR/valetudo_map_parser/__init__.py b/SCR/valetudo_map_parser/__init__.py index 37d3cd3..0d72b66 100644 --- a/SCR/valetudo_map_parser/__init__.py +++ b/SCR/valetudo_map_parser/__init__.py @@ -1,5 +1,5 @@ """Valetudo map parser. -Version: 0.1.13""" +Version: 0.1.14""" from pathlib import Path @@ -12,6 +12,7 @@ from .config.status_text.translations import translations as STATUS_TEXT_TRANSLATIONS from .config.types import ( CameraModes, + FloorData, ImageSize, JsonType, NumpyArray, @@ -20,6 +21,7 @@ RoomStore, SnapshotStore, TrimCropData, + TrimsData, UserLanguageStore, ) from .config.utils import ResizeParams, async_resize_image diff --git a/SCR/valetudo_map_parser/config/shared.py b/SCR/valetudo_map_parser/config/shared.py index 77443c5..b2257bd 100755 --- a/SCR/valetudo_map_parser/config/shared.py +++ b/SCR/valetudo_map_parser/config/shared.py @@ -311,10 +311,6 @@ def update_shared_data(self, device_info): instance.vacuum_status_position = device_info.get( CONF_VAC_STAT_POS, DEFAULT_VALUES["vac_status_position"] ) - # If enable_snapshots, check for png in www. - instance.enable_snapshots = device_info.get( - CONF_SNAPSHOTS_ENABLE, DEFAULT_VALUES["enable_www_snapshots"] - ) # Ensure trims are updated correctly trim_data = device_info.get("trims_data", DEFAULT_VALUES["trims_data"]) instance.trims = TrimsData.from_dict(trim_data) diff --git a/SCR/valetudo_map_parser/rand256_handler.py b/SCR/valetudo_map_parser/rand256_handler.py index 8a68f09..3ed2a74 100644 --- a/SCR/valetudo_map_parser/rand256_handler.py +++ b/SCR/valetudo_map_parser/rand256_handler.py @@ -543,4 +543,4 @@ def get_calibration_data(self, rotation_angle: int = 0) -> Any: calibration_point = {"vacuum": vacuum_point, "map": map_point} self.calibration_data.append(calibration_point) - return self.calibration_data \ No newline at end of file + return self.calibration_data diff --git a/pyproject.toml b/pyproject.toml index ecf107d..e2cb060 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "valetudo-map-parser" -version = "0.1.13" +version = "0.1.14" description = "A Python library to parse Valetudo map data returning a PIL Image object." authors = ["Sandro Cantarella "] license = "Apache-2.0" From c412fd7fb0f2dd8c9dbdcb20101e0c65a02e1fa8 Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Sun, 21 Dec 2025 09:29:15 +0100 Subject: [PATCH 6/9] updated __init__.py Signed-off-by: SCA075 <82227818+sca075@users.noreply.github.com> --- SCR/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCR/__init__.py b/SCR/__init__.py index 2217ee2..ebdf05f 100644 --- a/SCR/__init__.py +++ b/SCR/__init__.py @@ -1,2 +1,2 @@ """Valetudo map parser. -Version: 0.1.10""" +Version: 0.1.14""" From 11c09e24c037e90e4d0e355195d2add3f0c70585 Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Sun, 21 Dec 2025 09:33:41 +0100 Subject: [PATCH 7/9] updated __init__.py all Signed-off-by: SCA075 <82227818+sca075@users.noreply.github.com> --- SCR/valetudo_map_parser/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SCR/valetudo_map_parser/__init__.py b/SCR/valetudo_map_parser/__init__.py index 0d72b66..b0816d7 100644 --- a/SCR/valetudo_map_parser/__init__.py +++ b/SCR/valetudo_map_parser/__init__.py @@ -150,6 +150,7 @@ def get_default_font_path() -> str: "SENSOR_NO_DATA", # Classes and Handlers "CameraShared", + "FloorData", "CameraSharedManager", "ColorsManagement", "Drawable", @@ -172,6 +173,7 @@ def get_default_font_path() -> str: "RoomStore", "SnapshotStore", "TrimCropData", + "TrimsData", "UserLanguageStore", # Utilities "ResizeParams", From cb056f43243e8bd34480f0ac09a2e8fc36879852 Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Sun, 21 Dec 2025 11:02:18 +0100 Subject: [PATCH 8/9] updated __init__.py all Signed-off-by: SCA075 <82227818+sca075@users.noreply.github.com> --- SCR/valetudo_map_parser/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCR/valetudo_map_parser/__init__.py b/SCR/valetudo_map_parser/__init__.py index b0816d7..7fb2898 100644 --- a/SCR/valetudo_map_parser/__init__.py +++ b/SCR/valetudo_map_parser/__init__.py @@ -150,7 +150,6 @@ def get_default_font_path() -> str: "SENSOR_NO_DATA", # Classes and Handlers "CameraShared", - "FloorData", "CameraSharedManager", "ColorsManagement", "Drawable", @@ -165,6 +164,7 @@ def get_default_font_path() -> str: "StatusText", # Types "CameraModes", + "FloorData", "ImageSize", "JsonType", "NumpyArray", From 4e216569dbd2cb808f65623ba4e630cf3c393443 Mon Sep 17 00:00:00 2001 From: SCA075 <82227818+sca075@users.noreply.github.com> Date: Wed, 24 Dec 2025 07:32:01 +0100 Subject: [PATCH 9/9] update shared.py to load floor data from the config if present else uses old key trims_data Signed-off-by: SCA075 <82227818+sca075@users.noreply.github.com> --- SCR/valetudo_map_parser/config/shared.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/SCR/valetudo_map_parser/config/shared.py b/SCR/valetudo_map_parser/config/shared.py index b2257bd..03ebc5c 100755 --- a/SCR/valetudo_map_parser/config/shared.py +++ b/SCR/valetudo_map_parser/config/shared.py @@ -311,9 +311,20 @@ def update_shared_data(self, device_info): instance.vacuum_status_position = device_info.get( CONF_VAC_STAT_POS, DEFAULT_VALUES["vac_status_position"] ) - # Ensure trims are updated correctly - trim_data = device_info.get("trims_data", DEFAULT_VALUES["trims_data"]) - instance.trims = TrimsData.from_dict(trim_data) + # Check for new floors_data first + floors_data = device_info.get("floors_data", None) + current_floor = device_info.get("current_floor", "floor_0") # Default fallback + + if floors_data: + # NEW: Use floors_data + floor_trims = floors_data.get(current_floor, DEFAULT_VALUES["trims_data"]) + instance.trims = TrimsData.from_dict(floor_trims) + instance.current_floor = current_floor + else: + # OLD: Backward compatibility + trim_data = device_info.get("trims_data", DEFAULT_VALUES["trims_data"]) + instance.trims = TrimsData.from_dict(trim_data) + instance.current_floor = "floor_0" # Default # Robot size robot_size = device_info.get("robot_size", 25) try: