Module to send commands to an Arduino based on a time table.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
479 B

import os
from . import run_application
def check_icon(icon_name):
own_path = os.path.abspath(__file__)
own_dir = os.path.dirname(own_path)
icon_path = os.path.join(own_dir, 'appicons', icon_name)
if os.path.isfile(icon_path):
return icon_path
return None
def run_magnetic_trap():
arduino_commands = {'open': 'o', 'close': 'c'}
icon = check_icon('Household-Mouse-Trap.ico')
run_application(arduino_commands, "It's a trap!", icon=icon)