Class NodePyATVInstance

Default class exported by @sebbo2002/node-pyatv. Use [[find]] to scan for devices in your local network. Use [[device]] to connect to a known device by passing (at least) it's name and IP.

import pyatv from '@sebbo2002/node-pyatv';

Constructors

Methods

  • Scan the network for Apple TVs by using pyatv's atvscript. See [[NodePyATVFindAndInstanceOptions]] for the options allowed. Use the host / hosts attribute to filter by IP addresses. Resolves with an array of [[NodePyATVDevice]].

    import pyatv from '@sebbo2002/node-pyatv';
    const myPyATV = new pyatv({debug: true});
    const devices = await myPyATV.find();
    console.log(devices);

    Parameters

    Returns Promise<NodePyATVDevice[]>

  • Scan the network for Apple TVs by using pyatv's atvscript. See [[NodePyATVFindAndInstanceOptions]] for the options allowed. Use the host / hosts attribute to filter by IP addresses. Resolves with an array of [[NodePyATVDevice]].

    import pyatv from '@sebbo2002/node-pyatv';
    const devices = await pyatv.find();
    console.log(devices);

    Normally node-pyatv ignores error messages if at least one device has been found, but if you always want to receive the error messages, you can set the second argument to true:

    const result = await pyatv.find({}, true);
    console.log(result.devices);
    console.log(result.errors);

    Parameters

    Returns Promise<NodePyATVDevice[]>

  • Parameters

    Returns Promise<NodePyATVFindResponseObject>