File: sensor.py

package info (click to toggle)
python-miio 0.5.12-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,888 kB
  • sloc: python: 23,425; makefile: 9
file content (15 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Xiaomi Zigbee sensors."""

import click

from ...click_common import command
from .subdevice import SubDevice


class Vibration(SubDevice):
    """Base class for subdevice vibration sensor."""

    @command(click.argument("vibration_level", type=int))
    def set_vibration_sensitivity(self, vibration_level):
        """Set the sensitivity of the vibration sensor, low = 21, medium = 11, high = 1."""
        return self.set_property("vibration_level", vibration_level).pop()