示例#1
0
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;
示例#2
0
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);
示例#3
0
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);
示例#4
0
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));
示例#5
0
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));
示例#6
0
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);
示例#7
0
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);
示例#8
0
def login(username, password):
    return manager.login_user(username, password);