eero-api 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. eero_api-1.2.4/LICENSE +21 -0
  2. eero_api-1.2.4/PKG-INFO +108 -0
  3. eero_api-1.2.4/README.md +60 -0
  4. eero_api-1.2.4/pyproject.toml +137 -0
  5. eero_api-1.2.4/setup.cfg +4 -0
  6. eero_api-1.2.4/setup.py +4 -0
  7. eero_api-1.2.4/src/eero/__init__.py +25 -0
  8. eero_api-1.2.4/src/eero/__main__.py +6 -0
  9. eero_api-1.2.4/src/eero/api/__init__.py +137 -0
  10. eero_api-1.2.4/src/eero/api/ac_compat.py +49 -0
  11. eero_api-1.2.4/src/eero/api/activity.py +182 -0
  12. eero_api-1.2.4/src/eero/api/auth.py +481 -0
  13. eero_api-1.2.4/src/eero/api/auth_storage.py +301 -0
  14. eero_api-1.2.4/src/eero/api/backup.py +205 -0
  15. eero_api-1.2.4/src/eero/api/base.py +239 -0
  16. eero_api-1.2.4/src/eero/api/blacklist.py +116 -0
  17. eero_api-1.2.4/src/eero/api/burst_reporters.py +88 -0
  18. eero_api-1.2.4/src/eero/api/devices.py +304 -0
  19. eero_api-1.2.4/src/eero/api/diagnostics.py +76 -0
  20. eero_api-1.2.4/src/eero/api/dns.py +251 -0
  21. eero_api-1.2.4/src/eero/api/eeros.py +413 -0
  22. eero_api-1.2.4/src/eero/api/forwards.py +147 -0
  23. eero_api-1.2.4/src/eero/api/insights.py +76 -0
  24. eero_api-1.2.4/src/eero/api/networks.py +469 -0
  25. eero_api-1.2.4/src/eero/api/ouicheck.py +77 -0
  26. eero_api-1.2.4/src/eero/api/password.py +77 -0
  27. eero_api-1.2.4/src/eero/api/profiles.py +361 -0
  28. eero_api-1.2.4/src/eero/api/reservations.py +151 -0
  29. eero_api-1.2.4/src/eero/api/routing.py +77 -0
  30. eero_api-1.2.4/src/eero/api/schedule.py +264 -0
  31. eero_api-1.2.4/src/eero/api/security.py +314 -0
  32. eero_api-1.2.4/src/eero/api/settings.py +77 -0
  33. eero_api-1.2.4/src/eero/api/sqm.py +241 -0
  34. eero_api-1.2.4/src/eero/api/support.py +79 -0
  35. eero_api-1.2.4/src/eero/api/thread.py +77 -0
  36. eero_api-1.2.4/src/eero/api/transfer.py +82 -0
  37. eero_api-1.2.4/src/eero/api/updates.py +76 -0
  38. eero_api-1.2.4/src/eero/client.py +1806 -0
  39. eero_api-1.2.4/src/eero/const.py +52 -0
  40. eero_api-1.2.4/src/eero/exceptions.py +76 -0
  41. eero_api-1.2.4/src/eero/models/__init__.py +40 -0
  42. eero_api-1.2.4/src/eero/models/account.py +35 -0
  43. eero_api-1.2.4/src/eero/models/activity.py +153 -0
  44. eero_api-1.2.4/src/eero/models/device.py +275 -0
  45. eero_api-1.2.4/src/eero/models/diagnostics.py +54 -0
  46. eero_api-1.2.4/src/eero/models/eero.py +239 -0
  47. eero_api-1.2.4/src/eero/models/network.py +165 -0
  48. eero_api-1.2.4/src/eero/models/profile.py +278 -0
  49. eero_api-1.2.4/src/eero/py.typed +0 -0
  50. eero_api-1.2.4/src/eero_api.egg-info/PKG-INFO +108 -0
  51. eero_api-1.2.4/src/eero_api.egg-info/SOURCES.txt +52 -0
  52. eero_api-1.2.4/src/eero_api.egg-info/dependency_links.txt +1 -0
  53. eero_api-1.2.4/src/eero_api.egg-info/requires.txt +15 -0
  54. eero_api-1.2.4/src/eero_api.egg-info/top_level.txt +1 -0
eero_api-1.2.4/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eero API Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: eero-api
3
+ Version: 1.2.4
4
+ Summary: Modern async Python client for Eero network management
5
+ Author: Eero API Contributors
6
+ Maintainer: Eero API Contributors
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/fulviofreitas/eero-api
9
+ Project-URL: Documentation, https://github.com/fulviofreitas/eero-api/wiki
10
+ Project-URL: Repository, https://github.com/fulviofreitas/eero-api
11
+ Project-URL: Changelog, https://github.com/fulviofreitas/eero-api/blob/master/CHANGELOG.md
12
+ Project-URL: Issues, https://github.com/fulviofreitas/eero-api/issues
13
+ Keywords: eero,mesh-wifi,wifi,network,async,asyncio,home-automation,smart-home,api-client,iot
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Home Automation
24
+ Classifier: Topic :: Internet
25
+ Classifier: Topic :: Software Development :: Libraries
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Classifier: Topic :: System :: Networking
28
+ Classifier: Typing :: Typed
29
+ Classifier: Framework :: AsyncIO
30
+ Requires-Python: >=3.12
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ Requires-Dist: aiohttp>=3.8.0
34
+ Requires-Dist: pydantic>=2.0.0
35
+ Requires-Dist: keyring>=23.0.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
38
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
40
+ Requires-Dist: black>=23.0.0; extra == "dev"
41
+ Requires-Dist: isort>=5.12.0; extra == "dev"
42
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
43
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
44
+ Requires-Dist: rich>=13.0.0; extra == "dev"
45
+ Requires-Dist: click>=8.0.0; extra == "dev"
46
+ Requires-Dist: commitizen>=3.0.0; extra == "dev"
47
+ Dynamic: license-file
48
+
49
+ # 🌐 Eero API
50
+
51
+ > Your async Python toolkit for Eero mesh networks ✨
52
+
53
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
55
+
56
+ ## ⚡ Why Eero API?
57
+
58
+ - 🚀 **Async-first** — Non-blocking, blazing fast
59
+ - 🔐 **Secure** — System keyring for credentials
60
+ - 📦 **Type-safe** — Full Pydantic models
61
+ - ⚡ **Smart caching** — Snappy responses
62
+
63
+ ## 📦 Install
64
+
65
+ ```bash
66
+ pip install eero-api
67
+ ```
68
+
69
+ ## 🚀 Quick Start
70
+
71
+ ```python
72
+ import asyncio
73
+ from eero import EeroClient
74
+
75
+ async def main():
76
+ async with EeroClient() as client:
77
+ if not client.is_authenticated:
78
+ await client.login("you@example.com")
79
+ await client.verify(input("Code: "))
80
+
81
+ for network in await client.get_networks():
82
+ print(f"📶 {network.name}: {network.status}")
83
+
84
+ asyncio.run(main())
85
+ ```
86
+
87
+ > 💡 Credentials are auto-saved to your system keyring
88
+
89
+ ## 📚 Docs
90
+
91
+ | Guide | What's inside |
92
+ |-------|---------------|
93
+ | **[📖 Python API](../../wiki/Python-API)** | Full API reference |
94
+ | **[⚙️ Configuration](../../wiki/Configuration)** | Auth & settings |
95
+ | **[🔧 Troubleshooting](../../wiki/Troubleshooting)** | Common fixes |
96
+ | **[🏠 Wiki Home](../../wiki)** | All documentation |
97
+
98
+ ## 🔗 Ecosystem
99
+
100
+ | Project | Description |
101
+ |---------|-------------|
102
+ | **[🖥️ eero-cli](https://github.com/fulviofreitas/eero-cli)** | Terminal interface for Eero networks |
103
+ | **[🛜 eero-ui](https://github.com/fulviofreitas/eero-ui)** | Svelte dashboard for network management |
104
+ | **[📊 eero-prometheus-exporter](https://github.com/fulviofreitas/eero-prometheus-exporter)** | Prometheus metrics for monitoring |
105
+
106
+ ## 📄 License
107
+
108
+ [MIT](LICENSE) — Use it, fork it, build cool stuff 🎉
@@ -0,0 +1,60 @@
1
+ # 🌐 Eero API
2
+
3
+ > Your async Python toolkit for Eero mesh networks ✨
4
+
5
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
7
+
8
+ ## ⚡ Why Eero API?
9
+
10
+ - 🚀 **Async-first** — Non-blocking, blazing fast
11
+ - 🔐 **Secure** — System keyring for credentials
12
+ - 📦 **Type-safe** — Full Pydantic models
13
+ - ⚡ **Smart caching** — Snappy responses
14
+
15
+ ## 📦 Install
16
+
17
+ ```bash
18
+ pip install eero-api
19
+ ```
20
+
21
+ ## 🚀 Quick Start
22
+
23
+ ```python
24
+ import asyncio
25
+ from eero import EeroClient
26
+
27
+ async def main():
28
+ async with EeroClient() as client:
29
+ if not client.is_authenticated:
30
+ await client.login("you@example.com")
31
+ await client.verify(input("Code: "))
32
+
33
+ for network in await client.get_networks():
34
+ print(f"📶 {network.name}: {network.status}")
35
+
36
+ asyncio.run(main())
37
+ ```
38
+
39
+ > 💡 Credentials are auto-saved to your system keyring
40
+
41
+ ## 📚 Docs
42
+
43
+ | Guide | What's inside |
44
+ |-------|---------------|
45
+ | **[📖 Python API](../../wiki/Python-API)** | Full API reference |
46
+ | **[⚙️ Configuration](../../wiki/Configuration)** | Auth & settings |
47
+ | **[🔧 Troubleshooting](../../wiki/Troubleshooting)** | Common fixes |
48
+ | **[🏠 Wiki Home](../../wiki)** | All documentation |
49
+
50
+ ## 🔗 Ecosystem
51
+
52
+ | Project | Description |
53
+ |---------|-------------|
54
+ | **[🖥️ eero-cli](https://github.com/fulviofreitas/eero-cli)** | Terminal interface for Eero networks |
55
+ | **[🛜 eero-ui](https://github.com/fulviofreitas/eero-ui)** | Svelte dashboard for network management |
56
+ | **[📊 eero-prometheus-exporter](https://github.com/fulviofreitas/eero-prometheus-exporter)** | Prometheus metrics for monitoring |
57
+
58
+ ## 📄 License
59
+
60
+ [MIT](LICENSE) — Use it, fork it, build cool stuff 🎉
@@ -0,0 +1,137 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "eero-api"
7
+ version = "1.2.4"
8
+ description = "Modern async Python client for Eero network management"
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "Eero API Contributors"},
14
+ ]
15
+ maintainers = [
16
+ {name = "Eero API Contributors"},
17
+ ]
18
+ keywords = [
19
+ "eero",
20
+ "mesh-wifi",
21
+ "wifi",
22
+ "network",
23
+ "async",
24
+ "asyncio",
25
+ "home-automation",
26
+ "smart-home",
27
+ "api-client",
28
+ "iot",
29
+ ]
30
+ classifiers = [
31
+ "Development Status :: 4 - Beta",
32
+ "Intended Audience :: Developers",
33
+ "Intended Audience :: System Administrators",
34
+ "License :: OSI Approved :: MIT License",
35
+ "Operating System :: OS Independent",
36
+ "Programming Language :: Python :: 3",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Programming Language :: Python :: 3.13",
39
+ "Programming Language :: Python :: 3.14",
40
+ "Topic :: Home Automation",
41
+ "Topic :: Internet",
42
+ "Topic :: Software Development :: Libraries",
43
+ "Topic :: Software Development :: Libraries :: Python Modules",
44
+ "Topic :: System :: Networking",
45
+ "Typing :: Typed",
46
+ "Framework :: AsyncIO",
47
+ ]
48
+ dependencies = [
49
+ "aiohttp>=3.8.0",
50
+ "pydantic>=2.0.0",
51
+ "keyring>=23.0.0",
52
+ ]
53
+
54
+ [project.optional-dependencies]
55
+ dev = [
56
+ "pytest>=7.0.0",
57
+ "pytest-asyncio>=0.21.0",
58
+ "pytest-cov>=4.0.0",
59
+ "black>=23.0.0",
60
+ "isort>=5.12.0",
61
+ "mypy>=1.0.0",
62
+ "ruff>=0.1.0",
63
+ # Testing dependencies
64
+ "rich>=13.0.0",
65
+ "click>=8.0.0",
66
+ # Optional: for interactive commit messages (cz commit)
67
+ "commitizen>=3.0.0",
68
+ ]
69
+
70
+ [project.urls]
71
+ Homepage = "https://github.com/fulviofreitas/eero-api"
72
+ Documentation = "https://github.com/fulviofreitas/eero-api/wiki"
73
+ Repository = "https://github.com/fulviofreitas/eero-api"
74
+ Changelog = "https://github.com/fulviofreitas/eero-api/blob/master/CHANGELOG.md"
75
+ Issues = "https://github.com/fulviofreitas/eero-api/issues"
76
+
77
+ [tool.setuptools.packages.find]
78
+ where = ["src"]
79
+
80
+ [tool.setuptools.package-data]
81
+ eero = ["py.typed"]
82
+
83
+ [tool.black]
84
+ line-length = 100
85
+ target-version = ["py312"]
86
+
87
+ [tool.isort]
88
+ profile = "black"
89
+ line_length = 100
90
+
91
+ [tool.mypy]
92
+ python_version = "3.12"
93
+ warn_return_any = false
94
+ warn_unused_configs = true
95
+ ignore_missing_imports = true
96
+ check_untyped_defs = false
97
+ disallow_untyped_defs = false
98
+ no_implicit_optional = false
99
+
100
+ [tool.ruff]
101
+ line-length = 100
102
+ target-version = "py312"
103
+
104
+ [tool.ruff.lint]
105
+ select = ["E", "F", "B", "W", "I"]
106
+ ignore = [
107
+ "E501", # Line too long - handled by black
108
+ "B904", # raise-without-from-inside-except - existing code pattern
109
+ ]
110
+
111
+ [tool.pytest.ini_options]
112
+ testpaths = ["tests"]
113
+ asyncio_mode = "auto"
114
+
115
+ # ===========================================================================
116
+ # Commitizen Configuration (for interactive commit messages)
117
+ # ===========================================================================
118
+ # Usage: cz commit
119
+ # This provides a guided interface for creating Conventional Commits
120
+ # ===========================================================================
121
+
122
+ [tool.commitizen]
123
+ name = "cz_conventional_commits"
124
+ version = "1.2.4"
125
+ version_files = [
126
+ "pyproject.toml:project.version",
127
+ "src/eero/__init__.py:__version__",
128
+ ]
129
+ tag_format = "v$version"
130
+ style = [
131
+ ["qmark", "fg:#ff9d00 bold"],
132
+ ["question", "bold"],
133
+ ["answer", "fg:#ff9d00 bold"],
134
+ ["pointer", "fg:#ff9d00 bold"],
135
+ ["highlighted", "fg:#ff9d00 bold"],
136
+ ["selected", "fg:#cc5454"],
137
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ """Backwards compatibility shim for pip install -e ."""
2
+ from setuptools import setup
3
+
4
+ setup()
@@ -0,0 +1,25 @@
1
+ """Eero API - Async Python client for Eero mesh WiFi networks."""
2
+
3
+ from .api import EeroAPI
4
+ from .client import EeroClient
5
+ from .exceptions import (
6
+ EeroAPIException,
7
+ EeroAuthenticationException,
8
+ EeroException,
9
+ EeroNetworkException,
10
+ EeroRateLimitException,
11
+ EeroTimeoutException,
12
+ )
13
+
14
+ __all__ = [
15
+ "EeroAPI",
16
+ "EeroClient",
17
+ "EeroException",
18
+ "EeroAPIException",
19
+ "EeroAuthenticationException",
20
+ "EeroNetworkException",
21
+ "EeroRateLimitException",
22
+ "EeroTimeoutException",
23
+ ]
24
+
25
+ __version__ = "1.2.4"
@@ -0,0 +1,6 @@
1
+ """Command-line entry point for the Eero API package."""
2
+
3
+ from .cli.main import cli
4
+
5
+ if __name__ == "__main__":
6
+ cli()
@@ -0,0 +1,137 @@
1
+ """API module for Eero."""
2
+
3
+ from typing import Optional
4
+
5
+ from aiohttp import ClientSession
6
+
7
+ from .ac_compat import ACCompatAPI
8
+ from .activity import ActivityAPI
9
+ from .auth import AuthAPI
10
+ from .backup import BackupAPI
11
+ from .blacklist import BlacklistAPI
12
+ from .burst_reporters import BurstReportersAPI
13
+ from .devices import DevicesAPI
14
+ from .diagnostics import DiagnosticsAPI
15
+ from .dns import DnsAPI
16
+ from .eeros import EerosAPI
17
+ from .forwards import ForwardsAPI
18
+ from .insights import InsightsAPI
19
+ from .networks import NetworksAPI
20
+ from .ouicheck import OUICheckAPI
21
+ from .password import PasswordAPI
22
+ from .profiles import ProfilesAPI
23
+ from .reservations import ReservationsAPI
24
+ from .routing import RoutingAPI
25
+ from .schedule import ScheduleAPI
26
+ from .security import SecurityAPI
27
+ from .settings import SettingsAPI
28
+ from .sqm import SqmAPI
29
+ from .support import SupportAPI
30
+ from .thread import ThreadAPI
31
+ from .transfer import TransferAPI
32
+ from .updates import UpdatesAPI
33
+
34
+
35
+ class EeroAPI:
36
+ """API client for interacting with the Eero API."""
37
+
38
+ def __init__(
39
+ self,
40
+ session: Optional[ClientSession] = None,
41
+ cookie_file: Optional[str] = None,
42
+ use_keyring: bool = True,
43
+ ) -> None:
44
+ """Initialize the EeroAPI.
45
+
46
+ Args:
47
+ session: Optional aiohttp ClientSession to use for requests
48
+ cookie_file: Optional path to a file for storing authentication cookies
49
+ use_keyring: Whether to use keyring for secure token storage
50
+ """
51
+ self.auth = AuthAPI(session, cookie_file, use_keyring)
52
+ self.activity = ActivityAPI(self.auth)
53
+ self.backup = BackupAPI(self.auth)
54
+ self.dns = DnsAPI(self.auth)
55
+ self.networks = NetworksAPI(self.auth)
56
+ self.devices = DevicesAPI(self.auth)
57
+ self.eeros = EerosAPI(self.auth)
58
+ self.profiles = ProfilesAPI(self.auth)
59
+ self.schedule = ScheduleAPI(self.auth)
60
+ self.security = SecurityAPI(self.auth)
61
+ self.sqm = SqmAPI(self.auth)
62
+ self.diagnostics = DiagnosticsAPI(self.auth)
63
+ self.settings = SettingsAPI(self.auth)
64
+ self.updates = UpdatesAPI(self.auth)
65
+ self.insights = InsightsAPI(self.auth)
66
+ self.routing = RoutingAPI(self.auth)
67
+ self.thread = ThreadAPI(self.auth)
68
+ self.support = SupportAPI(self.auth)
69
+ self.blacklist = BlacklistAPI(self.auth)
70
+ self.reservations = ReservationsAPI(self.auth)
71
+ self.forwards = ForwardsAPI(self.auth)
72
+ self.transfer = TransferAPI(self.auth)
73
+ self.burst_reporters = BurstReportersAPI(self.auth)
74
+ self.ac_compat = ACCompatAPI(self.auth)
75
+ self.ouicheck = OUICheckAPI(self.auth)
76
+ self.password = PasswordAPI(self.auth)
77
+
78
+ async def __aenter__(self) -> "EeroAPI":
79
+ """Enter async context manager."""
80
+ await self.auth.__aenter__()
81
+ return self
82
+
83
+ async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
84
+ """Exit async context manager."""
85
+ await self.auth.__aexit__(exc_type, exc_val, exc_tb)
86
+
87
+ @property
88
+ def is_authenticated(self) -> bool:
89
+ """Check if the client is authenticated."""
90
+ return self.auth.is_authenticated
91
+
92
+ async def login(self, user_identifier: str) -> bool:
93
+ """Start the login process by requesting a verification code.
94
+
95
+ Args:
96
+ user_identifier: Email address or phone number for the Eero account
97
+
98
+ Returns:
99
+ True if login request was successful
100
+ """
101
+ return await self.auth.login(user_identifier)
102
+
103
+ async def verify(self, verification_code: str) -> bool:
104
+ """Verify login with the code sent to the user.
105
+
106
+ Args:
107
+ verification_code: The verification code sent to the user
108
+
109
+ Returns:
110
+ True if verification was successful
111
+ """
112
+ return await self.auth.verify(verification_code)
113
+
114
+ async def logout(self) -> bool:
115
+ """Log out from the Eero API.
116
+
117
+ Returns:
118
+ True if logout was successful
119
+ """
120
+ return await self.auth.logout()
121
+
122
+ def set_preferred_network(self, network_id: str) -> None:
123
+ """Set the preferred network ID to use for requests.
124
+
125
+ Args:
126
+ network_id: ID of the network to use
127
+ """
128
+ self.auth.preferred_network_id = network_id
129
+
130
+ @property
131
+ def preferred_network_id(self) -> Optional[str]:
132
+ """Get the preferred network ID.
133
+
134
+ Returns:
135
+ Preferred network ID or None
136
+ """
137
+ return self.auth.preferred_network_id
@@ -0,0 +1,49 @@
1
+ """AC Compatibility API for Eero."""
2
+
3
+ import logging
4
+ from typing import Any, Dict
5
+
6
+ from ..const import API_ENDPOINT
7
+ from ..exceptions import EeroAuthenticationException
8
+ from .auth import AuthAPI
9
+ from .base import AuthenticatedAPI
10
+
11
+ _LOGGER = logging.getLogger(__name__)
12
+
13
+
14
+ class ACCompatAPI(AuthenticatedAPI):
15
+ """AC Compatibility API for Eero."""
16
+
17
+ def __init__(self, auth_api: AuthAPI) -> None:
18
+ """Initialize the ACCompatAPI.
19
+
20
+ Args:
21
+ auth_api: Authentication API instance
22
+ """
23
+ super().__init__(auth_api, API_ENDPOINT)
24
+
25
+ async def get_ac_compat(self, network_id: str) -> Dict[str, Any]:
26
+ """Get AC compatibility information.
27
+
28
+ Args:
29
+ network_id: ID of the network to get AC compatibility info for
30
+
31
+ Returns:
32
+ AC compatibility data
33
+
34
+ Raises:
35
+ EeroAuthenticationException: If not authenticated
36
+ EeroAPIException: If the API returns an error
37
+ """
38
+ auth_token = await self._auth_api.get_auth_token()
39
+ if not auth_token:
40
+ raise EeroAuthenticationException("Not authenticated")
41
+
42
+ _LOGGER.debug(f"Getting AC compatibility for network {network_id}")
43
+
44
+ response = await self.get(
45
+ f"networks/{network_id}/ac_compat",
46
+ auth_token=auth_token,
47
+ )
48
+
49
+ return response.get("data", {})