Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting the IP address or Status when I do a listDevicesByType #4

Closed
bigandy opened this issue Feb 15, 2021 · 3 comments
Closed

Comments

@bigandy
Copy link

bigandy commented Feb 15, 2021

Is there any way of getting the IP address or status when I run a listDevicesByType?

I get this back:

Screenshot 2021-02-15 at 08 30 53

@dickydoouk
Copy link
Owner

Annoyingly the local ip address is not returned by the cloud methods listDevices/listDevicesByType. Although there is a loginDevice function which converts the deviceMac to local ip using the local-devices library.

const devices = await listDevicesByType(cloudToken, 'SMART.TAPOPLUG');
    
    const smartPlug = devices[0];

    const deviceToken = await loginDevice(email, password, smartPlug);
    const getDeviceInfoResponse = await getDeviceInfo(deviceToken);
    console.log(getDeviceInfoResponse);

This uses a function within the code base called resolveMacToIp in network-tools.ts

Hope that gives you what you are looking for.

@dickydoouk
Copy link
Owner

Have added some extra documentation to the README to document this functionality

@bigandy
Copy link
Author

bigandy commented Feb 16, 2021

@dickydoouk thanks for this it is just what I needed.

@bigandy bigandy closed this as completed Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants