예제 #1
0
 def sockets(self, menu_items):
     MenuItems=[]
     
     icon = icons_url + "_up.png"
     MenuItems.append(('1', 'off', icon, 'Hauptmenü',config['base_url']+'/'))
     
     # Steckdose WZ:
     state = command.get_value('state_socket_1_wz')
     if state :
         text = "[ON]"
         icon = icons_url + "socket-on.png"
         ledstate = "On"
     else:
         text = "[OFF]"
         icon = icons_url + "socket-off.png"
         ledstate = "Off"
     # print(text)
     MenuItems.append(('11', ledstate, icon, 'Steckdose Wohnzimmer: ' + text, config['base_url'] + 'socket/wz'))
     
     # Steckdose AZ:
     state = command.get_value('state_socket_1_az')
     # print("state: " + str(state))
     if state :
         text = "[ON]"
         icon = icons_url + "socket-on.png"
         ledstate = "On"
     else:
         text = "[OFF]"
         icon = icons_url + "socket-off.png"
         ledstate = "Off"
     MenuItems.append(('12', ledstate, icon, 'Steckdose Arbeitszimmer: ' + text, config['base_url'] + 'socket/az'))
     
     # Steckdose SZ:
     state = command.get_value('state_socket_1_sz')
     if state :
         text = "[ON]"
         icon = icons_url + "socket-on.png"
         ledstate = "On"
     else:
         text = "[OFF]"
         icon = icons_url + "socket-off.png"
         ledstate = "Off"
     MenuItems.append(('13', ledstate, icon, 'Steckdose Schlafzimmer: ' + text, config['base_url'] + 'socket/sz'))
     
     icon = icons_url + "socket-off.png"
     MenuItems.append(('1', 'off', icon, 'Alles Aus',config['base_url']+'socket/all/0'))
     icon = icons_url + "socket-on.png"
     MenuItems.append(('1', 'off', icon, 'Alles An',config['base_url']+'socket/all/1'))
     # print MenuItems
     # <Led number="2">On</Led>
     return SnomXML.SnomIPPhoneMenuIconLED(Title = "Steckdosen-Status", MenuItems = MenuItems)
예제 #2
0
 def light(self, menu_items):
     '''
     /light
     '''
     MenuItems=[]
     icon = icons_url + "_up.png"
     MenuItems.append(('1', 'off', icon, 'Hauptmenü',config['base_url']+'/'))
     # Licht WZ:
     state = command.get_value('light_1_wz')
     if state :
         text = "[ON]"
         icon = icons_url + "hue-on.png"
         ledstate = "On"
     else:
         text = "[OFF]"
         icon = icons_url + "hue-off.png"
         ledstate = "Off"
     # print(text)
     MenuItems.append(('5', ledstate, icon, 'Licht Wohnzimmer: ' + text, config['base_url'] + 'light/wz'))
     # Licht AZ:
     state = command.get_value('light_1_az')
     # print("state: " + str(state))
     if state :
         text = "[ON]"
         icon = icons_url + "hue-on.png"
         ledstate = "On"
     else:
         text = "[OFF]"
         icon = icons_url + "hue-off.png"
         ledstate = "Off"
     MenuItems.append(('6', ledstate, icon, 'Licht Arbeitszimmer: ' + text, config['base_url'] + 'light/az'))
     # Licht SZ:
     state = command.get_value('light_1_sz')
     if state :
         text = "[ON]"
         icon = icons_url + "hue-on.png"
         ledstate = "On"
     else:
         text = "[OFF]"
         icon = icons_url + "hue-off.png"
         ledstate = "Off"
     MenuItems.append(('7', ledstate, icon, 'Licht Schlafzimmer: ' + text, config['base_url'] + 'light/sz'))
     icon = icons_url + "hue-off.png"
     MenuItems.append(('1', 'off', icon, 'Alles Aus',config['base_url']+'light/all/0'))
     icon = icons_url + "hue-on.png"
     MenuItems.append(('1', 'off', icon, 'Alles An',config['base_url']+'light/all/1'))
     # print MenuItems
     # <Led number="2">On</Led>
     return SnomXML.SnomIPPhoneMenuIconLED(Title = "Licht-Status", MenuItems = MenuItems)