示例#1
0
 def __init__(
     self,
     host: str,
     protocol: "TPLinkSmartHomeProtocol" = None,
     context: str = None,
     cache_ttl: int = 3,
 ) -> None:
     SmartDevice.__init__(self, host, protocol, context, cache_ttl)
     self.emeter_type = "emeter"
     self._device_type = DeviceType.Plug
示例#2
0
 def __init__(
     self,
     host: str,
     protocol: TPLinkSmartHomeProtocol = None,
     context: str = None,
     cache_ttl: int = 3,
 ) -> None:
     SmartDevice.__init__(
         self, host=host, protocol=protocol, context=context, cache_ttl=cache_ttl
     )
     self.emeter_type = "smartlife.iot.common.emeter"
     self._device_type = DeviceType.Bulb
示例#3
0
    def __init__(self,
                 host: str,
                 protocol: 'TPLinkSmartHomeProtocol' = None,
                 context: str = None) -> None:
        SmartDevice.__init__(self, host, protocol, context)
        self._type = "emeter"

        #Kaithem Project Customizations to protect the relay_state
        #from wearing out by backing off if we repeat too often

        self.currentDelay = 0.05
        self.lastTransition = 0
示例#4
0
文件: cli.py 项目: dberlin/pyHS100
def raw_command(dev: SmartDevice, module, command, parameters):
    """Run a raw command on the device."""
    import ast

    if parameters is not None:
        parameters = ast.literal_eval(parameters)
    res = dev._query_helper(module, command, parameters)
    click.echo(res)
示例#5
0
 def __init__(self,
              host: str,
              protocol: 'TPLinkSmartHomeProtocol' = None) -> None:
     SmartDevice.__init__(self, host, protocol)
     self.emeter_type = "smartlife.iot.common.emeter"
示例#6
0
#!/usr/bin/python3

from pyHS100 import SmartDevice

device = SmartDevice("192.168.1.178")
print(device.sys_info['model'])

decive.getStatus()
示例#7
0
 def __init__(self,
              ip_address: str,
              protocol: 'TPLinkSmartHomeProtocol' = None) -> None:
     SmartDevice.__init__(self, ip_address, protocol)
     self.emeter_type = "smartlife.iot.common.emeter"
     self.emeter_units = True
示例#8
0
 def __init__(self, ip_address, protocol=None):
     SmartDevice.__init__(self, ip_address, protocol)
     self.emeter_type = "smartlife.iot.common.emeter"
     self.emeter_units = True
示例#9
0
 def __init__(self,
              ip_address: str,
              protocol: 'TPLinkSmartHomeProtocol' = None) -> None:
     SmartDevice.__init__(self, ip_address, protocol)
     self.emeter_type = "emeter"
     self.emeter_units = False
示例#10
0
 def __init__(self,
              host: str,
              protocol: 'TPLinkSmartHomeProtocol' = None,
              context: str = None) -> None:
     SmartDevice.__init__(self, host, protocol, context)
     self._type = "emeter"
示例#11
0
 def __init__(self, ip_address, protocol=None):
     SmartDevice.__init__(self, ip_address, protocol)
     self.emeter_type = "emeter"
     self.emeter_units = False
示例#12
0
 def __init__(self,
              host: str,
              protocol: 'TPLinkSmartHomeProtocol' = None,
              context: str = None) -> None:
     SmartDevice.__init__(self, host, protocol, context)
     self._type = "emeter"