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

Remove device lookup by name or number #1636

Open
farmio opened this issue Jan 8, 2025 · 0 comments
Open

Remove device lookup by name or number #1636

farmio opened this issue Jan 8, 2025 · 0 comments

Comments

@farmio
Copy link
Member

farmio commented Jan 8, 2025

def __getitem__(self, key: str | int) -> Device:

await xknx.devices["TestOutlet"].set_on()
would only work as long as devices name attributes are unique - which we don't check anywhere.
Lookup by number doesn't have any real use imho.

I think it would be ok to remove this functionality in the future as it is safer for an application using it to just keep a reference to the object.
If anyone has objections, please let us know.

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

No branches or pull requests

1 participant