__init__.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. LIGHT_RED: int
  2. '''
  3. Constant value for the red LED light.
  4. '''
  5. LIGHT_GREEN: int
  6. '''
  7. Constant value for the green LED light.
  8. '''
  9. LIGHT_BLUE: int
  10. '''
  11. Constant value for the blue LED light.
  12. '''
  13. LIGHT_BACKLIGHT: int
  14. '''
  15. Constant value for the display backlight.
  16. '''
  17. def light_set(light: int, brightness: int) -> None:
  18. '''
  19. Control the RGB LED on your Flipper. You can also set the brightness of multiple channels at once using bitwise operations.
  20. The ``brightness`` parameter accepts values from 0 (light off) to 255 (very bright).
  21. :param light: The RGB channels to set.
  22. :param brightness: The brightness to use.
  23. :Example:
  24. >>> import flipperzero as f0
  25. >>> f0.light_set(f0.LIGHT_RED | f0.LIGHT_GREEN, 250)
  26. .. tip::
  27. You can use up to seven colors using `additive mixing <https://en.wikipedia.org/wiki/Additive_color>`_.
  28. '''
  29. pass
  30. def light_blink_start(light: int, brightness: int, on_time: int, period: int) -> None:
  31. '''
  32. Let the RGB LED blink. You can define the total duration of a blink period and the duration, the LED is active during a blink period.
  33. Hence, ``on_time`` must be smaller than ``period``. This is a non-blocking operation. The LED will continue to blink until you call :func:`light_blink_stop`.
  34. :param light: The RGB channels to set.
  35. :param brightness: The brightness to use.
  36. :param on_time: The LED's active duration in milliseconds.
  37. :param period: Total duration of a blink period in milliseconds.
  38. :Example:
  39. >>> import flipperzero as f0
  40. >>> f0.light_blink_start(f0.LIGHT_RED, 150, 100, 200)
  41. '''
  42. pass
  43. def light_blink_set_color(light: int) -> None:
  44. '''
  45. Change the RGB LED's color while blinking. This is a non-blocking operation.
  46. Be aware, that you must start the blinking procedure first by using the :func:`light_blink_start` function.
  47. Call the :func:`light_blink_stop` function to stop the blinking LED.
  48. :param light: The RGB channels to set.
  49. '''
  50. pass
  51. def light_blink_stop() -> None:
  52. '''
  53. Stop the blinking LED.
  54. '''
  55. pass
  56. def vibro_set(state: bool) -> bool:
  57. '''
  58. Turn vibration on or off. This is a non-blocking operation. The vibration motor will continue to run until you stop it.
  59. :param state: ``True`` to turn on vibration.
  60. :returns: ``True`` if vibration is on.
  61. '''
  62. pass