I can not figure out how to tuck the devices into sub menus under the rooms.

*** begine code ***

import os
import sys
import menu
import config

from gui import ConfirmBox
from item import Item
from plugin import MainMenuPlugin

class HomeAutomationItem(Item):
rooms=[]
def __init__(self, parent):
Item.__init__(self,parent)
self.name = _( 'Home Automation' )
def actions(self):
items = [(self.createMenu, _('Home Automation'))]
return items
def createMenu(self, arg=None, menuw=None):
ha_menu_items=[]
for room in config.HA_ITEMS:
ha_site_item = HomeAutomationItem(self)
ha_site_item.name = room[0]
ha_site_item.url = room[1]
rooms=config.HA_ITEMS.index
ha_site_item.location_index = config.HA_ITEMS.index(room)
ha_menu_items += [ ha_site_item ]
ha_menu=menu.Menu("Home Automation", ha_menu_items,self.createDeviceMenu)
menuw.pushmenu(ha_menu)
menuw.refresh()
def createDeviceMenu(self, arg=None, menuw=None):
ha_menu_items=[]
ha_menu_items+=[menu.MenuItem(self.rooms)]
ha_menu=menu.Menu(self.rooms, ha_menu_items)
menuw.pushmenu(ha_menu)
menuw.refresh()
return
def createControlMenu(self, arg=None, menuw=None):
ha_c_menu_items=[]


               ha_c_menu=menu.Menu("Control", ha_c_menu_items)
               menuw.pushmenu(ha_c_menu)
               menuw.refresh()

class PluginInterface(MainMenuPlugin):
  def items(self, parent):
       return [ HomeAutomationItem(parent) ]




------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Freevo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to