UniFi - Bandwidth sensors (#27229)

* First draft of UniFi bandwidth sensors

* Clean up

* Add tests for sensors
This commit is contained in:
Robert Svensson authored and Paulus Schoutsen committed 2019-10-06 08:17:40 -07:00
1 parent 6cc71db385
commit c7c88b2b68
10 files changed
+444 -12

No files matched your search

+1 -3
View File
@@ -264,7 +264,7 @@ async def setup_unifi_integration(
async def mock_request(self, method, path, json=None):
mock_requests.append({"method": method, "path": path, "json": json})
print(mock_requests, mock_client_responses, mock_device_responses)
if path == "s/{site}/stat/sta" and mock_client_responses:
return mock_client_responses.popleft()
if path == "s/{site}/stat/device" and mock_device_responses:
@@ -386,8 +386,6 @@ async def test_switches(hass):
assert switch_1 is not None
assert switch_1.state == "on"
assert switch_1.attributes["power"] == "2.56"
assert switch_1.attributes["received"] == 1234
assert switch_1.attributes["sent"] == 5678
assert switch_1.attributes["switch"] == "00:00:00:00:01:01"
assert switch_1.attributes["port"] == 1
assert switch_1.attributes["poe_mode"] == "auto"