VacuumZones icon indicating copy to clipboard operation
VacuumZones copied to clipboard

vacuum.py: set unique_id

Open stek29 opened this issue 10 months ago • 5 comments

fix #17

stek29 avatar Jan 21 '25 01:01 stek29

There is no point in taking hash from name if we use name in unique_id anyway.

AlexxIT avatar Jan 21 '25 09:01 AlexxIT

There is no point in taking hash from name if we use name in unique_id anyway.

What if there are “Bathroom” and “bathroom”? The ID goes through slugify.

stek29 avatar Jan 22 '25 10:01 stek29

In both cases, the ID will already be unique.

AlexxIT avatar Jan 22 '25 10:01 AlexxIT

@AlexxIT

>>> from homeassistant.util import slugify
>>> slugify('living-room') == slugify('living_room')
True
>>> slugify('Bathroom') == slugify('bathroom')
True

stek29 avatar Jan 22 '25 22:01 stek29

@AlexxIT I just realized that it's possible to have just the hash in the unique_id, would that be better?

stek29 avatar Feb 02 '25 22:02 stek29