def process(self, name, state): name = name.lower() print 'Input is: ' + name + '->' + state if name not in mood_config: print 'No device configuration for: ' + name raise Exception('No device configuration for: ' + name) if state not in mood_config[name]: print 'No state configuration for: ' + name + '->' + state raise Exception('No state configuration for: ' + name + '->' + state) command = mood_config[name][state] dom.set_lwrf_mood(command[0],command[1]) return 'Set mood ' + str(command[1]) + ' in room ' + str(command[0])
def set(self, room, mood): if room not in lwrf_rooms.keys(): raise Exception('Unknown room: ' + room) dom.set_lwrf_mood(lwrf_rooms[room],mood) return 'Set mood ' + mood + ' in room ' + lwrf_rooms[room]