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

Simplify instance creation API #927

Closed
rytilahti opened this issue May 21, 2024 · 1 comment · Fixed by #936
Closed

Simplify instance creation API #927

rytilahti opened this issue May 21, 2024 · 1 comment · Fixed by #936
Milestone

Comments

@rytilahti
Copy link
Member

Instead of requiring to import Credentials from the kasa package, we should allow creating instances without it.
@sdb9696 suggested to allow passing the username and the password as kwargs, which sounds like a good idea:

from kasa import Discover

dev = Discover.discover_single("127.0.0.1", username="foo", password="bar")
devs = Discover.discover(target="192.168.0.255", username="foo", password="bar")
@rytilahti rytilahti added this to the 0.7.0 milestone May 21, 2024
@sdb9696
Copy link
Collaborator

sdb9696 commented May 24, 2024

#936

sdb9696 added a commit that referenced this issue Jun 5, 2024
## [0.7.0.dev2](https://github.com/python-kasa/python-kasa/tree/0.7.0.dev2) (2024-06-05)

[Full Changelog](0.7.0.dev1...0.7.0.dev2)

**Implemented enhancements:**

- Make device initialisation easier by reducing required imports [\#936](#936) (@sdb9696)

**Fixed bugs:**

- Do not raise on multi-request errors on child devices [\#949](#949) (@rytilahti)
- Do not show a zero error code when cli exits from showing help [\#935](#935) (@rytilahti)
- Initialize autooff features only when data is available [\#933](#933) (@rytilahti)
- Fix P100 errors on multi-requests [\#930](#930) (@sdb9696)

**Documentation updates:**

- Update documentation structure and start migrating to markdown [\#934](#934) (@sdb9696)

**Closed issues:**

- Simplify instance creation API [\#927](#927)

**Merged pull requests:**

- Add P115 fixture [\#950](#950) (@rytilahti)
- Add some device fixtures [\#948](#948) (@rytilahti)
- Add fixture for S505D [\#947](#947) (@rytilahti)
- Fix passing custom port for dump\_devinfo [\#938](#938) (@rytilahti)
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

Successfully merging a pull request may close this issue.

2 participants