Closed sca075 closed 2 months ago
The changes involve a significant update to the mqtt_vacuum_camera
component, transitioning from a Valetudo-based architecture to a more generalized MQTT Camera framework. This includes renaming classes and functions, updating import statements, and modifying configuration parameters to simplify setup. A new coordinator class has been introduced to manage data updates from MQTT topics, enhancing modularity. The version number has been incremented across multiple files to reflect these updates.
File(s) | Change Summary |
---|---|
custom_components/mqtt_vacuum_camera/__init__.py , custom_components/mqtt_vacuum_camera/camera.py |
Updated version number to 2024.10.0b2 , renamed components to reflect MQTT integration, and introduced MQTTVacuumCoordinator . |
custom_components/mqtt_vacuum_camera/camera.py |
Replaced ValetudoCamera with MQTTCamera , streamlining camera handling logic and improving modularity. |
custom_components/mqtt_vacuum_camera/camera.py , custom_components/mqtt_vacuum_camera/common.py |
Renamed functions for clarity, including get_device_info to get_vacuum_device_info , and added get_camera_device_info . |
custom_components/mqtt_vacuum_camera/valetudo/MQTT/connector.py , custom_components/mqtt_vacuum_camera/valetudo/hypfer/image_handler.py |
Removed PNG decoding, streamlined data handling, and introduced a new command topic for vacuum commands. |
custom_components/mqtt_vacuum_camera/snapshots/log_files.py , custom_components/mqtt_vacuum_camera/snapshots/snapshot.py , custom_components/mqtt_vacuum_camera/utils/auto_crop.py |
Simplified import statements to enhance readability and maintainability. |
sequenceDiagram
participant User
participant MQTT Coordinator
participant MQTTCamera
participant Data Source
User->>MQTT Coordinator: Request data update
MQTT Coordinator->>Data Source: Fetch data from MQTT topics
Data Source-->>MQTT Coordinator: Return data
MQTT Coordinator-->>MQTTCamera: Update camera state
MQTTCamera-->>User: Display updated camera view
const.py
file, including the removal of MQTT configuration constants and the introduction of a new COLORS
list, which may relate to the enhancements in logging and functionality in the main PR's updates to the MQTT Vacuum Camera integration.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?
@coderabbitai review
The pull request introduces several modifications across various files in the mqtt_vacuum_camera
component. Key changes include enhancements to documentation through added docstrings for methods, the introduction of a new constant list for color identifiers, and the refactoring of import statements from absolute to relative paths. Additionally, some functions were streamlined for improved readability, and color handling was consolidated into dictionaries for better organization. Overall, the changes focus on improving code structure, readability, and maintainability without altering the core functionality.
Files | Change Summary |
---|---|
custom_components/mqtt_vacuum_camera/camera.py |
Added docstrings to _start_up_logs and _init_clear_www_folder methods. |
custom_components/mqtt_vacuum_camera/const.py |
Introduced a new constant COLORS with predefined color identifiers. |
custom_components/mqtt_vacuum_camera/snapshots/log_files.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/snapshots/snapshot.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/utils/auto_crop.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/utils/colors_man.py |
Changed import statement to relative path; added comment to color_array . |
custom_components/mqtt_vacuum_camera/utils/drawable.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/utils/files_operations.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/utils/img_data.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/utils/status_text.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/valetudo/MQTT/connector.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/valetudo/hypfer/image_draw.py |
Changed import statements from absolute to relative paths. |
custom_components/mqtt_vacuum_camera/valetudo/hypfer/image_handler.py |
Refactored color handling in async_get_image_from_json function; changed import statements to relative paths; simplified async_map_coordinates_offset . |
custom_components/mqtt_vacuum_camera/valetudo/rand256/image_handler.py |
Refactored color handling in get_image_from_rrm function; changed import statements to relative paths; simplified _check_robot_position function. |
custom_components/mqtt_vacuum_camera/valetudo/rand256/reimg_draw.py |
Changed import statements to relative paths; simplified control flow in async_draw_zones function. |
[!TIP]
New features
Walkthrough comment now includes: - Possibly related PRs: A list of potentially related PRs to help you recall past context. - Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs. You can also provide custom labeling instructions in the UI or configuration file. Notes: - Please share any feedback in the [discussion post](https://discordapp.com/channels/1134356397673414807/1282535539299323995) on our Discord. - Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).
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?
@coderabbitai full review
@coderabbitai review and approve
@sca075: I will review and approve the changes.
@coderabbitai review and approve
@sca075: I will review and approve the changes.
We need to reduce lines and imports the scope of this PR is to prepare the code to create a package for images handling
Summary by CodeRabbit
New Features
MQTTVacuumCoordinator
for improved data management and communication with MQTT.handle_vacuum_start
event handler for better interactivity with vacuum commands.Bug Fixes
Chores
v2024.10.0b2
to signal a new beta release.