Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
super().__init__(device_description, proxy, resolveparamsets)
# init metadata
self.BINARYNODE.update({"MOTION": [1]})
self.ATTRIBUTENODE.update({"ERROR_CODE": [0]})
def is_motion(self, channel=None):
""" Return True if motion is detected """
return bool(self.getBinaryData("MOTION", channel))
@property
def ELEMENT(self):
return [0, 1]
class RemoteMotion(SensorHm, Remote):
"""Motion detection with buttons.
This is a binary sensor."""
def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)
# init metadata
self.BINARYNODE.update({"MOTION": [3]})
self.SENSORNODE.update({"BRIGHTNESS": [3]})
def is_motion(self, channel=None):
""" Return True if motion is detected """
return bool(self.getBinaryData("MOTION", channel))
def get_brightness(self, channel=None):
""" Return brightness from 0 (dark ) to 255 (bright) """
if "RC-19" in self.TYPE or "HM-PB-4Dis-WM" in self.TYPE:
return list(range(1, 20))
if "HMW-IO-4-FM" in self.TYPE:
return [1, 2, 3, 4]
if "HmIP-RC8" in self.TYPE:
return [1, 2, 3, 4, 5, 6, 7, 8]
if "HmIP-WRCD" in self.TYPE:
return [1, 2, 3]
return [1]
class RemoteBatteryIP(Remote, HelperLowBatIP):
"""Battery operated HomeMaticIP remote device."""
class RemoteBattery(Remote, HelperLowBat):
"""Battery operated HomeMatic remote device."""
class RemotePress(HMEvent, HelperEventPress, HelperActionPress):
"""Remote handle buttons."""
@property
def ELEMENT(self):
return [1, 2, 3]
class RemotePressBattery(HMEvent, HelperEventPress, HelperActionPress, HelperLowBat):
"""Remote handle buttons."""
@property
def ELEMENT(self):
if "RC-12" in self.TYPE:
return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
if "HM-OU-LED16" in self.TYPE:
return list(range(1, 16))
if "RC-19" in self.TYPE or "HM-PB-4Dis-WM" in self.TYPE:
return list(range(1, 20))
if "HMW-IO-4-FM" in self.TYPE:
return [1, 2, 3, 4]
if "HmIP-RC8" in self.TYPE:
return [1, 2, 3, 4, 5, 6, 7, 8]
if "HmIP-WRCD" in self.TYPE:
return [1, 2, 3]
return [1]
class RemoteBatteryIP(Remote, HelperLowBatIP):
"""Battery operated HomeMaticIP remote device."""
class RemoteBattery(Remote, HelperLowBat):
"""Battery operated HomeMatic remote device."""
class RemotePress(HMEvent, HelperEventPress, HelperActionPress):
"""Remote handle buttons."""
@property
def ELEMENT(self):
return [1, 2, 3]
class RemotePressBattery(HMEvent, HelperEventPress, HelperActionPress, HelperLowBat):
self.SENSORNODE.update({"BRIGHTNESS": [3]})
def is_motion(self, channel=None):
""" Return True if motion is detected """
return bool(self.getBinaryData("MOTION", channel))
def get_brightness(self, channel=None):
""" Return brightness from 0 (dark ) to 255 (bright) """
return int(self.getSensorData("BRIGHTNESS", channel))
@property
def ELEMENT(self):
return [1, 2]
class IPRemoteMotionV2(Remote, MotionIPV2):
"""Motion detection with buttons (hm ip).
This is a binary sensor."""
# pylint: disable=useless-super-delegation
def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)
class LuxSensor(SensorHm):
"""Sensor for messure LUX."""
def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)
# init metadata
self.SENSORNODE.update({"LUX": [1]})
"HM-PB-2-WM55-2": Remote,
"HM-PB-2-WM55": Remote,
"HM-PBI-4-FM": Remote,
"HM-PBI-X": Remote,
"HM-Dis-WM55": Remote,
"HM-Dis-EP-WM55": Remote,
"HM-MOD-EM-8": Remote,
"RC-H": Remote,
"BRC-H": Remote,
"atent": Remote,
"ZEL STG RM WT 2": Remote,
"ZEL STG RM HS 4": Remote,
"ZEL STG RM FST UP4": Remote,
"263 145": Remote,
"263 135": Remote,
"HM-OU-LED16": Remote,
"HM-PB-4Dis-WM": Remote,
"HM-PB-4Dis-WM-2": Remote,
"HMW-IO-4-FM": Remote,
"HMIP-WRC2": RemoteBatteryIP,
"HmIP-WRC2": RemoteBatteryIP,
"HmIP-BRC2": Remote,
"HmIP-WRC6": RemoteBatteryIP,
"HmIP-WRCD": RemoteBatteryIP,
"HmIP-KRCA": Remote,
"HmIP-KRC4": Remote,
"HM-SwI-3-FM": RemotePress,
"ZEL STG RM FSS UP3": RemotePress,
"263 144": RemotePress,
"HM-SwI-X": RemotePress,
"HMW-RCV-50": RemoteVirtual,
"HmIP-RCV-50": RemoteVirtual,