Skip to content

getDevices() is returning only 10 devices #243

@henrykozhaya

Description

@henrykozhaya

I realized that the getDevices() function is only returning 10 devices.
Is there any parameter that should be added in order to return all devices instead?

const getEwelinkConnection = () => {
    const connection = new ewelink({
        email: EWELINK_EMAIL,
        password: EWELINK_PASSWORD,
        region: EWELINK_REGION,
        APP_ID: EWELINK_APP_ID,
        APP_SECRET: EWELINK_APP_SECRET
    });
    return connection;
}

const getEwelinkDevices = async () => {
    const connection = getEwelinkConnection();

    try {
        const devices = await connection.getDevices();
        return devices;
    } catch (error) {
        console.error('Error getting devices:', error);
        throw error; 
    }
}

getEwelinkDevices()
    .then((devices) => {
        console.log(devices.length); // this is returning 10
    })
    .catch((error) => {
        console.error('Error fetching the device:', error);
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions