def __init__(self, host: str, protocol: 'TPLinkSmartHomeProtocol' = None) -> None: SmartPlug.__init__(self, host, protocol) self.emeter_type = "emeter" self.plugs = {} children = self.sys_info["children"] self.num_children = len(children) for plug in range(self.num_children): self.plugs[plug] = SmartPlug(host, protocol, context=children[plug]["id"])
def __init__(self, host: str, protocol: 'TPLinkSmartHomeProtocol' = None) -> None: SmartPlug.__init__(self, host, protocol) self.emeter_type = "emeter" self.plugs = {} children = self.sys_info["children"] self.num_children = len(children) for plug in range(self.num_children): self.plugs[plug] = SmartPlug(host, protocol, context=children[plug]["id"])
def __init__( self, host: str, protocol: TPLinkSmartHomeProtocol = None, cache_ttl: int = 3 ) -> None: SmartPlug.__init__(self, host=host, protocol=protocol, cache_ttl=cache_ttl) self.emeter_type = "emeter" self._device_type = DeviceType.Strip self.plugs = {} children = self.sys_info["children"] self.num_children = len(children) for plug in range(self.num_children): self.plugs[plug] = SmartPlug( host, protocol, context=children[plug]["id"], cache_ttl=cache_ttl )