Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Only request the data from the switch that is being used by this inte…
Browse files Browse the repository at this point in the history
…gration (#26)
  • Loading branch information
lyricnz authored May 7, 2023
1 parent fb7642a commit 50491dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion custom_components/tplink_ess/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

class TPLinkESSClient:
"""Representation of a TPLink ESS network switch."""
ACTION_NAMES = {'hostname', 'vlan', 'pvid', 'num_ports', 'stats'}

def __init__(
self,
Expand All @@ -25,7 +26,9 @@ def __init__(
async def async_get_data(self) -> dict:
"""Get data from the API."""
api = TpLinkESS(self._host_mac, self._username, self._password)
return await api.update_data(switch_mac=self._switch_mac)
return await api.update_data(
switch_mac=self._switch_mac,
action_names=TPLinkESSClient.ACTION_NAMES)

async def async_discover_switches(self) -> list:
"""Discover switches and return results."""
Expand Down
4 changes: 2 additions & 2 deletions custom_components/tplink_ess/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"tplink-ess-lib"
],
"requirements": [
"tplink-ess-lib==0.4.3"
"tplink-ess-lib==0.4.5"
],
"version": "0.0.0"
"version": "0.1.2"
}

0 comments on commit 50491dc

Please sign in to comment.