Skip to content

Commit

Permalink
Issue when just IPV4 is in the payload no IP return fixed.
Browse files Browse the repository at this point in the history
image_draw.py logging too much data for the obstacles no data logged anymore.

Signed-off-by: [email protected] <[email protected]>
  • Loading branch information
sca075 committed Dec 7, 2024
1 parent b249beb commit 606ae7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/mqtt_vacuum_camera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/sca075/mqtt_vacuum_camera/issues",
"requirements": ["pillow>=10.3.0,<=11.0.0", "numpy"],
"version": "2024.12.0"
"version": "2024.12.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ async def async_message_received(self, msg) -> None:
# When IPV4 and IPV6 are available, use IPV4
if vacuum_host_ip.split(",").__len__() > 1:
self._shared.vacuum_ips = vacuum_host_ip.split(",")[0]
else:
# Use IPV4 when no IPV6 without split
self._shared.vacuum_ips = vacuum_host_ip
_LOGGER.debug(f"Vacuum IPs: {self._shared.vacuum_ips}")

async def async_subscribe_to_topics(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ async def async_draw_obstacle(
self.img_h.shared.obstacles_data = compose_obstacle_links(
self.img_h.shared.vacuum_ips, obstacle_objects
)
elif self.img_h.shared.vacuum_api:
elif self.img_h.shared.vacuum_api: # Fall back to API usage if no IP.
self.img_h.shared.obstacles_data = compose_obstacle_links(
self.img_h.shared.vacuum_api.split("http://")[1], obstacle_objects
)

# Draw obstacles on the map
if obstacle_objects:
_LOGGER.debug(f"{self.file_name} All obstacle detected: {obstacle_objects}")
_LOGGER.debug(f"{self.file_name} Obstacle detected.")
self.img_h.draw.draw_obstacles(np_array, obstacle_objects, color_no_go)

return np_array
Expand Down

0 comments on commit 606ae7f

Please sign in to comment.