Giter Site home page Giter Site logo

node-ddcci's Introduction

node-ddcci

Installation

node-ddcci is currently only supported on Windows.

npm install @hensm/ddcci

Usage

const ddcci = require("@hensm/ddcci");

for (const monitor of ddcci.getMonitorList()) {
    console.log(`${monitor} current brightness: ${ddcci.getBrightness(monitor)}`);
    ddcci.setBrightness(monitor, 25);
}

Docs

  • getMonitorList()

    Gets a list of the current connected monitors.

    • Return value

      An array of String containing the monitor IDs.
  • getBrightness(monitorId)

    Queries a monitor's brightness level.

    • Parameters

      • monitorId
        String. ID of monitor for which to query the brightness.
    • Return value

      An integer, typically between 0-100, representing the current brightness.
  • getMaxBrightness(monitorId)

    Queries a monitor's maximum brightness level.

    • Parameters

      • monitorId
        String. ID of monitor for which to query the brightness.
    • Return value

      An integer, typically between 0-100, representing the maximum brightness.
  • setBrightness(monitorId, level)

    Sets a monitor's brightness level.

    • Parameters

      • monitorId
        String. ID of monitor for which to set the brightness.
      • level
        integer. Between 0-100 representing the new brightness level.
  • getContrast(monitorId)

    Queries a monitor's contrast level.

    • Parameters

      • monitorId
        String. ID of monitor for which to query the contrast.
    • Return value

      An integer, typically between 0-100, representing the current contrast.
  • getMaxContrast(monitorId)

    Queries a monitor's maximum contrast level.

    • Parameters

      • monitorId
        String. ID of monitor for which to query the contrast.
    • Return value

      An integer, typically between 0-100, representing the maximum contrast.
  • setContrast(monitorId, level)

    Sets a monitor's contrast level.

    • Parameters

      • monitorId
        String. ID of monitor for which to set the contrast.
      • level
        integer. Between 0-100 representing the new contrast level.
  • _getVCP(monitorId, vcpCode)

    Queries a monitor for a VCP code value.

    • Parameters

      • monitorId
        String. ID of monitor for which to query the VCP feature.
      • vcpCode
        integer. VCP code to query
    • Return value

      An array of two integer values in the format of [currentValue, maxValue].
  • _setVCP(monitorId, vcpCode, value)

    Sets the value of a VCP code for a monitor.

    • Parameters

      • monitorId
        String. ID of monitor for which to set the VCP feature.
      • vcpCode
        integer. VCP code to set.
      • value
        integer. Value of the VCP code.
  • _refresh()

    Refreshes the monitor list.

node-ddcci's People

Contributors

foxt avatar haruny avatar hensm avatar thelmgn avatar xanderfrangos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-ddcci's Issues

Unable to use when running as service

When I'm trying to get the monitor list while running my script as a Windows service I'm getting the following error:

`...\node_modules@hensm\ddcci\node_modules\bindings\bindings.js:88
throw e
^

Error: Failed to get number of physical monitors
at Object.Module._extensions..node (module.js:681:18)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at bindings (...\node_modules@hensm\ddcci\node_modules\bindings\bindings.js:81:44)
at Object. (...\node_modules@hensm\ddcci\index.js:3:34)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)`

Running the script manually works fine. Is there something extra I should do to be able to use it in a service? I'm using node-windows to create the service.

Update package on npm

Your library has been super helpful for my monitor brightness tool, but I noticed your repository and npm package are out of sync. I didn't even see commit 2d3fb14 until I had to fix issues related to identifying monitors. That commit is critical to consistently identifying unique displays and should be on npm.

Thanks for making this library!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.