Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LED control menu
#20
The examples of the module are not very comprehensive. I see that an instance of the main class is passed to Menu as a parameter.
I see that you are trying something that I was in about to propose before I hit accidentally Back button of my browser and lost the whole post Big Grin

Pass the instance to the Menu, not the class itself.

menu = Menu(
    structure={
            'Power Options': {
                'Reboot':GraphSysReboot(),
                'Shutdown':GraphSysShutdown(),
                },
            'Aquarium': {
                'Lighting': {
                    'Control': {
                        'On': LC,
                        }
                    }
                },
        'Clock': Clock(backlight),
        'Status': {
            'IP': IPAddress(),
            'CPU': GraphCPU(backlight),
            'Temp': GraphTemp()
        },
        'Settings': {
            'Display': {
                'Contrast': Contrast(lcd),
                'Backlight': Backlight(backlight)
            }
        }
    },
    lcd=lcd,
    idle_handler=LC, # here is the change.
    idle_timeout=30,
    input_handler=Text())
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
LED control menu - by trippyt - May-31-2018, 06:43 AM
RE: LED control menu - by wavic - May-31-2018, 06:59 AM
RE: LED control menu - by trippyt - May-31-2018, 01:55 PM
RE: LED control menu - by trippyt - May-31-2018, 07:22 AM
RE: LED control menu - by wavic - May-31-2018, 09:27 AM
RE: LED control menu - by trippyt - May-31-2018, 11:58 AM
RE: LED control menu - by wavic - May-31-2018, 12:02 PM
RE: LED control menu - by trippyt - May-31-2018, 12:10 PM
RE: LED control menu - by wavic - May-31-2018, 12:49 PM
RE: LED control menu - by wavic - May-31-2018, 02:30 PM
RE: LED control menu - by trippyt - May-31-2018, 02:40 PM
RE: LED control menu - by wavic - May-31-2018, 03:19 PM
RE: LED control menu - by trippyt - May-31-2018, 03:35 PM
RE: LED control menu - by wavic - May-31-2018, 03:42 PM
RE: LED control menu - by trippyt - May-31-2018, 03:51 PM
RE: LED control menu - by wavic - May-31-2018, 04:02 PM
RE: LED control menu - by trippyt - May-31-2018, 04:13 PM
RE: LED control menu - by wavic - May-31-2018, 04:47 PM
RE: LED control menu - by trippyt - May-31-2018, 04:53 PM
RE: LED control menu - by wavic - May-31-2018, 05:18 PM
RE: LED control menu - by trippyt - May-31-2018, 05:45 PM
RE: LED control menu - by trippyt - May-31-2018, 06:58 PM
RE: LED control menu - by wavic - May-31-2018, 07:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Remote control of the Visual Studio 2013 debug menu using Python MariusTo 0 2,511 Jan-17-2018, 04:58 PM
Last Post: MariusTo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020