mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-01 13:48:15 +00:00
General cleanups all around (janitoring) (#63)
* Move tests to device-type specific test files to make improvements more approachable
* protocol: remove the port parameter from query, as there are no other known ports, fix docstrings
* Revise docstrings, remove superfluous information and remove unused methods ({set,get_icon} and set_time)
* cli: indent device output to make it more easily readable when having multiple devices
* remove adjust flake8 ignores (we have no setup.py anymore)
* pyproject: include cli tool to coverage, add config for interrogate (docstring coverage)
* bulb: raise exception on color_temp error cases instead of returning zero values
* improve bulb tests, simplify conftest
* strip: rename plugs property to children and move it to smartdevice
This commit is contained in:
@@ -62,6 +62,7 @@ class _DiscoverProtocol(asyncio.DatagramProtocol):
|
||||
self.transport.sendto(encrypted_req[4:], self.target) # type: ignore
|
||||
|
||||
def datagram_received(self, data, addr) -> None:
|
||||
"""Handle discovery responses."""
|
||||
ip, port = addr
|
||||
if ip in self.discovered_devices:
|
||||
return
|
||||
@@ -82,10 +83,11 @@ class _DiscoverProtocol(asyncio.DatagramProtocol):
|
||||
_LOGGER.error("Received invalid response: %s", info)
|
||||
|
||||
def error_received(self, ex):
|
||||
"""Handle asyncio.Protocol errors."""
|
||||
_LOGGER.error("Got error: %s", ex)
|
||||
|
||||
def connection_lost(self, ex):
|
||||
pass
|
||||
"""NOP implementation of connection lost."""
|
||||
|
||||
|
||||
class Discover:
|
||||
|
||||
Reference in New Issue
Block a user