Beispiel #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;
Beispiel #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);
Beispiel #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);
Beispiel #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));
Beispiel #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));
Beispiel #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);
Beispiel #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);
Beispiel #8
0
def login(username, password):
    return manager.login_user(username, password);