Skip to content

Commit

Permalink
Bugfix of arne123/RPi-Jukebox-RFID/tree/gpio-control_to_class
Browse files Browse the repository at this point in the history
This update form @arne123 fixes MiczFlor#1320 .
There was still a Bug in the Import of the class function. and here is my commit.
  • Loading branch information
derchan committed Mar 1, 2021
1 parent 9119d3c commit 4cbfa67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

import logging
from evdev import categorize, ecodes, KeyEvent
import components.gpio_control.function_calls
from io_buttons_usb_encoder import button_map, current_device
from components.gpio_control.function_calls import phoniebox_function_calls


logger = logging.getLogger(__name__)

try:
button_map = button_map()
function_calls = phoniebox_function_calls()
for event in current_device().read_loop():
if event.type == ecodes.EV_KEY:
keyevent = categorize(event)
Expand All @@ -23,7 +25,7 @@
try:
function_name = button_map[button_string]
try:
getattr(components.gpio_control.function_calls, function_name)()
getattr(function_calls, function_name)()
except:
logger.warning(
"Function " + function_name + " not found in function_calls.py (mapped from button: " + button_string + ")")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
try:
functions = list(
filter(lambda function_name: function_name.startswith("functionCall"),
dir(components.gpio_control.function_calls)))
dir(components.gpio_control.function_calls.phoniebox_function_calls)))
button_map = {}

print("")
Expand Down

0 comments on commit 4cbfa67

Please sign in to comment.