1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-10-23 09:30:00 +00:00

Feature(escpos) Add buzzer function (#535)

* Add buzzer function
* Add `buzzer(time, duration)` function to control the buzzer on supported
   printers.
* Add unit tests for buzzer function.
* Update test_function_buzzer.py to pass black
* Run black in tests files
---------

Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
This commit is contained in:
Alfredo orozco
2023-07-27 11:10:19 -06:00
committed by GitHub
parent 9ff327d967
commit df9e8ff394
5 changed files with 81 additions and 0 deletions

View File

@@ -63,6 +63,9 @@ PAPER_PART_CUT = _CUT_PAPER(b"\x01") #: Partial cut paper
# Beep (please note that the actual beep sequence may differ between devices)
BEEP = b"\x07"
# Internal buzzer (only supported printers)
BUZZER = ESC + b"\x42"
# Panel buttons (e.g. the FEED button)
_PANEL_BUTTON = lambda n: ESC + b"c5" + six.int2byte(n)
PANEL_BUTTON_ON = _PANEL_BUTTON(0) # enable all panel buttons