mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-23 07:01:22 +00:00
Make device port configurable (#471)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Module for smart plugs (HS100, HS110, ..)."""
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from kasa.modules import Antitheft, Cloud, Schedule, Time, Usage
|
||||
from kasa.smartdevice import DeviceType, SmartDevice, requires_update
|
||||
@@ -37,8 +37,8 @@ class SmartPlug(SmartDevice):
|
||||
For more examples, see the :class:`SmartDevice` class.
|
||||
"""
|
||||
|
||||
def __init__(self, host: str) -> None:
|
||||
super().__init__(host)
|
||||
def __init__(self, host: str, *, port: Optional[int] = None) -> None:
|
||||
super().__init__(host, port=port)
|
||||
self._device_type = DeviceType.Plug
|
||||
self.add_module("schedule", Schedule(self, "schedule"))
|
||||
self.add_module("usage", Usage(self, "schedule"))
|
||||
|
||||
Reference in New Issue
Block a user