Tabnine Logo For Javascript
Characteristic
Code IndexAdd Tabnine to your IDE (free)

How to use
Characteristic
in
hap-nodejs

Best JavaScript code snippets using hap-nodejs.Characteristic(Showing top 8 results out of 315)

origin: rdmtc/RedMatic-HomeKit

this.on('close', () => {
        this.debug('remove event listeners');

        tvService.getCharacteristic(Characteristic.Active)
          .removeListener('set', setActive);

        tvService.getCharacteristic(Characteristic.ActiveIdentifier)
          .removeListener('set', setActiveIdentifier);

        tvService.getCharacteristic(Characteristic.RemoteKey)
          .removeListener('set', setRemoteKey);

        tvService.getCharacteristic(Characteristic.PowerModeSelection)
          .removeListener('set', setPowerModeSelection);

        speakerService.getCharacteristic(Characteristic.VolumeSelector)
          .removeListener('set', setVolumeSelector);
      });
origin: rdmtc/RedMatic-HomeKit

config.inputsources.forEach((src, i) => {
          const id = i + 1;
          const inputService = acc.addService(Service.InputSource, src.name, src.name);
          inputService
            .setCharacteristic(Characteristic.Identifier, id)
            .setCharacteristic(Characteristic.ConfiguredName, src.name)
            .setCharacteristic(Characteristic.IsConfigured, Characteristic.IsConfigured.CONFIGURED)
            .setCharacteristic(Characteristic.InputSourceType, src.type)
            .setCharacteristic(Characteristic.CurrentVisibilityState, Characteristic.CurrentVisibilityState.SHOWN)
            .setCharacteristic(Characteristic.TargetVisibilityState, Characteristic.TargetVisibilityState.SHOWN);

          tvService.addLinkedService(inputService);
        });
origin: rdmtc/RedMatic-HomeKit

this.on('input', msg => {
          console.log(msg);
          this.debug('update ProgrammableSwitchEvent SINGLE_PRESS');
          doorbellService.getCharacteristic(hap.Characteristic.ProgrammableSwitchEvent).updateValue(0);
        });
origin: norman-thomas/homebridge-particle-io

describe('constructor', () => {
  it('should assign config values to member variables', () => {
   const homebridge = dummyHomebridge(dummyConfig);
   const device = dummyConfig.devices[0];
   const dummyURL = 'https://some.random.url.com/';
   const dummyAccessToken = 'MY_top_SECRET_access_TOKEN';
   const Service = homebridge.hap.Service;
   const Characteristic = homebridge.hap.Characteristic;
   const accessory = new ActorAccessory(
    () => {}, dummyURL, dummyAccessToken, device, homebridge, Service.Lightbulb, Characteristic.On
   );
   accessory.url.should.be.equal(dummyURL);
   accessory.accessToken.should.be.equal(dummyAccessToken);
   accessory.deviceId.should.be.equal(device.device_id);

   accessory.services.should.have.length(2);
   accessory.services[1].should.be.an.instanceOf(Service.Lightbulb);
  });
 });
origin: rdmtc/RedMatic-HomeKit

this.on('input', msg => {
        switch (msg.topic) {
          case 'InputSource': {
            let identifier = msg.payload;
            if (typeof msg.payload === 'string') {
              config.inputsources.forEach((src, i) => {
                if (msg.payload === src.name) {
                  identifier = i + 1;
                }
              });
            }

            if (config.inputsources[identifier - 1]) {
              this.debug('set ActiveIdentifier ' + identifier + ' (payload was ' + msg.payload + ')');
              this.status({shape: 'dot', fill: 'blue', text: config.inputsources[identifier - 1].name});
              tvService.updateCharacteristic(Characteristic.ActiveIdentifier, identifier);
            }

            break;
          }

          default:
            this.debug('set Active ' + msg.payload);
            this.status({shape: msg.payload ? 'dot' : 'ring', fill: msg.payload ? 'blue' : 'grey'});
            tvService.updateCharacteristic(Characteristic.Active, msg.payload ? 1 : 0);
        }
      });
origin: rdmtc/RedMatic-HomeKit

.setCharacteristic(hap.Characteristic.Manufacturer, 'RedMatic')
.setCharacteristic(hap.Characteristic.Model, 'HAP-Nodejs Bridge')
.setCharacteristic(hap.Characteristic.SerialNumber, this.username)
.setCharacteristic(hap.Characteristic.FirmwareRevision, pkg.version);
origin: norman-thomas/homebridge-particle-io

  accessory.deviceId.should.be.equal(device.device_id);
  accessory.ServiceType.should.be.equal(homebridge.hap.Service.HumiditySensor);
  accessory.CharacteristicType.should.be.equal(homebridge.hap.Characteristic.CurrentRelativeHumidity);
 });
});
origin: norman-thomas/homebridge-particle-io

 homebridge,
 Service.HumiditySensor,
 Characteristic.CurrentRelativeHumidity
);
accessory.eventName.should.be.equal(device.event_name);
hap-nodejs(npm)Characteristic

Most used hap-nodejs functions

  • Accessory.Categories
  • Accessory._server
  • Accessory.on
  • Accessory.publish
  • CAMERA
  • Characteristic.ActiveIdentifier,
  • Characteristic.CONFIGURED,
  • Characteristic.ConfiguredName,
  • Characteristic.CurrentRelativeHumidity,
  • Characteristic.CurrentVisibilityState,
  • Characteristic.FirmwareRevision,
  • Characteristic.Identifier,
  • Characteristic.InputSourceType,
  • Characteristic.IsConfigured,
  • Characteristic.Manufacturer,
  • Characteristic.Model,
  • Characteristic.On,
  • Characteristic.PowerModeSelection,
  • Characteristic.ProgrammableSwitchEvent

Popular in JavaScript

  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • minimist
    parse argument options
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • ms
    Tiny millisecond conversion utility
  • http
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now