From ca33d7263f93bcd3a817c4e93f0883f29d021754 Mon Sep 17 00:00:00 2001
From: Allen Porter <allen@thebends.org>
Date: Tue, 11 Mar 2025 07:12:19 -0700
Subject: [PATCH] Improve roborock map image (#140379)

---
 homeassistant/components/roborock/const.py | 1 +
 homeassistant/components/roborock/image.py | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/homeassistant/components/roborock/const.py b/homeassistant/components/roborock/const.py
index cc8d34fbadc..5a725ff5586 100644
--- a/homeassistant/components/roborock/const.py
+++ b/homeassistant/components/roborock/const.py
@@ -49,6 +49,7 @@ IMAGE_CACHE_INTERVAL = 90
 MAP_SLEEP = 3
 
 GET_MAPS_SERVICE_NAME = "get_maps"
+MAP_SCALE = 4
 MAP_FILE_FORMAT = "PNG"
 MAP_FILENAME_SUFFIX = ".png"
 SET_VACUUM_GOTO_POSITION_SERVICE_NAME = "set_vacuum_goto_position"
diff --git a/homeassistant/components/roborock/image.py b/homeassistant/components/roborock/image.py
index 66088d6453c..70f06dd4b92 100644
--- a/homeassistant/components/roborock/image.py
+++ b/homeassistant/components/roborock/image.py
@@ -26,6 +26,7 @@ from .const import (
     DRAWABLES,
     IMAGE_CACHE_INTERVAL,
     MAP_FILE_FORMAT,
+    MAP_SCALE,
     MAP_SLEEP,
 )
 from .coordinator import RoborockConfigEntry, RoborockDataUpdateCoordinator
@@ -47,7 +48,11 @@ async def async_setup_entry(
         if config_entry.options.get(DRAWABLES, {}).get(drawable, default_value)
     ]
     parser = RoborockMapDataParser(
-        ColorsPalette(), Sizes(), drawables, ImageConfig(), []
+        ColorsPalette(),
+        Sizes({k: v * MAP_SCALE for k, v in Sizes.SIZES.items()}),
+        drawables,
+        ImageConfig(scale=MAP_SCALE),
+        [],
     )
 
     def parse_image(map_bytes: bytes) -> bytes | None:
-- 
GitLab