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

Add deCONZ entities in a predicitive order #11712

Merged

Conversation

Kane610
Copy link
Member

@Kane610 Kane610 commented Jan 16, 2018

Description:

deCONZ generates devices with multiple sensors with the same name, hass will load these in the random order the dict gets listed in which makes it hard to use entities in any way.

Related issue:
fixes #11642, fixes #11697

Checklist:

  • The code change is tested and works locally.

@tinloaf
Copy link
Contributor

tinloaf commented Jan 16, 2018

The keys in the dict are deterministic for each physical device? I still think it's not optimal: If you add a device and that becomes the first device in sorted(devices.keys()), then the entity IDs of all other devices change… Can't we somehow generate entity IDs from whatever is in keys()?

@Kane610
Copy link
Member Author

Kane610 commented Jan 16, 2018

It doesn't really matter between devices, the only thing you want is that the order of loading entities doesn't change between sensors belonging to the same device, and that shouldn't change. This is just a small fix, I still want people to name their sensors uniquely. But Im not 100% how to solve that in HASS.

@Kane610 Kane610 force-pushed the deconz-predictive-order-creating-entities branch from 7913fe9 to 747fa7e Compare January 17, 2018 11:23
@MartinHjelmare MartinHjelmare changed the title deCONZ - Make sure that entities names are created in a predicitive order Add deCONZ entities in a predicitive order Jan 17, 2018
@Kane610 Kane610 force-pushed the deconz-predictive-order-creating-entities branch from 747fa7e to 874b9c4 Compare January 17, 2018 21:59
@balloob
Copy link
Member

balloob commented Jan 18, 2018

Naming will be solved in #11533 👍

@balloob balloob merged commit 8bcaf83 into home-assistant:dev Jan 18, 2018
@Kane610
Copy link
Member Author

Kane610 commented Jan 18, 2018

Thanks @balloob looking forward to the registry!

@balloob balloob mentioned this pull request Jan 26, 2018
@Kane610 Kane610 deleted the deconz-predictive-order-creating-entities branch January 31, 2018 21:25
@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deCONZ motion sensor / binary sensor fails Deconz component switches entities
5 participants