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

Service "clean_config" not documented #34

Closed
bcutter opened this issue Apr 2, 2023 · 4 comments
Closed

Service "clean_config" not documented #34

bcutter opened this issue Apr 2, 2023 · 4 comments

Comments

@bcutter
Copy link

bcutter commented Apr 2, 2023

I am wondering what the service clean_config actually does. It calls stick.clean_config but no idea what that function actually does.

Let's just put it in https://github.com/gluap/pyduofern-hacs#usage as the other services are too.

  • What does it do?
  • Is it safe to use? (or will something important permanently get deleted)
  • ...?

I started to see some "ghost covers/devices" after using service: duofern.sync_devices at 2023-03-24 (and corresponding new entities and devices as updated to 0.5.3 today) and was wondering if that service could remove them.

@gluap
Copy link
Owner

gluap commented Apr 2, 2023

I added documentation with 0.5.5. (in the service description) It should do what you think:

the duofern python module keeps a list of devices that are paired. clean_config throws that list away.

In normal operation, the list should rebuild itself - whenever a message is received from a device that was previously paired it should appear in the list.

Warning
You should absolutely NOT use it if you have been running duofern for a long time and your covers have "human" names in the .duofern.json file. That option hasn't been used for a long time though - it is still from the time when homeassistant had no UI way of renaming entities/devices.

It's not very well tested because it's not a common situation. I ran it, restarted homeassistant, and my devices became available again after a few seconds.

@bcutter
Copy link
Author

bcutter commented Apr 2, 2023

OK, that warning is helpful. Indeed I gave all my covers (entities and now also devices) custom names... I'm not happy having to rename all of them again. But as a last option if 0.5.5 does not work around the ask_for_update with all: true issue or other things appear, I now know this service can be used - so it does exactly what it's name says 😃

Update: read it twice. I was talking about the entity registry, the warning aims at duofern.json. In that file I never changed anything. Still wondering, why it has almost 400 lines with soooooooo many devices actually not existing.

I tend to close this issue for the initial documentation cause, but still not confident enough using that service... -.-

@bcutter
Copy link
Author

bcutter commented Apr 2, 2023

Update: ran the service. The only thing it changed (prior to restarting HA) was:

it wiped the "system_code" section at the EOF out of it, the curious long "devices" array/list is unchanged.


Update after HA restart (before that I put the system_code section back in, just to be safe):
nothing changed. The crazy long devices list is created by duoFERN (stick or software?). Still can not get rid of my ghost devices, at least not by using the duofern.clean_config service.

@bcutter
Copy link
Author

bcutter commented Apr 5, 2023

See #36 for following up on the ghost devices issue.

This issue is "fixed" as the docs have been updated regarding the clean_config service so let's close this one.

@bcutter bcutter closed this as completed Apr 5, 2023
This issue was closed.
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

2 participants