RASCSI/python/ctrlboard/src/ctrlboard_event_handler/ctrlboard_print_event_handler.py
dependabot[bot] 52e4a92aec
Bump black from 22.8.0 to 24.3.0 in /python/web (#1444)
* Bump black from 22.8.0 to 24.3.0 in /python/web

Bumps [black](https://github.com/psf/black) from 22.8.0 to 24.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.8.0...24.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Github CI: Backend web test runner use python 3.9.19

* Reformat python sources with black

* Docker: Bump to python 3.9-slim image for pytest

* Bump pytest version to 8.1.1

* Bump more library versions, and freeze them

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Markstedt <daniel@mindani.net>
2024-03-22 00:19:13 -07:00

18 lines
665 B
Python

"""Module for test printing events when buttons from the PiSCSI Control Board are pressed"""
import observer
from ctrlboard_hw.hardware_button import HardwareButton
from ctrlboard_hw.encoder import Encoder
# pylint: disable=too-few-public-methods
class CtrlBoardPrintEventHandler(observer.Observer):
"""Class implements a basic event handler that prints button presses from the PiSCSI
Control Board hardware."""
def update(self, updated_object):
if isinstance(updated_object, HardwareButton):
print(updated_object.name + " has been pressed!")
if isinstance(updated_object, Encoder):
print(updated_object.pos)