mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-13 02:48:07 +00:00
Cleanup credentials handling (#605)
* credentials: don't allow none to simplify checks * Implement __bool__ for credentials * Cleanup klaptransport cred usage * Cleanup deviceconfig and tapodevice * fix linting * Pass dummy credentials for tests * Remove __bool__ dunder and add docs to credentials * Check for cred noneness in tapodevice.update()
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
"""Credentials class for username / passwords."""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@dataclass
|
||||
class Credentials:
|
||||
"""Credentials for authentication."""
|
||||
|
||||
username: Optional[str] = field(default="", repr=False)
|
||||
password: Optional[str] = field(default="", repr=False)
|
||||
#: Username (email address) of the cloud account
|
||||
username: str = field(default="", repr=False)
|
||||
#: Password of the cloud account
|
||||
password: str = field(default="", repr=False)
|
||||
|
Reference in New Issue
Block a user