Closed sca075 closed 3 months ago
Recent updates to the MQTT Vacuum Camera component significantly enhance its image processing capabilities. New constants and utility classesβsuch as AutoCrop
and ImageUtils
βimprove code modularity and flexibility. Adjustments to library version constraints reinforce compatibility, while major refactorings streamline image handling functionalities. These improvements collectively aim to elevate performance and maintainability in the vacuum camera's image management systems.
File Path | Change Summary |
---|---|
custom_components/mqtt_vacuum_camera/const.py |
Added DEFAULT_IMAGE_SIZE and DEFAULT_PIXEL_SIZE constants for improved image handling configuration. |
custom_components/mqtt_vacuum_camera/manifest.json |
Tightened pillow version constraint from <11.0.0 to <10.5.0 for compatibility and stability. |
custom_components/mqtt_vacuum_camera/utils/auto_crop.py |
Introduced AutoCrop class for managing image trimming and zooming with asynchronous processing capabilities. |
custom_components/mqtt_vacuum_camera/utils/handler_utils.py |
Added ImageUtils class to enhance image handling, including methods for calculating vacuum points and offsets. |
custom_components/mqtt_vacuum_camera/valetudo/hypfer/image_handler.py |
Refactored to utilize AutoCrop , removing several methods for improved code modularity. |
custom_components/mqtt_vacuum_camera/valetudo/rand256/image_handler.py |
Updated image processing with new utility classes and a modular approach in handling image operations. |
custom_components/mqtt_vacuum_camera/valetudo/rand256/reimg_draw.py |
Introduced ImageDraw class to facilitate image manipulation and drawing operations in a streamlined manner. |
custom_components/mqtt_vacuum_camera/utils/drawable.py |
Modified from_json_to_image method to accept pixels as either a dict or a list , enhancing flexibility. |
sequenceDiagram
participant User
participant ImageHandler
participant AutoCrop
participant ImageUtils
User->>ImageHandler: Request image processing
ImageHandler->>AutoCrop: Initialize with image data
AutoCrop->>ImageHandler: Process image (trim/zoom)
ImageHandler->>ImageUtils: Get vacuum points
ImageUtils-->>ImageHandler: Return calculated points
ImageHandler-->>User: Return processed image
π° In the world of pixels, bright and clear,
A vacuum's dance brings joy and cheer.
With cropping tools and handlers new,
Our images shine, a lovely view!
Hopping through code, we refine and play,
Celebrating changes, hip-hip-hooray! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Added AutoCrop module that can be shared between both firmwares. Made the Image_Utils module shared between the two firmwares. Impemented reimg_draw and created all related drawing functions are moved there.
Summary by CodeRabbit
New Features
AutoCrop
class to manage automatic image trimming and zooming.ImageUtils
class for enhanced image handling and processing.ImageDraw
class for streamlined image creation and manipulation.Bug Fixes
pillow
library to enhance stability and compatibility.Refactor