Example #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
Example #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
Example #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
Example #4
0
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)
Example #5
0
 def __init__(self,
              host: str,
              protocol: 'TPLinkSmartHomeProtocol' = None) -> None:
     SmartDevice.__init__(self, host, protocol)
     self.emeter_type = "smartlife.iot.common.emeter"
Example #6
0
#!/usr/bin/python3

from pyHS100 import SmartDevice

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

decive.getStatus()
Example #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
Example #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
Example #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
Example #10
0
 def __init__(self,
              host: str,
              protocol: 'TPLinkSmartHomeProtocol' = None,
              context: str = None) -> None:
     SmartDevice.__init__(self, host, protocol, context)
     self._type = "emeter"
Example #11
0
 def __init__(self, ip_address, protocol=None):
     SmartDevice.__init__(self, ip_address, protocol)
     self.emeter_type = "emeter"
     self.emeter_units = False
Example #12
0
 def __init__(self,
              host: str,
              protocol: 'TPLinkSmartHomeProtocol' = None,
              context: str = None) -> None:
     SmartDevice.__init__(self, host, protocol, context)
     self._type = "emeter"