Source code for switchbot_utility.switchbot_motion_sensor

from .battery_mixin import BatteryMixin
from .switchbot_device import SwitchbotDevice


[docs]class SwitchbotMotionSensor(SwitchbotDevice, BatteryMixin): """Switchbot Motion Sensor class""" def __init__(self, deviceId): """Constructor""" super().__init__(deviceId)
[docs] def get_move_detected(self) -> str: """Returns if move detected""" status = self.get_status() return status["moveDetected"]
[docs] def get_brightness(self) -> str: """Returns ambient brightness picked up by the sensor""" status = self.get_status() return status["brightness"]