mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +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:
@@ -38,8 +38,8 @@ class TapoDevice(SmartDevice):
|
||||
|
||||
async def update(self, update_children: bool = True):
|
||||
"""Update the device."""
|
||||
if self.credentials is None or self.credentials.username is None:
|
||||
raise AuthenticationException("Tapo plug requires authentication.")
|
||||
if self.credentials is None:
|
||||
raise AuthenticationException("Device requires authentication.")
|
||||
|
||||
if self._components_raw is None:
|
||||
resp = await self.protocol.query("component_nego")
|
||||
|
Reference in New Issue
Block a user