Skip to content

Implement clean area#1476

Open
arturpragacz wants to merge 2 commits intoTasshack:devfrom
arturpragacz:clean_area
Open

Implement clean area#1476
arturpragacz wants to merge 2 commits intoTasshack:devfrom
arturpragacz:clean_area

Conversation

@arturpragacz
Copy link
Copy Markdown

Implement support for vacuum.clean_area.

@Tasshack
Copy link
Copy Markdown
Owner

This needs to be implemented with backwards compatibility otherwhise it will break the integration for those are still using an older version of HA.

You will get VacuumEntityFeature.CLEAN_AREA is not defined error and integration won't work.

@arturpragacz
Copy link
Copy Markdown
Author

Good point, but maybe bumping the minimum HA version is a better solution?

@Tasshack
Copy link
Copy Markdown
Owner

Good point, but maybe bumping the minimum HA version is a better solution?

That would be a very bad practice especially support for clean area haven't been released by HA yet.

@Aaroneisele55
Copy link
Copy Markdown

I would be very happy to see this implemented because I currently have a complicated workaround for this including a mapping of segments to room names, and having this natively in HA would be so much better...

@olskar
Copy link
Copy Markdown

olskar commented Mar 16, 2026

Could this work?

from homeassistant.components.vacuum import (
    StateVacuumEntity,
    VacuumEntityFeature,
    ENTITY_ID_FORMAT,
)

try:
    from homeassistant.components.vacuum import Segment
except ImportError:
    # Fallback 
    from dataclasses import dataclass
    @dataclass
    class Segment:
        id: str
        name: str | None = None
        group: str | None = None

SUPPORT_CLEAN_AREA = getattr(VacuumEntityFeature, "CLEAN_AREA", 0)

@berezovskyi-oleksandr
Copy link
Copy Markdown

Hi @Tasshack - friendly bump on this PR.

The two blockers you raised have both been resolved:

  1. "clean_area hasn't been released by HA yet" -> HA 2026.3 is out, VacuumEntityFeature.CLEAN_AREA is officially shipped.
  2. Backwards compatibility -> @olskar already suggested a concrete solution with try/except import + getattr fallback.

At this point it would be great to get a clear signal: is this good to merge as-is, does it need the compatibility wrapper applied, or is there something else blocking? Several people (including issues like #1498) are waiting on this. Thanks!

@jimjaeger
Copy link
Copy Markdown

jimjaeger commented Mar 29, 2026

Hey, great to see that clean area support is on the way. As HA already released the clean_area feature, I would like to see the feature go live asap.

Code looks good and implements all required HA 2026.3 vacuum.clean_area functionality.

  • CLEAN_AREA flag set properly
  • async_get_segments() handles multi-map with composite IDs
  • async_clean_segments() filters by selected map correctly
  • check_segments_changed() + repair issue complete

Backward compatibility issue exists as noted by @Tasshack: VacuumEntityFeature.CLEAN_AREA is not defined (HA <2026.3) @arturpragacz apply @olskar's solution:

Also add some tests:*

  • test_supported_features_clean_area()
  • test_async_get_segments_multi_floor()
  • test_async_clean_segments_selected_map()
  • test_segment_change_detection()

If you need help, let me know.

@Tasshack
Copy link
Copy Markdown
Owner

I am going to merge it when new version of the integration is ready to be released.

@razzietheman
Copy link
Copy Markdown

razzietheman commented Apr 1, 2026

I am going to merge it when new version of the integration is ready to be released.

when do you think that this wonderful update of integration is ready to be released? :)
thz for a great job BTW

@jimjaeger
Copy link
Copy Markdown

Hello, thanks for preparing. When do you plan to release it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants