-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
040be15
commit a9fdd53
Showing
6 changed files
with
43 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,13 @@ Example: | |
See [more examples](https://github.com/mihai-dinculescu/tapo/tree/main/tapo-py/examples). | ||
""" | ||
|
||
from typing import Optional | ||
from .color_light_handler import ColorLightHandler | ||
from .generic_device_handler import GenericDeviceHandler | ||
from .light_handler import LightHandler | ||
from .plug_energy_monitoring_handler import PlugEnergyMonitoringHandler | ||
from .plug_handler import PlugHandler | ||
|
||
|
||
class ApiClient: | ||
"""Tapo API Client. | ||
|
@@ -52,13 +52,13 @@ class ApiClient: | |
See [more examples](https://github.com/mihai-dinculescu/tapo/tree/main/tapo-py/examples). | ||
""" | ||
|
||
def __init__(self, tapo_username: str, tapo_password: str, timeout_secs: int = 10) -> None: | ||
def __init__(self, tapo_username: str, tapo_password: str, timeout_s: int = 30) -> None: | ||
"""Returns a new instance of `ApiClient`. | ||
Args: | ||
tapo_username (str): The Tapo username | ||
tapo_password (str): The Tapo password | ||
timeout_secs (int): connection timeout secs, default value 10secs | ||
tapo_username (str): The Tapo username. | ||
tapo_password (str): The Tapo password. | ||
timeout_s (int): The connection timeout in seconds. The default value is 30 seconds. | ||
Returns: | ||
ApiClient: Tapo API Client. | ||
|
@@ -70,7 +70,7 @@ class ApiClient: | |
async def main(): | ||
client = ApiClient("[email protected]", "tapo-password", 10) | ||
client = ApiClient("[email protected]", "tapo-password") | ||
device = await client.l530("192.168.1.100") | ||
await device.on() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters