def clear(username, password): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_SUCCESS and username == 'admin': manager.clear(); return constants.CLEAR_SUCCESS; return constants.CLEAR_FAILED;
def get_last_event(username, password): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_FAILED: return login_code; return manager.get_last_event(username, password);
def get_todays_usage(username, password): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_FAILED: return login_code; return manager.get_todays_usage(username, password);
def breakdown(username, password, data_points): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_FAILED: return login_code; return str(manager.get_breakdown(username, data_points));
def last_time_volume(username, password, device): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_FAILED: return login_code; return str(manager.get_last_time_volume(username, device));
def get_event_data_device(username, password, device, data_points): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_FAILED: return login_code; return manager.get_event_data_device(username, device, data_points);
def addevent(username, password, device, start_time, end_time, volume): login_code = manager.login_user(username, password); if login_code == constants.LOGIN_FAILED: return login_code; return manager.add_event(username, device, start_time, end_time, volume);
def login(username, password): return manager.login_user(username, password);