Improve CLI Discovery output (#583)

- Show discovery results for unsupported devices and devices that fail to authenticate.
- Rename `--show-unsupported` to `--verbose`.
- Remove separate `--timeout` parameter from cli discovery so it's not confused with `--timeout` now added to cli command.
- Add tests.
This commit is contained in:
sdb9696
2023-12-19 12:50:33 +00:00
committed by GitHub
parent 2e6c41d039
commit 209391c422
7 changed files with 298 additions and 55 deletions

View File

@@ -291,6 +291,13 @@ class FakeSmartProtocol(SmartProtocol):
def __init__(self, info):
super().__init__("127.0.0.123", transport=FakeSmartTransport(info))
async def query(self, request, retry_count: int = 3):
"""Implement query here so can still patch SmartProtocol.query."""
resp_dict = await self._query(request, retry_count)
if "result" in resp_dict:
return resp_dict["result"]
return {}
class FakeSmartTransport(BaseTransport):
def __init__(self, info):