Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object names with a dash "-" are not exported correctly #8

Open
SunilKhusal opened this issue Mar 15, 2022 · 9 comments
Open

Object names with a dash "-" are not exported correctly #8

SunilKhusal opened this issue Mar 15, 2022 · 9 comments

Comments

@SunilKhusal
Copy link

Thank you for a great card. It work wonderfully but picked up a fault.

This is just an observation that you may wish to correct. I had object names with dashes e.g.: downlight - lounge1, downlight - lounge2, downlight - lounge3, etc., were imported into Hass as a number and not as words, so all my downlights had the same number (61). I then removed all the dashes "-" and the names were correctly exported, so I could group all the downlights in the rooms correctly.

@adizanni
Copy link
Owner

I'm looking into it

@adizanni
Copy link
Owner

adizanni commented Apr 4, 2022

In fact after further research, I've seen that the object writer coming with Sweerhome3d is applying this rule to the accepted character of the object name:

if (!(car >= 'a' && car <= 'z'
|| car >= 'A' && car <= 'Z'
|| car >= '0' && car <= '9'
|| car == '_' ) {
return false;
}

as OBJ is a portable format I prefer not to change the default behaviour.

I suggest you replace the dash ('-') with underscore ('_') for the object names in Sweethome3d.

Let me know if you see any trouble to that.

@adizanni
Copy link
Owner

Please acknowledge, I will not fix this as it is working as expected (obj standard), if you can find evidences of the fact that it is a bug I will out it in the fix list.

@SunilKhusal
Copy link
Author

SunilKhusal commented Apr 13, 2022

Like I said that it was just an observation, as I just changed the names without the dashes. Maybe you should mention this on your instructions.

Thank you,

@Draganis
Copy link

I saw the same behaviour on objects that have german umlauts in it, like ä ö ü ß. Unfortunately that means every door for they are "Tür" in german.

@adizanni
Copy link
Owner

Yes this is because the export to HASS plugin only supports character in the range a-z A-Z 0-9, this is to preserve compatibility with the waterfront standard

@Draganis
Copy link

You could just replace all invalid characters with _ using a regex replace

@adizanni
Copy link
Owner

Yes but then you may end up having trouble with uniqueness of the names

@Draganis
Copy link

I think that you can make a change in the getName() function of the furniture class that is referenced in

furniturenode.setName(level+((HomeFurnitureGroup) item).getName()+"_"+furniture.getName());

Or is the referenced class provided by sweethome3D?

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

No branches or pull requests

3 participants