Use this to apply [[NodePyATVInstanceOptions]] (e.g. debug log method) to all further requests
import pyatv from '@sebbo2002/node-pyatv';
const myPyatv = new pyatv({debug: true});
const devices = myPyatv.find();
console.log(devices);
Checks if pyatv is installed and ready to be used. Will throw an error if not.
Create a [[NodePyATVDevice]] to query the state and control it.
At least host
and name
are required.
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);
Resolves with the version of pyatv and of the module itself. If a value can't be found, null is returned instead.
Static
checkChecks if pyatv is installed and ready to be used. Will throw an error if not.
Static
deviceCreate a [[NodePyATVDevice]] to query the state and control it.
At least host
and name
are required.
Static
findScan 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);
Optional
options: NodePyATVFindAndInstanceOptionsStatic
versionResolves with the version of pyatv and of the module itself. If a value can't be found, null is returned instead.
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.