Cleanup constructors by removing ioloop and protocol arguments (#23)

* Cleanup constructors by removing ioloop and protocol

* force kwarg for other arguments besides the host
This commit is contained in:
Teemu R
2020-01-15 07:46:21 +01:00
committed by Bas Nijholt
parent 7eea21f2dd
commit 72d6205ad2
5 changed files with 16 additions and 76 deletions

View File

@@ -3,7 +3,6 @@ import datetime
import logging
from typing import Any, Dict
from kasa.protocol import TPLinkSmartHomeProtocol
from kasa.smartdevice import (
DeviceType,
SmartDevice,
@@ -36,16 +35,8 @@ class SmartPlug(SmartDevice):
and should be handled by the user of the library.
"""
def __init__(
self,
host: str,
protocol: "TPLinkSmartHomeProtocol" = None,
child_id: str = None,
cache_ttl: int = 3,
*,
ioloop=None,
) -> None:
SmartDevice.__init__(self, host, protocol, child_id, cache_ttl, ioloop=ioloop)
def __init__(self, host: str, *, child_id: str = None, cache_ttl: int = 3) -> None:
SmartDevice.__init__(self, host, child_id=child_id, cache_ttl=cache_ttl)
self.emeter_type = "emeter"
self._device_type = DeviceType.Plug