@novastar/screen
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.11 • Public • Published

@novastar/screen

Go to API documentation.

Installation:

Using npm:

$ npm install --save @novastar/screen@latest

or yarn:

$ yarn add @novastar/screen@next

Usage:

import ScreenConfigurator from '@novastar/screen';
// const ScreenConfigurator = require('@novastar/screen').default

import net, { findNetDevices } from '@novastar/net';
import serial, { findSendingCards } from '@novastar/serial';

async function main() {
  
  // net
  const [address] = await findNetDevices();
  if (!address) return;
  const session = net.open(address);
  
  // serial
  const [port] = await findSendingCards();
  const session = await serial.open(port.path);
  
  const ctrl = new ScreenConfigurator(session);
  await ctrl.reload();
  // Get input DVI signal status
  const hasDVISignalIn = await ctrl.ReadHasDVISignalIn();
  // Request the brightness of the first receiving card on the screen.
  const firstCardBrightness = await ctrl.ReadFirstBrightness();
  for await (let brightness of ctrl.ReadBrightness()) {
    // Request the brightness of all reseiving cards on the screen using a generator.
  }
  // Write the specified brightness value to all receiving cards.
  await ctrl.WriteBrightness(80);
}

Package Sidebar

Install

npm i @novastar/screen

Weekly Downloads

36

Version

2.0.0-alpha.11

License

MIT

Unpacked Size

915 kB

Total Files

313

Last publish

Collaborators

  • sarakusha