diff --git a/jest.config.js b/jest.config.js index 5da30ff81..eee1665b7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,6 +4,8 @@ module.exports = { coverageReporters: ["lcov"], collectCoverageFrom: [ "src/**", - "!src/accessories/**" + "!src/accessories/**", + "!src/lib/definitions/generate-definitions.ts", + "!src/lib/definitions/generator-configuration.ts" ], }; diff --git a/package-lock.json b/package-lock.json index 006cdc958..5fc687fe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1699,6 +1699,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", + "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", diff --git a/package.json b/package.json index 306c8e21b..50a6de630 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@types/debug": "^4.1.5", "@types/jest": "^26.0.14", "@types/node": "^10.17.20", + "commander": "^6.1.0", "jest": "^26.5.2", "rimraf": "^3.0.2", "semver": "^7.3.2", diff --git a/src/accessories/AirConditioner_accessory.ts b/src/accessories/AirConditioner_accessory.ts index d63dbc015..09c92399f 100644 --- a/src/accessories/AirConditioner_accessory.ts +++ b/src/accessories/AirConditioner_accessory.ts @@ -51,7 +51,6 @@ ACTest.on(AccessoryEventTypes.IDENTIFY, (paired: boolean, callback: VoidCallback }); // Add the actual Fan Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` const FanService = ACTest.addService(Service.Fan, "Blower"); // services exposed to the user should have "names" like "Fake Light" for us FanService.getCharacteristic(Characteristic.On)! diff --git a/src/accessories/Fan_accessory.ts b/src/accessories/Fan_accessory.ts index 028bb9bd1..b7e17b8b0 100644 --- a/src/accessories/Fan_accessory.ts +++ b/src/accessories/Fan_accessory.ts @@ -56,7 +56,6 @@ fan.on(AccessoryEventTypes.IDENTIFY, (paired: boolean, callback: VoidCallback) = }); // Add the actual Fan Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` fan .addService(Service.Fan, "Fan") // services exposed to the user should have "names" like "Fake Light" for us .getCharacteristic(Characteristic.On)! diff --git a/src/accessories/Light_accessory.ts b/src/accessories/Light_accessory.ts index 6ab9657c1..fb6d01264 100644 --- a/src/accessories/Light_accessory.ts +++ b/src/accessories/Light_accessory.ts @@ -104,7 +104,6 @@ lightAccessory.on(AccessoryEventTypes.IDENTIFY, (paired: boolean, callback: Void }); // Add the actual Lightbulb Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` lightAccessory .addService(Service.Lightbulb, LightController.name) // services exposed to the user should have "names" like "Light" for this case .getCharacteristic(Characteristic.On)! diff --git a/src/accessories/Lock_accessory.ts b/src/accessories/Lock_accessory.ts index 688cad685..2e708e4b0 100644 --- a/src/accessories/Lock_accessory.ts +++ b/src/accessories/Lock_accessory.ts @@ -56,7 +56,6 @@ lock.on(AccessoryEventTypes.IDENTIFY, (paired, callback) => { const service = new Service.LockMechanism("Fake Lock"); // Add the actual Door Lock Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` service.getCharacteristic(Characteristic.LockTargetState) .on(CharacteristicEventTypes.SET, (value, callback) => { diff --git a/src/accessories/Outlet_accessory.ts b/src/accessories/Outlet_accessory.ts index fd4e682fa..3e56634c7 100644 --- a/src/accessories/Outlet_accessory.ts +++ b/src/accessories/Outlet_accessory.ts @@ -67,7 +67,6 @@ outlet.on(AccessoryEventTypes.IDENTIFY, function(paired: boolean, callback: Void }); // Add the actual outlet Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` outlet .addService(Service.Outlet, "Fake Outlet") // services exposed to the user should have "names" like "Fake Light" for us .getCharacteristic(Characteristic.On)! diff --git a/src/accessories/SmartSpeaker_accessory.ts b/src/accessories/SmartSpeaker_accessory.ts index 70ee33530..079e79b72 100644 --- a/src/accessories/SmartSpeaker_accessory.ts +++ b/src/accessories/SmartSpeaker_accessory.ts @@ -3,11 +3,12 @@ import { Categories, Characteristic, CharacteristicEventTypes, - CharacteristicGetCallback, CharacteristicSetCallback, CharacteristicValue, + CharacteristicGetCallback, + CharacteristicSetCallback, + CharacteristicValue, Service, uuid } from ".."; -import {CurrentMediaState, TargetMediaState} from "../lib/gen/HomeKit-TV"; const speakerUUID = uuid.generate('hap-nodejs:accessories:smart-speaker'); const speaker = exports.accessory = new Accessory('SmartSpeaker', speakerUUID); @@ -20,8 +21,8 @@ speaker.category = Categories.SPEAKER; const service = new Service.SmartSpeaker('Smart Speaker', ''); -let currentMediaState: number = CurrentMediaState.PAUSE; -let targetMediaState: number = TargetMediaState.PAUSE; +let currentMediaState: number = Characteristic.CurrentMediaState.PAUSE; +let targetMediaState: number = Characteristic.TargetMediaState.PAUSE; // ConfigureName is used to listen for Name changes inside the Home App. // A device manufacturer would probably need to adjust the name of the device in the AirPlay 2 protocol (or something) diff --git a/src/accessories/Sprinkler_accessory.ts b/src/accessories/Sprinkler_accessory.ts index 5829b518b..027947063 100644 --- a/src/accessories/Sprinkler_accessory.ts +++ b/src/accessories/Sprinkler_accessory.ts @@ -45,7 +45,6 @@ sprinkler.pincode = "123-44-567"; sprinkler.category = Categories.SPRINKLER; // Add the actual Valve Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` const sprinklerService = sprinkler.addService(Service.Valve, "💦 Sprinkler"); diff --git a/src/accessories/TV_accessory.ts b/src/accessories/TV_accessory.ts index 28e55abac..f6a74696e 100644 --- a/src/accessories/TV_accessory.ts +++ b/src/accessories/TV_accessory.ts @@ -29,7 +29,6 @@ tv.pincode = "031-45-154"; tv.category = Categories.TELEVISION; // Add the actual TV Service and listen for change events from iOS. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` const televisionService = tv.addService(Service.Television, "Television", "Television"); televisionService diff --git a/src/accessories/TemperatureSensor_accessory.ts b/src/accessories/TemperatureSensor_accessory.ts index 1f12a86c3..38574c9bc 100644 --- a/src/accessories/TemperatureSensor_accessory.ts +++ b/src/accessories/TemperatureSensor_accessory.ts @@ -31,7 +31,6 @@ sensor.pincode = "031-45-154"; sensor.category = Categories.SENSOR; // Add the actual TemperatureSensor Service. -// We can see the complete list of Services and Characteristics in `lib/gen/HomeKit.ts` sensor .addService(Service.TemperatureSensor)! .getCharacteristic(Characteristic.CurrentTemperature)! diff --git a/src/index.ts b/src/index.ts index b2266bd3e..614f85fb2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import "source-map-support/register"; // registering node-source-map-support for typescript stack traces -import './lib/gen'; +import './lib/definitions'; // must be loaded before Characteristic and Service class import * as accessoryLoader from './lib/AccessoryLoader'; import * as uuidFunctions from './lib/util/uuid'; import * as legacyTypes from './accessories/types'; @@ -17,7 +17,6 @@ export * from './lib/AccessoryLoader'; export * from './lib/camera'; export * from './lib/tv/AccessControlManagement'; export * from './lib/HAPServer'; -export * from './lib/gen'; export * from './lib/datastream'; export * from './lib/controller'; diff --git a/src/lib/Accessory.spec.ts b/src/lib/Accessory.spec.ts index 60ebffdb4..c46b66e07 100644 --- a/src/lib/Accessory.spec.ts +++ b/src/lib/Accessory.spec.ts @@ -1,4 +1,3 @@ -import './gen'; import { Accessory, Categories, diff --git a/src/lib/Accessory.ts b/src/lib/Accessory.ts index d5bb881ba..6070426fc 100644 --- a/src/lib/Accessory.ts +++ b/src/lib/Accessory.ts @@ -42,16 +42,6 @@ import { ControllerType, isSerializableController, } from "./controller"; -import * as HomeKitTypes from "./gen"; -import { - CameraEventRecordingManagement, - CameraOperatingMode, - CameraRTPStreamManagement, - ContactSensorState, - MotionDetected, - ProgrammableSwitchEvent, -} from "./gen/HomeKit"; -import { ButtonEvent } from "./gen/HomeKit-Remote"; import { AccessoriesCallback, AddPairingCallback, @@ -659,8 +649,8 @@ export class Accessory extends EventEmitter { // we try here to be as good as possibly of keeping current behaviour cameraSource.services.forEach(service => { - if (service.UUID === CameraRTPStreamManagement.UUID || service.UUID === CameraOperatingMode.UUID - || service.UUID === CameraEventRecordingManagement.UUID) { + if (service.UUID === Service.CameraRTPStreamManagement.UUID || service.UUID === Service.CameraOperatingMode.UUID + || service.UUID === Service.CameraRecordingManagement.UUID) { return; // ignore those services, as they get replaced by the RTPStreamManagement } @@ -1414,7 +1404,7 @@ export class Accessory extends EventEmitter { data.perms = characteristic.props.perms; } if (request.includeType) { - data.type = toShortForm(this.UUID, HomeKitTypes.BASE_UUID); + data.type = toShortForm(this.UUID); } if (request.includeEvent) { data.ev = connection.hasEventNotifications(id.aid, id.iid); @@ -1730,8 +1720,8 @@ export class Accessory extends EventEmitter { } const uuid = change.characteristic.UUID; - const immediateDelivery = uuid === ButtonEvent.UUID || uuid === ProgrammableSwitchEvent.UUID - || uuid === MotionDetected.UUID || uuid === ContactSensorState.UUID; + const immediateDelivery = uuid === Characteristic.ButtonEvent.UUID || uuid === Characteristic.ProgrammableSwitchEvent.UUID + || uuid === Characteristic.MotionDetected.UUID || uuid === Characteristic.ContactSensorState.UUID; this._server.sendEventNotifications(accessory.aid, change.characteristic.iid, change.newValue, change.originator, immediateDelivery); } diff --git a/src/lib/Characteristic.spec.ts b/src/lib/Characteristic.spec.ts index ae91226c8..89156aaa3 100644 --- a/src/lib/Characteristic.spec.ts +++ b/src/lib/Characteristic.spec.ts @@ -10,7 +10,6 @@ import { Units, uuid } from '..'; -import './gen'; function createCharacteristic(type: Formats, customUUID?: string): Characteristic { return new Characteristic('Test', customUUID || uuid.generate('Foo'), { format: type, perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] }); diff --git a/src/lib/Characteristic.ts b/src/lib/Characteristic.ts index 0e6b498a4..8314e4efa 100644 --- a/src/lib/Characteristic.ts +++ b/src/lib/Characteristic.ts @@ -3,7 +3,223 @@ import createDebug from "debug"; import { EventEmitter } from "events"; import { CharacteristicJsonObject } from "../internal-types"; import { CharacteristicValue, Nullable, VoidCallback, } from '../types'; -import * as HomeKitTypes from './gen'; +import { + AccessControlLevel, + AccessoryFlags, + AccessoryIdentifier, + Active, + ActiveIdentifier, + ActivityInterval, + AdministratorOnlyAccess, + AirParticulateDensity, + AirParticulateSize, + AirQuality, + AppMatchingIdentifier, + AudioFeedback, + BatteryLevel, + Brightness, + ButtonEvent, + CameraOperatingModeIndicator, + CarbonDioxideDetected, + CarbonDioxideLevel, + CarbonDioxidePeakLevel, + CarbonMonoxideDetected, + CarbonMonoxideLevel, + CarbonMonoxidePeakLevel, + CCAEnergyDetectThreshold, + CCASignalDetectThreshold, + CharacteristicValueActiveTransitionCount, + CharacteristicValueTransitionControl, + ChargingState, + ClosedCaptions, + ColorTemperature, + ConfiguredName, + ContactSensorState, + CoolingThresholdTemperature, + CurrentAirPurifierState, + CurrentAmbientLightLevel, + CurrentDoorState, + CurrentFanState, + CurrentHeaterCoolerState, + CurrentHeatingCoolingState, + CurrentHorizontalTiltAngle, + CurrentHumidifierDehumidifierState, + CurrentMediaState, + CurrentPosition, + CurrentRelativeHumidity, + CurrentSlatState, + CurrentTemperature, + CurrentTiltAngle, + CurrentTransport, + CurrentVerticalTiltAngle, + CurrentVisibilityState, + DataStreamHAPTransport, + DataStreamHAPTransportInterrupt, + DiagonalFieldOfView, + DigitalZoom, + DisplayOrder, + EventRetransmissionMaximum, + EventSnapshotsActive, + EventTransmissionCounters, + FilterChangeIndication, + FilterLifeLevel, + FirmwareRevision, + HardwareRevision, + HeartBeat, + HeatingThresholdTemperature, + HoldPosition, + HomeKitCameraActive, + Hue, + Identifier, + Identify, + ImageMirroring, + ImageRotation, + InputDeviceType, + InputSourceType, + InUse, + IsConfigured, + LeakDetected, + ListPairings, + LockControlPoint, + LockCurrentState, + LockLastKnownAction, + LockManagementAutoSecurityTimeout, + LockPhysicalControls, + LockTargetState, + Logs, + MACRetransmissionMaximum, + MACTransmissionCounters, + ManagedNetworkEnable, + ManuallyDisabled, + Manufacturer, + MaximumTransmitPower, + Model, + MotionDetected, + Mute, + Name, + NetworkAccessViolationControl, + NetworkClientProfileControl, + NetworkClientStatusControl, + NightVision, + NitrogenDioxideDensity, + ObstructionDetected, + OccupancyDetected, + On, + OperatingStateResponse, + OpticalZoom, + OutletInUse, + OzoneDensity, + PairingFeatures, + PairSetup, + PairVerify, + PasswordSetting, + PeriodicSnapshotsActive, + PictureMode, + Ping, + PM10Density, + PM2_5Density, + PositionState, + PowerModeSelection, + ProductData, + ProgrammableSwitchEvent, + ProgrammableSwitchOutputState, + ProgramMode, + ReceivedSignalStrengthIndication, + ReceiverSensitivity, + RecordingAudioActive, + RelativeHumidityDehumidifierThreshold, + RelativeHumidityHumidifierThreshold, + RelayControlPoint, + RelayEnabled, + RelayState, + RemainingDuration, + RemoteKey, + ResetFilterIndication, + RotationDirection, + RotationSpeed, + RouterStatus, + Saturation, + SecuritySystemAlarmType, + SecuritySystemCurrentState, + SecuritySystemTargetState, + SelectedAudioStreamConfiguration, + SelectedCameraRecordingConfiguration, + SelectedRTPStreamConfiguration, + SerialNumber, + ServiceLabelIndex, + ServiceLabelNamespace, + SetDuration, + SetupDataStreamTransport, + SetupEndpoints, + SetupTransferTransport, + SignalToNoiseRatio, + SiriInputType, + SlatType, + SleepDiscoveryMode, + SleepInterval, + SmokeDetected, + SoftwareRevision, + StatusActive, + StatusFault, + StatusJammed, + StatusLowBattery, + StatusTampered, + StreamingStatus, + SulphurDioxideDensity, + SupportedAudioRecordingConfiguration, + SupportedAudioStreamConfiguration, + SupportedCameraRecordingConfiguration, + SupportedCharacteristicValueTransitionConfiguration, + SupportedDataStreamTransportConfiguration, + SupportedDiagnosticsSnapshot, + SupportedRouterConfiguration, + SupportedRTPConfiguration, + SupportedTransferTransportConfiguration, + SupportedVideoRecordingConfiguration, + SupportedVideoStreamConfiguration, + SwingMode, + TargetAirPurifierState, + TargetControlList, + TargetControlSupportedConfiguration, + TargetDoorState, + TargetFanState, + TargetHeaterCoolerState, + TargetHeatingCoolingState, + TargetHorizontalTiltAngle, + TargetHumidifierDehumidifierState, + TargetMediaState, + TargetPosition, + TargetRelativeHumidity, + TargetTemperature, + TargetTiltAngle, + TargetVerticalTiltAngle, + TargetVisibilityState, + TemperatureDisplayUnits, + ThirdPartyCameraActive, + ThreadControlPoint, + ThreadNodeCapabilities, + ThreadOpenThreadVersion, + ThreadStatus, + TransmitPower, + TunnelConnectionTimeout, + TunneledAccessoryAdvertising, + TunneledAccessoryConnected, + TunneledAccessoryStateNumber, + ValveType, + Version, + VideoAnalysisActive, + VOCDensity, + Volume, + VolumeControlType, + VolumeSelector, + WakeConfiguration, + WANConfigurationList, + WANStatusList, + WaterLevel, + WiFiCapabilities, + WiFiConfigurationControl, + WiFiSatelliteStatus, +} from "./definitions"; import { HAPStatus } from "./HAPServer"; import { IdentifierCache } from './model/IdentifierCache'; import { clone } from "./util/clone"; @@ -259,231 +475,228 @@ export class Characteristic extends EventEmitter { // @ts-expect-error static Perms = Perms; - static AccessControlLevel: typeof HomeKitTypes.Generated.AccessControlLevel; - static AccessoryFlags: typeof HomeKitTypes.Generated.AccessoryFlags; - static AccessoryIdentifier: typeof HomeKitTypes.Bridged.AccessoryIdentifier; - static Active: typeof HomeKitTypes.Generated.Active; - static ActiveIdentifier: typeof HomeKitTypes.TV.ActiveIdentifier; - static AdministratorOnlyAccess: typeof HomeKitTypes.Generated.AdministratorOnlyAccess; - static AirParticulateDensity: typeof HomeKitTypes.Generated.AirParticulateDensity; - static AirParticulateSize: typeof HomeKitTypes.Generated.AirParticulateSize; - static AirQuality: typeof HomeKitTypes.Generated.AirQuality; - static AppMatchingIdentifier: typeof HomeKitTypes.Bridged.AppMatchingIdentifier; - static AudioFeedback: typeof HomeKitTypes.Generated.AudioFeedback; - static BatteryLevel: typeof HomeKitTypes.Generated.BatteryLevel; - static Brightness: typeof HomeKitTypes.Generated.Brightness; - static ButtonEvent: typeof HomeKitTypes.Remote.ButtonEvent; - static CarbonDioxideDetected: typeof HomeKitTypes.Generated.CarbonDioxideDetected; - static CarbonDioxideLevel: typeof HomeKitTypes.Generated.CarbonDioxideLevel; - static CarbonDioxidePeakLevel: typeof HomeKitTypes.Generated.CarbonDioxidePeakLevel; - static CarbonMonoxideDetected: typeof HomeKitTypes.Generated.CarbonMonoxideDetected; - static CarbonMonoxideLevel: typeof HomeKitTypes.Generated.CarbonMonoxideLevel; - static CarbonMonoxidePeakLevel: typeof HomeKitTypes.Generated.CarbonMonoxidePeakLevel; - static Category: typeof HomeKitTypes.Bridged.Category; - static ChargingState: typeof HomeKitTypes.Generated.ChargingState; - static ClosedCaptions: typeof HomeKitTypes.TV.ClosedCaptions; - static ColorTemperature: typeof HomeKitTypes.Generated.ColorTemperature; - static ConfigureBridgedAccessory: typeof HomeKitTypes.Bridged.ConfigureBridgedAccessory; - static ConfigureBridgedAccessoryStatus: typeof HomeKitTypes.Bridged.ConfigureBridgedAccessoryStatus; - static ConfiguredName: typeof HomeKitTypes.TV.ConfiguredName; - static ContactSensorState: typeof HomeKitTypes.Generated.ContactSensorState; - static CoolingThresholdTemperature: typeof HomeKitTypes.Generated.CoolingThresholdTemperature; - static CurrentAirPurifierState: typeof HomeKitTypes.Generated.CurrentAirPurifierState; - static CurrentAmbientLightLevel: typeof HomeKitTypes.Generated.CurrentAmbientLightLevel; - static CurrentDoorState: typeof HomeKitTypes.Generated.CurrentDoorState; - static CurrentFanState: typeof HomeKitTypes.Generated.CurrentFanState; - static CurrentHeaterCoolerState: typeof HomeKitTypes.Generated.CurrentHeaterCoolerState; - static CurrentHeatingCoolingState: typeof HomeKitTypes.Generated.CurrentHeatingCoolingState; - static CurrentHorizontalTiltAngle: typeof HomeKitTypes.Generated.CurrentHorizontalTiltAngle; - static CurrentHumidifierDehumidifierState: typeof HomeKitTypes.Generated.CurrentHumidifierDehumidifierState; - static CurrentMediaState: typeof HomeKitTypes.TV.CurrentMediaState; - static CurrentPosition: typeof HomeKitTypes.Generated.CurrentPosition; - static CurrentRelativeHumidity: typeof HomeKitTypes.Generated.CurrentRelativeHumidity; - static CurrentSlatState: typeof HomeKitTypes.Generated.CurrentSlatState; - static CurrentTemperature: typeof HomeKitTypes.Generated.CurrentTemperature; - static CurrentTiltAngle: typeof HomeKitTypes.Generated.CurrentTiltAngle; - static CurrentTime: typeof HomeKitTypes.Bridged.CurrentTime; - static CurrentVerticalTiltAngle: typeof HomeKitTypes.Generated.CurrentVerticalTiltAngle; - static CurrentVisibilityState: typeof HomeKitTypes.TV.CurrentVisibilityState; - static DayoftheWeek: typeof HomeKitTypes.Bridged.DayoftheWeek; - static DigitalZoom: typeof HomeKitTypes.Generated.DigitalZoom; - static DiscoverBridgedAccessories: typeof HomeKitTypes.Bridged.DiscoverBridgedAccessories; - static DiscoveredBridgedAccessories: typeof HomeKitTypes.Bridged.DiscoveredBridgedAccessories; - static DisplayOrder: typeof HomeKitTypes.TV.DisplayOrder; - static FilterChangeIndication: typeof HomeKitTypes.Generated.FilterChangeIndication; - static FilterLifeLevel: typeof HomeKitTypes.Generated.FilterLifeLevel; - static FirmwareRevision: typeof HomeKitTypes.Generated.FirmwareRevision; - static HardwareRevision: typeof HomeKitTypes.Generated.HardwareRevision; - static HeatingThresholdTemperature: typeof HomeKitTypes.Generated.HeatingThresholdTemperature; - static HoldPosition: typeof HomeKitTypes.Generated.HoldPosition; - static Hue: typeof HomeKitTypes.Generated.Hue; - static Identifier: typeof HomeKitTypes.TV.Identifier; - static Identify: typeof HomeKitTypes.Generated.Identify; - static ImageMirroring: typeof HomeKitTypes.Generated.ImageMirroring; - static ImageRotation: typeof HomeKitTypes.Generated.ImageRotation; - static InUse: typeof HomeKitTypes.Generated.InUse; - static InputDeviceType: typeof HomeKitTypes.TV.InputDeviceType; - static InputSourceType: typeof HomeKitTypes.TV.InputSourceType; - static IsConfigured: typeof HomeKitTypes.Generated.IsConfigured; - static LeakDetected: typeof HomeKitTypes.Generated.LeakDetected; - static LinkQuality: typeof HomeKitTypes.Bridged.LinkQuality; - static LockControlPoint: typeof HomeKitTypes.Generated.LockControlPoint; - static LockCurrentState: typeof HomeKitTypes.Generated.LockCurrentState; - static LockLastKnownAction: typeof HomeKitTypes.Generated.LockLastKnownAction; - static LockManagementAutoSecurityTimeout: typeof HomeKitTypes.Generated.LockManagementAutoSecurityTimeout; - static LockPhysicalControls: typeof HomeKitTypes.Generated.LockPhysicalControls; - static LockTargetState: typeof HomeKitTypes.Generated.LockTargetState; - static Logs: typeof HomeKitTypes.Generated.Logs; - static Manufacturer: typeof HomeKitTypes.Generated.Manufacturer; - static Model: typeof HomeKitTypes.Generated.Model; - static MotionDetected: typeof HomeKitTypes.Generated.MotionDetected; - static Mute: typeof HomeKitTypes.Generated.Mute; - static Name: typeof HomeKitTypes.Generated.Name; - static NightVision: typeof HomeKitTypes.Generated.NightVision; - static NitrogenDioxideDensity: typeof HomeKitTypes.Generated.NitrogenDioxideDensity; - static ObstructionDetected: typeof HomeKitTypes.Generated.ObstructionDetected; - static OccupancyDetected: typeof HomeKitTypes.Generated.OccupancyDetected; - static On: typeof HomeKitTypes.Generated.On; - static OpticalZoom: typeof HomeKitTypes.Generated.OpticalZoom; - static OutletInUse: typeof HomeKitTypes.Generated.OutletInUse; - static OzoneDensity: typeof HomeKitTypes.Generated.OzoneDensity; - static PM10Density: typeof HomeKitTypes.Generated.PM10Density; - static PM2_5Density: typeof HomeKitTypes.Generated.PM2_5Density; - static PairSetup: typeof HomeKitTypes.Generated.PairSetup; - static PairVerify: typeof HomeKitTypes.Generated.PairVerify; - static PairingFeatures: typeof HomeKitTypes.Generated.PairingFeatures; - static PairingPairings: typeof HomeKitTypes.Generated.PairingPairings; - static PasswordSetting: typeof HomeKitTypes.Generated.PasswordSetting; - static PictureMode: typeof HomeKitTypes.TV.PictureMode; - static PositionState: typeof HomeKitTypes.Generated.PositionState; - static PowerModeSelection: typeof HomeKitTypes.TV.PowerModeSelection; - static ProgramMode: typeof HomeKitTypes.Generated.ProgramMode; - static ProgrammableSwitchEvent: typeof HomeKitTypes.Generated.ProgrammableSwitchEvent; - static ProductData: typeof HomeKitTypes.Generated.ProductData; - static ProgrammableSwitchOutputState: typeof HomeKitTypes.Bridged.ProgrammableSwitchOutputState; - static Reachable: typeof HomeKitTypes.Bridged.Reachable; - static RelativeHumidityDehumidifierThreshold: typeof HomeKitTypes.Generated.RelativeHumidityDehumidifierThreshold; - static RelativeHumidityHumidifierThreshold: typeof HomeKitTypes.Generated.RelativeHumidityHumidifierThreshold; - static RelayControlPoint: typeof HomeKitTypes.Bridged.RelayControlPoint; - static RelayEnabled: typeof HomeKitTypes.Bridged.RelayEnabled; - static RelayState: typeof HomeKitTypes.Bridged.RelayState; - static RemainingDuration: typeof HomeKitTypes.Generated.RemainingDuration; - static RemoteKey: typeof HomeKitTypes.TV.RemoteKey; - static ResetFilterIndication: typeof HomeKitTypes.Generated.ResetFilterIndication; - static RotationDirection: typeof HomeKitTypes.Generated.RotationDirection; - static RotationSpeed: typeof HomeKitTypes.Generated.RotationSpeed; - static Saturation: typeof HomeKitTypes.Generated.Saturation; - static SecuritySystemAlarmType: typeof HomeKitTypes.Generated.SecuritySystemAlarmType; - static SecuritySystemCurrentState: typeof HomeKitTypes.Generated.SecuritySystemCurrentState; - static SecuritySystemTargetState: typeof HomeKitTypes.Generated.SecuritySystemTargetState; - static SelectedAudioStreamConfiguration: typeof HomeKitTypes.Remote.SelectedAudioStreamConfiguration; - static SelectedRTPStreamConfiguration: typeof HomeKitTypes.Generated.SelectedRTPStreamConfiguration; - static SerialNumber: typeof HomeKitTypes.Generated.SerialNumber; - static ServiceLabelIndex: typeof HomeKitTypes.Generated.ServiceLabelIndex; - static ServiceLabelNamespace: typeof HomeKitTypes.Generated.ServiceLabelNamespace; - static SetDuration: typeof HomeKitTypes.Generated.SetDuration; - static SetupDataStreamTransport: typeof HomeKitTypes.DataStream.SetupDataStreamTransport; - static SetupEndpoints: typeof HomeKitTypes.Generated.SetupEndpoints; - static SiriInputType: typeof HomeKitTypes.Remote.SiriInputType; - static SlatType: typeof HomeKitTypes.Generated.SlatType; - static SleepDiscoveryMode: typeof HomeKitTypes.TV.SleepDiscoveryMode; - static SmokeDetected: typeof HomeKitTypes.Generated.SmokeDetected; - static SoftwareRevision: typeof HomeKitTypes.Bridged.SoftwareRevision; - static StatusActive: typeof HomeKitTypes.Generated.StatusActive; - static StatusFault: typeof HomeKitTypes.Generated.StatusFault; - static StatusJammed: typeof HomeKitTypes.Generated.StatusJammed; - static StatusLowBattery: typeof HomeKitTypes.Generated.StatusLowBattery; - static StatusTampered: typeof HomeKitTypes.Generated.StatusTampered; - static StreamingStatus: typeof HomeKitTypes.Generated.StreamingStatus; - static SulphurDioxideDensity: typeof HomeKitTypes.Generated.SulphurDioxideDensity; - static SupportedAudioStreamConfiguration: typeof HomeKitTypes.Generated.SupportedAudioStreamConfiguration; - static SupportedDataStreamTransportConfiguration: typeof HomeKitTypes.DataStream.SupportedDataStreamTransportConfiguration; - static SupportedRTPConfiguration: typeof HomeKitTypes.Generated.SupportedRTPConfiguration; - static SupportedVideoStreamConfiguration: typeof HomeKitTypes.Generated.SupportedVideoStreamConfiguration; - static SwingMode: typeof HomeKitTypes.Generated.SwingMode; - static TargetAirPurifierState: typeof HomeKitTypes.Generated.TargetAirPurifierState; - static TargetAirQuality: typeof HomeKitTypes.Generated.TargetAirQuality; - static TargetControlList: typeof HomeKitTypes.Remote.TargetControlList; - static TargetControlSupportedConfiguration: typeof HomeKitTypes.Remote.TargetControlSupportedConfiguration; - static TargetDoorState: typeof HomeKitTypes.Generated.TargetDoorState; - static TargetFanState: typeof HomeKitTypes.Generated.TargetFanState; - static TargetHeaterCoolerState: typeof HomeKitTypes.Generated.TargetHeaterCoolerState; - static TargetHeatingCoolingState: typeof HomeKitTypes.Generated.TargetHeatingCoolingState; - static TargetHorizontalTiltAngle: typeof HomeKitTypes.Generated.TargetHorizontalTiltAngle; - static TargetHumidifierDehumidifierState: typeof HomeKitTypes.Generated.TargetHumidifierDehumidifierState; - static TargetMediaState: typeof HomeKitTypes.TV.TargetMediaState; - static TargetPosition: typeof HomeKitTypes.Generated.TargetPosition; - static TargetRelativeHumidity: typeof HomeKitTypes.Generated.TargetRelativeHumidity; - static TargetSlatState: typeof HomeKitTypes.Generated.TargetSlatState; - static TargetTemperature: typeof HomeKitTypes.Generated.TargetTemperature; - static TargetTiltAngle: typeof HomeKitTypes.Generated.TargetTiltAngle; - static TargetVerticalTiltAngle: typeof HomeKitTypes.Generated.TargetVerticalTiltAngle; - static TargetVisibilityState: typeof HomeKitTypes.TV.TargetVisibilityState; - static TemperatureDisplayUnits: typeof HomeKitTypes.Generated.TemperatureDisplayUnits; - static TimeUpdate: typeof HomeKitTypes.Bridged.TimeUpdate; - static TunnelConnectionTimeout: typeof HomeKitTypes.Bridged.TunnelConnectionTimeout; - static TunneledAccessoryAdvertising: typeof HomeKitTypes.Bridged.TunneledAccessoryAdvertising; - static TunneledAccessoryConnected: typeof HomeKitTypes.Bridged.TunneledAccessoryConnected; - static TunneledAccessoryStateNumber: typeof HomeKitTypes.Bridged.TunneledAccessoryStateNumber; - static VOCDensity: typeof HomeKitTypes.Generated.VOCDensity; - static ValveType: typeof HomeKitTypes.Generated.ValveType; - static Version: typeof HomeKitTypes.Generated.Version; - static Volume: typeof HomeKitTypes.Generated.Volume; - static VolumeControlType: typeof HomeKitTypes.TV.VolumeControlType; - static VolumeSelector: typeof HomeKitTypes.TV.VolumeSelector; - static WaterLevel: typeof HomeKitTypes.Generated.WaterLevel; - static ManuallyDisabled: typeof HomeKitTypes.Generated.ManuallyDisabled; - static ThirdPartyCameraActive: typeof HomeKitTypes.Generated.ThirdPartyCameraActive; - static PeriodicSnapshotsActive: typeof HomeKitTypes.Generated.PeriodicSnapshotsActive; - static EventSnapshotsActive: typeof HomeKitTypes.Generated.EventSnapshotsActive; - static HomeKitCameraActive: typeof HomeKitTypes.Generated.HomeKitCameraActive; - static RecordingAudioActive: typeof HomeKitTypes.Generated.RecordingAudioActive; - static SupportedCameraRecordingConfiguration: typeof HomeKitTypes.Generated.SupportedCameraRecordingConfiguration; - static SupportedVideoRecordingConfiguration: typeof HomeKitTypes.Generated.SupportedVideoRecordingConfiguration; - static SupportedAudioRecordingConfiguration: typeof HomeKitTypes.Generated.SupportedAudioRecordingConfiguration; - static SelectedCameraRecordingConfiguration: typeof HomeKitTypes.Generated.SelectedCameraRecordingConfiguration; - static CameraOperatingModeIndicator: typeof HomeKitTypes.Generated.CameraOperatingModeIndicator; - static DiagonalFieldOfView: typeof HomeKitTypes.Generated.DiagonalFieldOfView; - static NetworkClientProfileControl: typeof HomeKitTypes.Generated.NetworkClientProfileControl; - static NetworkClientStatusControl: typeof HomeKitTypes.Generated.NetworkClientStatusControl; - static RouterStatus: typeof HomeKitTypes.Generated.RouterStatus; - static SupportedRouterConfiguration: typeof HomeKitTypes.Generated.SupportedRouterConfiguration; - static WANConfigurationList: typeof HomeKitTypes.Generated.WANConfigurationList; - static WANStatusList: typeof HomeKitTypes.Generated.WANStatusList; - static ManagedNetworkEnable: typeof HomeKitTypes.Generated.ManagedNetworkEnable; - static NetworkAccessViolationControl: typeof HomeKitTypes.Generated.NetworkAccessViolationControl; - static WiFiSatelliteStatus: typeof HomeKitTypes.Generated.WiFiSatelliteStatus; - static WakeConfiguration: typeof HomeKitTypes.Generated.WakeConfiguration; - static SupportedTransferTransportConfiguration: typeof HomeKitTypes.Generated.SupportedTransferTransportConfiguration; - static SetupTransferTransport: typeof HomeKitTypes.Generated.SetupTransferTransport; - - - static ActivityInterval: typeof HomeKitTypes.Generated.ActivityInterval; - static CCAEnergyDetectThreshold: typeof HomeKitTypes.Generated.CCAEnergyDetectThreshold; - static CCASignalDetectThreshold: typeof HomeKitTypes.Generated.CCASignalDetectThreshold; - static CharacteristicValueTransitionControl: typeof HomeKitTypes.Generated.CharacteristicValueTransitionControl; - static SupportedCharacteristicValueTransitionConfiguration: typeof HomeKitTypes.Generated.SupportedCharacteristicValueTransitionConfiguration; - static CharacteristicValueActiveTransitionCount: typeof HomeKitTypes.Generated.CharacteristicValueActiveTransitionCount; - static CurrentTransport: typeof HomeKitTypes.Generated.CurrentTransport; - static DataStreamHAPTransport: typeof HomeKitTypes.Generated.DataStreamHAPTransport; - static DataStreamHAPTransportInterrupt: typeof HomeKitTypes.Generated.DataStreamHAPTransportInterrupt; - static EventRetransmissionMaximum: typeof HomeKitTypes.Generated.EventRetransmissionMaximum; - static EventTransmissionCounters: typeof HomeKitTypes.Generated.EventTransmissionCounters; - static HeartBeat: typeof HomeKitTypes.Generated.HeartBeat; - static MACRetransmissionMaximum: typeof HomeKitTypes.Generated.MACRetransmissionMaximum; - static MACTransmissionCounters: typeof HomeKitTypes.Generated.MACTransmissionCounters; - static OperatingStateResponse: typeof HomeKitTypes.Generated.OperatingStateResponse; - static Ping: typeof HomeKitTypes.Generated.Ping; - static ReceiverSensitivity: typeof HomeKitTypes.Generated.ReceiverSensitivity; - static ReceivedSignalStrengthIndication: typeof HomeKitTypes.Generated.ReceivedSignalStrengthIndication; - static SleepInterval: typeof HomeKitTypes.Generated.SleepInterval; - static SignalToNoiseRatio: typeof HomeKitTypes.Generated.SignalToNoiseRatio; - static SupportedDiagnosticsSnapshot: typeof HomeKitTypes.Generated.SupportedDiagnosticsSnapshot; - static TransmitPower: typeof HomeKitTypes.Generated.TransmitPower; - static TransmitPowerMaximum: typeof HomeKitTypes.Generated.TransmitPowerMaximum; - static VideoAnalysisActive: typeof HomeKitTypes.Generated.VideoAnalysisActive; - static WiFiCapabilities: typeof HomeKitTypes.Generated.WiFiCapabilities; - static WiFiConfigurationControl: typeof HomeKitTypes.Generated.WiFiConfigurationControl; + // Pattern below is for automatic detection of the section of defined characteristics. Used by the generator + // -=-=-=-=-=-=-=-=-=-=-=-=-=-=- + public static AccessControlLevel: typeof AccessControlLevel; + public static AccessoryFlags: typeof AccessoryFlags; + public static AccessoryIdentifier: typeof AccessoryIdentifier; + public static Active: typeof Active; + public static ActiveIdentifier: typeof ActiveIdentifier; + public static ActivityInterval: typeof ActivityInterval; + public static AdministratorOnlyAccess: typeof AdministratorOnlyAccess; + public static AirParticulateDensity: typeof AirParticulateDensity; + public static AirParticulateSize: typeof AirParticulateSize; + public static AirQuality: typeof AirQuality; + public static AppMatchingIdentifier: typeof AppMatchingIdentifier; + public static AudioFeedback: typeof AudioFeedback; + public static BatteryLevel: typeof BatteryLevel; + public static Brightness: typeof Brightness; + public static ButtonEvent: typeof ButtonEvent; + public static CameraOperatingModeIndicator: typeof CameraOperatingModeIndicator; + public static CarbonDioxideDetected: typeof CarbonDioxideDetected; + public static CarbonDioxideLevel: typeof CarbonDioxideLevel; + public static CarbonDioxidePeakLevel: typeof CarbonDioxidePeakLevel; + public static CarbonMonoxideDetected: typeof CarbonMonoxideDetected; + public static CarbonMonoxideLevel: typeof CarbonMonoxideLevel; + public static CarbonMonoxidePeakLevel: typeof CarbonMonoxidePeakLevel; + public static CCAEnergyDetectThreshold: typeof CCAEnergyDetectThreshold; + public static CCASignalDetectThreshold: typeof CCASignalDetectThreshold; + public static CharacteristicValueActiveTransitionCount: typeof CharacteristicValueActiveTransitionCount; + public static CharacteristicValueTransitionControl: typeof CharacteristicValueTransitionControl; + public static ChargingState: typeof ChargingState; + public static ClosedCaptions: typeof ClosedCaptions; + public static ColorTemperature: typeof ColorTemperature; + public static ConfiguredName: typeof ConfiguredName; + public static ContactSensorState: typeof ContactSensorState; + public static CoolingThresholdTemperature: typeof CoolingThresholdTemperature; + public static CurrentAirPurifierState: typeof CurrentAirPurifierState; + public static CurrentAmbientLightLevel: typeof CurrentAmbientLightLevel; + public static CurrentDoorState: typeof CurrentDoorState; + public static CurrentFanState: typeof CurrentFanState; + public static CurrentHeaterCoolerState: typeof CurrentHeaterCoolerState; + public static CurrentHeatingCoolingState: typeof CurrentHeatingCoolingState; + public static CurrentHorizontalTiltAngle: typeof CurrentHorizontalTiltAngle; + public static CurrentHumidifierDehumidifierState: typeof CurrentHumidifierDehumidifierState; + public static CurrentMediaState: typeof CurrentMediaState; + public static CurrentPosition: typeof CurrentPosition; + public static CurrentRelativeHumidity: typeof CurrentRelativeHumidity; + public static CurrentSlatState: typeof CurrentSlatState; + public static CurrentTemperature: typeof CurrentTemperature; + public static CurrentTiltAngle: typeof CurrentTiltAngle; + public static CurrentTransport: typeof CurrentTransport; + public static CurrentVerticalTiltAngle: typeof CurrentVerticalTiltAngle; + public static CurrentVisibilityState: typeof CurrentVisibilityState; + public static DataStreamHAPTransport: typeof DataStreamHAPTransport; + public static DataStreamHAPTransportInterrupt: typeof DataStreamHAPTransportInterrupt; + public static DiagonalFieldOfView: typeof DiagonalFieldOfView; + public static DigitalZoom: typeof DigitalZoom; + public static DisplayOrder: typeof DisplayOrder; + public static EventRetransmissionMaximum: typeof EventRetransmissionMaximum; + public static EventSnapshotsActive: typeof EventSnapshotsActive; + public static EventTransmissionCounters: typeof EventTransmissionCounters; + public static FilterChangeIndication: typeof FilterChangeIndication; + public static FilterLifeLevel: typeof FilterLifeLevel; + public static FirmwareRevision: typeof FirmwareRevision; + public static HardwareRevision: typeof HardwareRevision; + public static HeartBeat: typeof HeartBeat; + public static HeatingThresholdTemperature: typeof HeatingThresholdTemperature; + public static HoldPosition: typeof HoldPosition; + public static HomeKitCameraActive: typeof HomeKitCameraActive; + public static Hue: typeof Hue; + public static Identifier: typeof Identifier; + public static Identify: typeof Identify; + public static ImageMirroring: typeof ImageMirroring; + public static ImageRotation: typeof ImageRotation; + public static InputDeviceType: typeof InputDeviceType; + public static InputSourceType: typeof InputSourceType; + public static InUse: typeof InUse; + public static IsConfigured: typeof IsConfigured; + public static LeakDetected: typeof LeakDetected; + public static ListPairings: typeof ListPairings; + public static LockControlPoint: typeof LockControlPoint; + public static LockCurrentState: typeof LockCurrentState; + public static LockLastKnownAction: typeof LockLastKnownAction; + public static LockManagementAutoSecurityTimeout: typeof LockManagementAutoSecurityTimeout; + public static LockPhysicalControls: typeof LockPhysicalControls; + public static LockTargetState: typeof LockTargetState; + public static Logs: typeof Logs; + public static MACRetransmissionMaximum: typeof MACRetransmissionMaximum; + public static MACTransmissionCounters: typeof MACTransmissionCounters; + public static ManagedNetworkEnable: typeof ManagedNetworkEnable; + public static ManuallyDisabled: typeof ManuallyDisabled; + public static Manufacturer: typeof Manufacturer; + public static MaximumTransmitPower: typeof MaximumTransmitPower; + public static Model: typeof Model; + public static MotionDetected: typeof MotionDetected; + public static Mute: typeof Mute; + public static Name: typeof Name; + public static NetworkAccessViolationControl: typeof NetworkAccessViolationControl; + public static NetworkClientProfileControl: typeof NetworkClientProfileControl; + public static NetworkClientStatusControl: typeof NetworkClientStatusControl; + public static NightVision: typeof NightVision; + public static NitrogenDioxideDensity: typeof NitrogenDioxideDensity; + public static ObstructionDetected: typeof ObstructionDetected; + public static OccupancyDetected: typeof OccupancyDetected; + public static On: typeof On; + public static OperatingStateResponse: typeof OperatingStateResponse; + public static OpticalZoom: typeof OpticalZoom; + public static OutletInUse: typeof OutletInUse; + public static OzoneDensity: typeof OzoneDensity; + public static PairingFeatures: typeof PairingFeatures; + /** + * @deprecated Please use {@link Characteristic.ListPairings}. + */ + public static PairingPairings: typeof ListPairings; + public static PairSetup: typeof PairSetup; + public static PairVerify: typeof PairVerify; + public static PasswordSetting: typeof PasswordSetting; + public static PeriodicSnapshotsActive: typeof PeriodicSnapshotsActive; + public static PictureMode: typeof PictureMode; + public static Ping: typeof Ping; + public static PM10Density: typeof PM10Density; + public static PM2_5Density: typeof PM2_5Density; + public static PositionState: typeof PositionState; + public static PowerModeSelection: typeof PowerModeSelection; + public static ProductData: typeof ProductData; + public static ProgrammableSwitchEvent: typeof ProgrammableSwitchEvent; + public static ProgrammableSwitchOutputState: typeof ProgrammableSwitchOutputState; + public static ProgramMode: typeof ProgramMode; + public static ReceivedSignalStrengthIndication: typeof ReceivedSignalStrengthIndication; + public static ReceiverSensitivity: typeof ReceiverSensitivity; + public static RecordingAudioActive: typeof RecordingAudioActive; + public static RelativeHumidityDehumidifierThreshold: typeof RelativeHumidityDehumidifierThreshold; + public static RelativeHumidityHumidifierThreshold: typeof RelativeHumidityHumidifierThreshold; + public static RelayControlPoint: typeof RelayControlPoint; + public static RelayEnabled: typeof RelayEnabled; + public static RelayState: typeof RelayState; + public static RemainingDuration: typeof RemainingDuration; + public static RemoteKey: typeof RemoteKey; + public static ResetFilterIndication: typeof ResetFilterIndication; + public static RotationDirection: typeof RotationDirection; + public static RotationSpeed: typeof RotationSpeed; + public static RouterStatus: typeof RouterStatus; + public static Saturation: typeof Saturation; + public static SecuritySystemAlarmType: typeof SecuritySystemAlarmType; + public static SecuritySystemCurrentState: typeof SecuritySystemCurrentState; + public static SecuritySystemTargetState: typeof SecuritySystemTargetState; + public static SelectedAudioStreamConfiguration: typeof SelectedAudioStreamConfiguration; + public static SelectedCameraRecordingConfiguration: typeof SelectedCameraRecordingConfiguration; + public static SelectedRTPStreamConfiguration: typeof SelectedRTPStreamConfiguration; + public static SerialNumber: typeof SerialNumber; + public static ServiceLabelIndex: typeof ServiceLabelIndex; + public static ServiceLabelNamespace: typeof ServiceLabelNamespace; + public static SetDuration: typeof SetDuration; + public static SetupDataStreamTransport: typeof SetupDataStreamTransport; + public static SetupEndpoints: typeof SetupEndpoints; + public static SetupTransferTransport: typeof SetupTransferTransport; + public static SignalToNoiseRatio: typeof SignalToNoiseRatio; + public static SiriInputType: typeof SiriInputType; + public static SlatType: typeof SlatType; + public static SleepDiscoveryMode: typeof SleepDiscoveryMode; + public static SleepInterval: typeof SleepInterval; + public static SmokeDetected: typeof SmokeDetected; + public static SoftwareRevision: typeof SoftwareRevision; + public static StatusActive: typeof StatusActive; + public static StatusFault: typeof StatusFault; + public static StatusJammed: typeof StatusJammed; + public static StatusLowBattery: typeof StatusLowBattery; + public static StatusTampered: typeof StatusTampered; + public static StreamingStatus: typeof StreamingStatus; + public static SulphurDioxideDensity: typeof SulphurDioxideDensity; + public static SupportedAudioRecordingConfiguration: typeof SupportedAudioRecordingConfiguration; + public static SupportedAudioStreamConfiguration: typeof SupportedAudioStreamConfiguration; + public static SupportedCameraRecordingConfiguration: typeof SupportedCameraRecordingConfiguration; + public static SupportedCharacteristicValueTransitionConfiguration: typeof SupportedCharacteristicValueTransitionConfiguration; + public static SupportedDataStreamTransportConfiguration: typeof SupportedDataStreamTransportConfiguration; + public static SupportedDiagnosticsSnapshot: typeof SupportedDiagnosticsSnapshot; + public static SupportedRouterConfiguration: typeof SupportedRouterConfiguration; + public static SupportedRTPConfiguration: typeof SupportedRTPConfiguration; + public static SupportedTransferTransportConfiguration: typeof SupportedTransferTransportConfiguration; + public static SupportedVideoRecordingConfiguration: typeof SupportedVideoRecordingConfiguration; + public static SupportedVideoStreamConfiguration: typeof SupportedVideoStreamConfiguration; + public static SwingMode: typeof SwingMode; + public static TargetAirPurifierState: typeof TargetAirPurifierState; + public static TargetControlList: typeof TargetControlList; + public static TargetControlSupportedConfiguration: typeof TargetControlSupportedConfiguration; + public static TargetDoorState: typeof TargetDoorState; + public static TargetFanState: typeof TargetFanState; + public static TargetHeaterCoolerState: typeof TargetHeaterCoolerState; + public static TargetHeatingCoolingState: typeof TargetHeatingCoolingState; + public static TargetHorizontalTiltAngle: typeof TargetHorizontalTiltAngle; + public static TargetHumidifierDehumidifierState: typeof TargetHumidifierDehumidifierState; + public static TargetMediaState: typeof TargetMediaState; + public static TargetPosition: typeof TargetPosition; + public static TargetRelativeHumidity: typeof TargetRelativeHumidity; + public static TargetTemperature: typeof TargetTemperature; + public static TargetTiltAngle: typeof TargetTiltAngle; + public static TargetVerticalTiltAngle: typeof TargetVerticalTiltAngle; + public static TargetVisibilityState: typeof TargetVisibilityState; + public static TemperatureDisplayUnits: typeof TemperatureDisplayUnits; + public static ThirdPartyCameraActive: typeof ThirdPartyCameraActive; + public static ThreadControlPoint: typeof ThreadControlPoint; + public static ThreadNodeCapabilities: typeof ThreadNodeCapabilities; + public static ThreadOpenThreadVersion: typeof ThreadOpenThreadVersion; + public static ThreadStatus: typeof ThreadStatus; + public static TransmitPower: typeof TransmitPower; + public static TunnelConnectionTimeout: typeof TunnelConnectionTimeout; + public static TunneledAccessoryAdvertising: typeof TunneledAccessoryAdvertising; + public static TunneledAccessoryConnected: typeof TunneledAccessoryConnected; + public static TunneledAccessoryStateNumber: typeof TunneledAccessoryStateNumber; + public static ValveType: typeof ValveType; + public static Version: typeof Version; + public static VideoAnalysisActive: typeof VideoAnalysisActive; + public static VOCDensity: typeof VOCDensity; + public static Volume: typeof Volume; + public static VolumeControlType: typeof VolumeControlType; + public static VolumeSelector: typeof VolumeSelector; + public static WakeConfiguration: typeof WakeConfiguration; + public static WANConfigurationList: typeof WANConfigurationList; + public static WANStatusList: typeof WANStatusList; + public static WaterLevel: typeof WaterLevel; + public static WiFiCapabilities: typeof WiFiCapabilities; + public static WiFiConfigurationControl: typeof WiFiConfigurationControl; + public static WiFiSatelliteStatus: typeof WiFiSatelliteStatus; + // =-=-=-=-=-=-=-=-=-=-=-=-=-=-= // NOTICE: when adding/changing properties, remember to possibly adjust the serialize/deserialize functions public displayName: string; @@ -1398,7 +1611,7 @@ export class Characteristic extends EventEmitter { internalHAPRepresentation(): CharacteristicJsonObject { assert(this.iid,"iid cannot be undefined for characteristic '" + this.displayName + "'"); return { - type: toShortForm(this.UUID, HomeKitTypes.BASE_UUID), + type: toShortForm(this.UUID), iid: this.iid!, value: null, perms: this.props.perms, diff --git a/src/lib/Service.spec.ts b/src/lib/Service.spec.ts index 0dc295d95..cdc95575f 100644 --- a/src/lib/Service.spec.ts +++ b/src/lib/Service.spec.ts @@ -1,4 +1,3 @@ -import './gen'; import { Characteristic, Service, ServiceEventTypes, uuid } from '..'; const createService = () => { diff --git a/src/lib/Service.ts b/src/lib/Service.ts index 5a6348ff3..289b5e221 100644 --- a/src/lib/Service.ts +++ b/src/lib/Service.ts @@ -8,7 +8,73 @@ import { CharacteristicEventTypes, SerializedCharacteristic } from './Characteristic'; -import * as HomeKitTypes from './gen'; +import { + AccessControl, + AccessoryInformation, + AccessoryRuntimeInformation, + AirPurifier, + AirQualitySensor, + AudioStreamManagement, + Battery, + CameraOperatingMode, + CameraRecordingManagement, + CameraRTPStreamManagement, + CarbonDioxideSensor, + CarbonMonoxideSensor, + CloudRelay, + ContactSensor, + DataStreamTransportManagement, + Diagnostics, + Door, + Doorbell, + Fan, + Fanv2, + Faucet, + FilterMaintenance, + GarageDoorOpener, + HeaterCooler, + HumidifierDehumidifier, + HumiditySensor, + InputSource, + IrrigationSystem, + LeakSensor, + Lightbulb, + LightSensor, + LockManagement, + LockMechanism, + Microphone, + MotionSensor, + OccupancySensor, + Outlet, + Pairing, + PowerManagement, + ProtocolInformation, + SecuritySystem, + ServiceLabel, + Siri, + Slats, + SmartSpeaker, + SmokeSensor, + Speaker, + StatefulProgrammableSwitch, + StatelessProgrammableSwitch, + Switch, + TargetControl, + TargetControlManagement, + Television, + TelevisionSpeaker, + TemperatureSensor, + Thermostat, + ThreadTransport, + TransferTransportManagement, + Tunnel, + Valve, + WiFiRouter, + WiFiSatellite, + WiFiTransport, + Window, + WindowCovering, +} from "./definitions"; import { IdentifierCache } from './model/IdentifierCache'; import { HAPConnection } from "./util/eventedhttp"; import { toShortForm } from './util/uuid'; @@ -76,75 +142,94 @@ export declare interface Service { */ export class Service extends EventEmitter { - static AccessControl: typeof HomeKitTypes.Generated.AccessControl; - static AccessoryInformation: typeof HomeKitTypes.Generated.AccessoryInformation; - static AirPurifier: typeof HomeKitTypes.Generated.AirPurifier; - static AirQualitySensor: typeof HomeKitTypes.Generated.AirQualitySensor; - static AudioStreamManagement: typeof HomeKitTypes.Remote.AudioStreamManagement; - static BatteryService: typeof HomeKitTypes.Generated.BatteryService; - static BridgeConfiguration: typeof HomeKitTypes.Bridged.BridgeConfiguration; - static BridgingState: typeof HomeKitTypes.Bridged.BridgingState; - static CameraControl: typeof HomeKitTypes.Bridged.CameraControl; - static CameraRTPStreamManagement: typeof HomeKitTypes.Generated.CameraRTPStreamManagement; - static CarbonDioxideSensor: typeof HomeKitTypes.Generated.CarbonDioxideSensor; - static CarbonMonoxideSensor: typeof HomeKitTypes.Generated.CarbonMonoxideSensor; - static ContactSensor: typeof HomeKitTypes.Generated.ContactSensor; - static DataStreamTransportManagement: typeof HomeKitTypes.DataStream.DataStreamTransportManagement; - static Door: typeof HomeKitTypes.Generated.Door; - static Doorbell: typeof HomeKitTypes.Generated.Doorbell; - static Fan: typeof HomeKitTypes.Generated.Fan; - static Fanv2: typeof HomeKitTypes.Generated.Fanv2; - static Faucet: typeof HomeKitTypes.Generated.Faucet; - static FilterMaintenance: typeof HomeKitTypes.Generated.FilterMaintenance; - static GarageDoorOpener: typeof HomeKitTypes.Generated.GarageDoorOpener; - static HeaterCooler: typeof HomeKitTypes.Generated.HeaterCooler; - static HumidifierDehumidifier: typeof HomeKitTypes.Generated.HumidifierDehumidifier; - static HumiditySensor: typeof HomeKitTypes.Generated.HumiditySensor; - static InputSource: typeof HomeKitTypes.TV.InputSource; - static IrrigationSystem: typeof HomeKitTypes.Generated.IrrigationSystem; - static LeakSensor: typeof HomeKitTypes.Generated.LeakSensor; - static LightSensor: typeof HomeKitTypes.Generated.LightSensor; - static Lightbulb: typeof HomeKitTypes.Generated.Lightbulb; - static LockManagement: typeof HomeKitTypes.Generated.LockManagement; - static LockMechanism: typeof HomeKitTypes.Generated.LockMechanism; - static Microphone: typeof HomeKitTypes.Generated.Microphone; - static MotionSensor: typeof HomeKitTypes.Generated.MotionSensor; - static OccupancySensor: typeof HomeKitTypes.Generated.OccupancySensor; - static Outlet: typeof HomeKitTypes.Generated.Outlet; - static Pairing: typeof HomeKitTypes.Bridged.Pairing; - static ProtocolInformation: typeof HomeKitTypes.Bridged.ProtocolInformation; - static Relay: typeof HomeKitTypes.Bridged.Relay; - static SecuritySystem: typeof HomeKitTypes.Generated.SecuritySystem; - static ServiceLabel: typeof HomeKitTypes.Generated.ServiceLabel; - static Siri: typeof HomeKitTypes.Remote.Siri; - static Slat: typeof HomeKitTypes.Generated.Slat; - static SmokeSensor: typeof HomeKitTypes.Generated.SmokeSensor; - static SmartSpeaker: typeof HomeKitTypes.Generated.SmartSpeaker; - static Speaker: typeof HomeKitTypes.Generated.Speaker; - static StatefulProgrammableSwitch: typeof HomeKitTypes.Bridged.StatefulProgrammableSwitch; - static StatelessProgrammableSwitch: typeof HomeKitTypes.Generated.StatelessProgrammableSwitch; - static Switch: typeof HomeKitTypes.Generated.Switch; - static TargetControl: typeof HomeKitTypes.Remote.TargetControl; - static TargetControlManagement: typeof HomeKitTypes.Remote.TargetControlManagement; - static Television: typeof HomeKitTypes.TV.Television; - static TelevisionSpeaker: typeof HomeKitTypes.TV.TelevisionSpeaker; - static TemperatureSensor: typeof HomeKitTypes.Generated.TemperatureSensor; - static Thermostat: typeof HomeKitTypes.Generated.Thermostat; - static TimeInformation: typeof HomeKitTypes.Bridged.TimeInformation; - static TunneledBTLEAccessoryService: typeof HomeKitTypes.Bridged.TunneledBTLEAccessoryService; - static Valve: typeof HomeKitTypes.Generated.Valve; - static Window: typeof HomeKitTypes.Generated.Window; - static WindowCovering: typeof HomeKitTypes.Generated.WindowCovering; - static CameraOperatingMode: typeof HomeKitTypes.Generated.CameraOperatingMode; - static CameraEventRecordingManagement: typeof HomeKitTypes.Generated.CameraEventRecordingManagement; - static WiFiRouter: typeof HomeKitTypes.Generated.WiFiRouter; - static WiFiSatellite: typeof HomeKitTypes.Generated.WiFiSatellite; - static PowerManagement: typeof HomeKitTypes.Generated.PowerManagement; - static TransferTransportManagement: typeof HomeKitTypes.Generated.TransferTransportManagement; - - static AccessoryRuntimeInformation: typeof HomeKitTypes.Generated.AccessoryRuntimeInformation; - static Diagnostics: typeof HomeKitTypes.Generated.Diagnostics; - static WiFiTransport: typeof HomeKitTypes.Generated.WiFiTransport; + // Pattern below is for automatic detection of the section of defined services. Used by the generator + // -=-=-=-=-=-=-=-=-=-=-=-=-=-=- + public static AccessControl: typeof AccessControl; + public static AccessoryInformation: typeof AccessoryInformation; + public static AccessoryRuntimeInformation: typeof AccessoryRuntimeInformation; + public static AirPurifier: typeof AirPurifier; + public static AirQualitySensor: typeof AirQualitySensor; + public static AudioStreamManagement: typeof AudioStreamManagement; + public static Battery: typeof Battery; + /** + * @deprecated Please use {@link Service.Battery}. + */ + public static BatteryService: typeof Battery; + /** + * @deprecated Please use {@link Service.CameraRecordingManagement}. + */ + public static CameraEventRecordingManagement: typeof CameraRecordingManagement; + public static CameraOperatingMode: typeof CameraOperatingMode; + public static CameraRecordingManagement: typeof CameraRecordingManagement; + public static CameraRTPStreamManagement: typeof CameraRTPStreamManagement; + public static CarbonDioxideSensor: typeof CarbonDioxideSensor; + public static CarbonMonoxideSensor: typeof CarbonMonoxideSensor; + public static CloudRelay: typeof CloudRelay; + public static ContactSensor: typeof ContactSensor; + public static DataStreamTransportManagement: typeof DataStreamTransportManagement; + public static Diagnostics: typeof Diagnostics; + public static Door: typeof Door; + public static Doorbell: typeof Doorbell; + public static Fan: typeof Fan; + public static Fanv2: typeof Fanv2; + public static Faucet: typeof Faucet; + public static FilterMaintenance: typeof FilterMaintenance; + public static GarageDoorOpener: typeof GarageDoorOpener; + public static HeaterCooler: typeof HeaterCooler; + public static HumidifierDehumidifier: typeof HumidifierDehumidifier; + public static HumiditySensor: typeof HumiditySensor; + public static InputSource: typeof InputSource; + public static IrrigationSystem: typeof IrrigationSystem; + public static LeakSensor: typeof LeakSensor; + public static Lightbulb: typeof Lightbulb; + public static LightSensor: typeof LightSensor; + public static LockManagement: typeof LockManagement; + public static LockMechanism: typeof LockMechanism; + public static Microphone: typeof Microphone; + public static MotionSensor: typeof MotionSensor; + public static OccupancySensor: typeof OccupancySensor; + public static Outlet: typeof Outlet; + public static Pairing: typeof Pairing; + public static PowerManagement: typeof PowerManagement; + public static ProtocolInformation: typeof ProtocolInformation; + /** + * @deprecated Please use {@link Service.CloudRelay}. + */ + public static Relay: typeof CloudRelay; + public static SecuritySystem: typeof SecuritySystem; + public static ServiceLabel: typeof ServiceLabel; + public static Siri: typeof Siri; + /** + * @deprecated Please use {@link Service.Slats}. + */ + public static Slat: typeof Slats; + public static Slats: typeof Slats; + public static SmartSpeaker: typeof SmartSpeaker; + public static SmokeSensor: typeof SmokeSensor; + public static Speaker: typeof Speaker; + public static StatefulProgrammableSwitch: typeof StatefulProgrammableSwitch; + public static StatelessProgrammableSwitch: typeof StatelessProgrammableSwitch; + public static Switch: typeof Switch; + public static TargetControl: typeof TargetControl; + public static TargetControlManagement: typeof TargetControlManagement; + public static Television: typeof Television; + public static TelevisionSpeaker: typeof TelevisionSpeaker; + public static TemperatureSensor: typeof TemperatureSensor; + public static Thermostat: typeof Thermostat; + public static ThreadTransport: typeof ThreadTransport; + public static TransferTransportManagement: typeof TransferTransportManagement; + public static Tunnel: typeof Tunnel; + /** + * @deprecated Please use {@link Service.Tunnel}. + */ + public static TunneledBTLEAccessoryService: typeof Tunnel; + public static Valve: typeof Valve; + public static WiFiRouter: typeof WiFiRouter; + public static WiFiSatellite: typeof WiFiSatellite; + public static WiFiTransport: typeof WiFiTransport; + public static Window: typeof Window; + public static WindowCovering: typeof WindowCovering; + // =-=-=-=-=-=-=-=-=-=-=-=-=-=-= // NOTICE: when adding/changing properties, remember to possibly adjust the serialize/deserialize functions public displayName: string; @@ -467,7 +552,7 @@ export class Service extends EventEmitter { assert(this.characteristics.length, "service '" + this.displayName + "' does not have any characteristics!"); const service: ServiceJsonObject = { - type: toShortForm(this.UUID, HomeKitTypes.BASE_UUID), + type: toShortForm(this.UUID), iid: this.iid!, characteristics: [], hidden: this.isHiddenService? true: undefined, @@ -533,7 +618,7 @@ export class Service extends EventEmitter { assert(this.characteristics.length, "service '" + this.displayName + "' does not have any characteristics!"); const service: ServiceJsonObject = { - type: toShortForm(this.UUID, HomeKitTypes.BASE_UUID), + type: toShortForm(this.UUID), iid: this.iid!, characteristics: this.characteristics.map(characteristic => characteristic.internalHAPRepresentation()), hidden: this.isHiddenService? true: undefined, diff --git a/src/lib/camera/RTPStreamManagement.ts b/src/lib/camera/RTPStreamManagement.ts index 6cd8db2e3..060f874ed 100644 --- a/src/lib/camera/RTPStreamManagement.ts +++ b/src/lib/camera/RTPStreamManagement.ts @@ -6,7 +6,7 @@ import { LegacyCameraSource, LegacyCameraSourceAdapter, once, uuid } from "../.. import { CharacteristicValue, Nullable, SessionIdentifier } from '../../types'; import { Characteristic, CharacteristicEventTypes, CharacteristicSetCallback } from '../Characteristic'; import { CameraController, CameraStreamingDelegate } from "../controller"; -import { CameraRTPStreamManagement } from "../gen/HomeKit"; +import type { CameraRTPStreamManagement } from "../definitions"; import { HAPStatus } from "../HAPServer"; import { Service } from '../Service'; import { HAPConnection, HAPConnectionEvent } from "../util/eventedhttp"; diff --git a/src/lib/controller/CameraController.ts b/src/lib/controller/CameraController.ts index a1656c078..5a07ee92a 100644 --- a/src/lib/controller/CameraController.ts +++ b/src/lib/controller/CameraController.ts @@ -8,17 +8,17 @@ import { CharacteristicGetCallback, CharacteristicSetCallback, CharacteristicValue, + HAPStatus, LegacyCameraSourceAdapter, PrepareStreamRequest, PrepareStreamResponse, RTPStreamManagement, Service, SnapshotRequest, - HAPStatus, StreamingRequest } from "../.."; import { SessionIdentifier } from "../../types"; -import { Doorbell, Microphone, Speaker } from "../gen/HomeKit"; +import type { Doorbell, Microphone, Speaker } from "../definitions"; import { Controller, ControllerServiceMap, ControllerType, DefaultControllerType } from "./Controller"; import Timeout = NodeJS.Timeout; diff --git a/src/lib/controller/DoorbellController.ts b/src/lib/controller/DoorbellController.ts index f7a0beeff..cbe407733 100644 --- a/src/lib/controller/DoorbellController.ts +++ b/src/lib/controller/DoorbellController.ts @@ -1,10 +1,10 @@ -import {CameraController, CameraControllerOptions, CameraControllerServiceMap} from "./CameraController"; -import {Doorbell, ProgrammableSwitchEvent} from "../gen/HomeKit"; -import {Service} from "../Service"; -import {Characteristic, CharacteristicEventTypes, CharacteristicGetCallback} from "../Characteristic"; -import {ControllerServiceMap} from "./Controller"; +import { Characteristic, CharacteristicEventTypes, CharacteristicGetCallback } from "../Characteristic"; +import type { Doorbell } from "../definitions"; +import { Service } from "../Service"; +import { CameraController, CameraControllerOptions, CameraControllerServiceMap } from "./CameraController"; +import { ControllerServiceMap } from "./Controller"; -export class DoorbellController extends CameraController { +export class DoorbellController extends CameraController { // TODO optional name characteristic /* * NOTICE: We subclass from the CameraController here and deliberately do not introduce/set a @@ -22,7 +22,7 @@ export class DoorbellController extends CameraController { } public ringDoorbell() { - this.doorbellService!.updateCharacteristic(Characteristic.ProgrammableSwitchEvent, ProgrammableSwitchEvent.SINGLE_PRESS); + this.doorbellService!.updateCharacteristic(Characteristic.ProgrammableSwitchEvent, Characteristic.ProgrammableSwitchEvent.SINGLE_PRESS); } constructServices(): CameraControllerServiceMap { diff --git a/src/lib/controller/RemoteController.ts b/src/lib/controller/RemoteController.ts index 75dfc8b9c..206dcc9dc 100644 --- a/src/lib/controller/RemoteController.ts +++ b/src/lib/controller/RemoteController.ts @@ -24,8 +24,13 @@ import { RequestHandler, Topics } from "../datastream"; -import { DataStreamTransportManagement } from "../gen/HomeKit-DataStream"; -import { AudioStreamManagement, Siri, TargetControl, TargetControlManagement } from "../gen/HomeKit-Remote"; +import type { + AudioStreamManagement, + DataStreamTransportManagement, + Siri, + TargetControl, + TargetControlManagement +} from '../definitions'; import { HAPStatus } from "../HAPServer"; import { Service } from "../Service"; import { HAPConnection, HAPConnectionEvent } from "../util/eventedhttp"; @@ -139,11 +144,6 @@ export type ButtonConfiguration = { } -export const enum SiriInputType { - PUSH_BUTTON_TRIGGERED_APPLE_TV = 0, -} - - const enum SelectedAudioInputStreamConfigurationTypes { SELECTED_AUDIO_INPUT_STREAM_CONFIGURATION = 0x01, } @@ -1147,7 +1147,7 @@ export class RemoteController extends EventEmitter implements SerializableContro if (this.audioSupported) { this.siriService = new Service.Siri('', ''); - this.siriService.setCharacteristic(Characteristic.SiriInputType, SiriInputType.PUSH_BUTTON_TRIGGERED_APPLE_TV); + this.siriService.setCharacteristic(Characteristic.SiriInputType, Characteristic.SiriInputType.PUSH_BUTTON_TRIGGERED_APPLE_TV); this.audioStreamManagementService = new Service.AudioStreamManagement('', ''); this.audioStreamManagementService.setCharacteristic(Characteristic.SupportedAudioStreamConfiguration, this.supportedAudioConfiguration); diff --git a/src/lib/datastream/DataStreamManagement.ts b/src/lib/datastream/DataStreamManagement.ts index c22388251..f2791cffe 100644 --- a/src/lib/datastream/DataStreamManagement.ts +++ b/src/lib/datastream/DataStreamManagement.ts @@ -1,6 +1,6 @@ import createDebug from "debug"; import { Characteristic, CharacteristicEventTypes, CharacteristicSetCallback } from "../Characteristic"; -import { DataStreamTransportManagement } from "../gen/HomeKit-DataStream"; +import type { DataStreamTransportManagement } from "../definitions"; import { HAPStatus } from "../HAPServer"; import { Service } from "../Service"; import { HAPConnection } from "../util/eventedhttp"; diff --git a/src/lib/definitions/CharacteristicDefinitions.spec.ts b/src/lib/definitions/CharacteristicDefinitions.spec.ts new file mode 100644 index 000000000..d8ad3fd5d --- /dev/null +++ b/src/lib/definitions/CharacteristicDefinitions.spec.ts @@ -0,0 +1,1298 @@ +// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY +import "./"; + +import { Characteristic } from "../Characteristic"; + +describe("CharacteristicDefinitions", () => { + describe("AccessControlLevel", () => { + it("should be able to construct", () => { + new Characteristic.AccessControlLevel(); + }); + }); + + describe("AccessoryFlags", () => { + it("should be able to construct", () => { + new Characteristic.AccessoryFlags(); + }); + }); + + describe("AccessoryIdentifier", () => { + it("should be able to construct", () => { + new Characteristic.AccessoryIdentifier(); + }); + }); + + describe("Active", () => { + it("should be able to construct", () => { + new Characteristic.Active(); + }); + }); + + describe("ActiveIdentifier", () => { + it("should be able to construct", () => { + new Characteristic.ActiveIdentifier(); + }); + }); + + describe("ActivityInterval", () => { + it("should be able to construct", () => { + new Characteristic.ActivityInterval(); + }); + }); + + describe("AdministratorOnlyAccess", () => { + it("should be able to construct", () => { + new Characteristic.AdministratorOnlyAccess(); + }); + }); + + describe("AirParticulateDensity", () => { + it("should be able to construct", () => { + new Characteristic.AirParticulateDensity(); + }); + }); + + describe("AirParticulateSize", () => { + it("should be able to construct", () => { + new Characteristic.AirParticulateSize(); + }); + }); + + describe("AirQuality", () => { + it("should be able to construct", () => { + new Characteristic.AirQuality(); + }); + }); + + describe("AppMatchingIdentifier", () => { + it("should be able to construct", () => { + new Characteristic.AppMatchingIdentifier(); + }); + }); + + describe("AudioFeedback", () => { + it("should be able to construct", () => { + new Characteristic.AudioFeedback(); + }); + }); + + describe("BatteryLevel", () => { + it("should be able to construct", () => { + new Characteristic.BatteryLevel(); + }); + }); + + describe("Brightness", () => { + it("should be able to construct", () => { + new Characteristic.Brightness(); + }); + }); + + describe("ButtonEvent", () => { + it("should be able to construct", () => { + new Characteristic.ButtonEvent(); + }); + }); + + describe("CameraOperatingModeIndicator", () => { + it("should be able to construct", () => { + new Characteristic.CameraOperatingModeIndicator(); + }); + }); + + describe("CarbonDioxideDetected", () => { + it("should be able to construct", () => { + new Characteristic.CarbonDioxideDetected(); + }); + }); + + describe("CarbonDioxideLevel", () => { + it("should be able to construct", () => { + new Characteristic.CarbonDioxideLevel(); + }); + }); + + describe("CarbonDioxidePeakLevel", () => { + it("should be able to construct", () => { + new Characteristic.CarbonDioxidePeakLevel(); + }); + }); + + describe("CarbonMonoxideDetected", () => { + it("should be able to construct", () => { + new Characteristic.CarbonMonoxideDetected(); + }); + }); + + describe("CarbonMonoxideLevel", () => { + it("should be able to construct", () => { + new Characteristic.CarbonMonoxideLevel(); + }); + }); + + describe("CarbonMonoxidePeakLevel", () => { + it("should be able to construct", () => { + new Characteristic.CarbonMonoxidePeakLevel(); + }); + }); + + describe("CCAEnergyDetectThreshold", () => { + it("should be able to construct", () => { + new Characteristic.CCAEnergyDetectThreshold(); + }); + }); + + describe("CCASignalDetectThreshold", () => { + it("should be able to construct", () => { + new Characteristic.CCASignalDetectThreshold(); + }); + }); + + describe("CharacteristicValueActiveTransitionCount", () => { + it("should be able to construct", () => { + new Characteristic.CharacteristicValueActiveTransitionCount(); + }); + }); + + describe("CharacteristicValueTransitionControl", () => { + it("should be able to construct", () => { + new Characteristic.CharacteristicValueTransitionControl(); + }); + }); + + describe("ChargingState", () => { + it("should be able to construct", () => { + new Characteristic.ChargingState(); + }); + }); + + describe("ClosedCaptions", () => { + it("should be able to construct", () => { + new Characteristic.ClosedCaptions(); + }); + }); + + describe("ColorTemperature", () => { + it("should be able to construct", () => { + new Characteristic.ColorTemperature(); + }); + }); + + describe("ConfiguredName", () => { + it("should be able to construct", () => { + new Characteristic.ConfiguredName(); + }); + }); + + describe("ContactSensorState", () => { + it("should be able to construct", () => { + new Characteristic.ContactSensorState(); + }); + }); + + describe("CoolingThresholdTemperature", () => { + it("should be able to construct", () => { + new Characteristic.CoolingThresholdTemperature(); + }); + }); + + describe("CurrentAirPurifierState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentAirPurifierState(); + }); + }); + + describe("CurrentAmbientLightLevel", () => { + it("should be able to construct", () => { + new Characteristic.CurrentAmbientLightLevel(); + }); + }); + + describe("CurrentDoorState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentDoorState(); + }); + }); + + describe("CurrentFanState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentFanState(); + }); + }); + + describe("CurrentHeaterCoolerState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentHeaterCoolerState(); + }); + }); + + describe("CurrentHeatingCoolingState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentHeatingCoolingState(); + }); + }); + + describe("CurrentHorizontalTiltAngle", () => { + it("should be able to construct", () => { + new Characteristic.CurrentHorizontalTiltAngle(); + }); + }); + + describe("CurrentHumidifierDehumidifierState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentHumidifierDehumidifierState(); + }); + }); + + describe("CurrentMediaState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentMediaState(); + }); + }); + + describe("CurrentPosition", () => { + it("should be able to construct", () => { + new Characteristic.CurrentPosition(); + }); + }); + + describe("CurrentRelativeHumidity", () => { + it("should be able to construct", () => { + new Characteristic.CurrentRelativeHumidity(); + }); + }); + + describe("CurrentSlatState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentSlatState(); + }); + }); + + describe("CurrentTemperature", () => { + it("should be able to construct", () => { + new Characteristic.CurrentTemperature(); + }); + }); + + describe("CurrentTiltAngle", () => { + it("should be able to construct", () => { + new Characteristic.CurrentTiltAngle(); + }); + }); + + describe("CurrentTransport", () => { + it("should be able to construct", () => { + new Characteristic.CurrentTransport(); + }); + }); + + describe("CurrentVerticalTiltAngle", () => { + it("should be able to construct", () => { + new Characteristic.CurrentVerticalTiltAngle(); + }); + }); + + describe("CurrentVisibilityState", () => { + it("should be able to construct", () => { + new Characteristic.CurrentVisibilityState(); + }); + }); + + describe("DataStreamHAPTransport", () => { + it("should be able to construct", () => { + new Characteristic.DataStreamHAPTransport(); + }); + }); + + describe("DataStreamHAPTransportInterrupt", () => { + it("should be able to construct", () => { + new Characteristic.DataStreamHAPTransportInterrupt(); + }); + }); + + describe("DiagonalFieldOfView", () => { + it("should be able to construct", () => { + new Characteristic.DiagonalFieldOfView(); + }); + }); + + describe("DigitalZoom", () => { + it("should be able to construct", () => { + new Characteristic.DigitalZoom(); + }); + }); + + describe("DisplayOrder", () => { + it("should be able to construct", () => { + new Characteristic.DisplayOrder(); + }); + }); + + describe("EventRetransmissionMaximum", () => { + it("should be able to construct", () => { + new Characteristic.EventRetransmissionMaximum(); + }); + }); + + describe("EventSnapshotsActive", () => { + it("should be able to construct", () => { + new Characteristic.EventSnapshotsActive(); + }); + }); + + describe("EventTransmissionCounters", () => { + it("should be able to construct", () => { + new Characteristic.EventTransmissionCounters(); + }); + }); + + describe("FilterChangeIndication", () => { + it("should be able to construct", () => { + new Characteristic.FilterChangeIndication(); + }); + }); + + describe("FilterLifeLevel", () => { + it("should be able to construct", () => { + new Characteristic.FilterLifeLevel(); + }); + }); + + describe("FirmwareRevision", () => { + it("should be able to construct", () => { + new Characteristic.FirmwareRevision(); + }); + }); + + describe("HardwareRevision", () => { + it("should be able to construct", () => { + new Characteristic.HardwareRevision(); + }); + }); + + describe("HeartBeat", () => { + it("should be able to construct", () => { + new Characteristic.HeartBeat(); + }); + }); + + describe("HeatingThresholdTemperature", () => { + it("should be able to construct", () => { + new Characteristic.HeatingThresholdTemperature(); + }); + }); + + describe("HoldPosition", () => { + it("should be able to construct", () => { + new Characteristic.HoldPosition(); + }); + }); + + describe("HomeKitCameraActive", () => { + it("should be able to construct", () => { + new Characteristic.HomeKitCameraActive(); + }); + }); + + describe("Hue", () => { + it("should be able to construct", () => { + new Characteristic.Hue(); + }); + }); + + describe("Identifier", () => { + it("should be able to construct", () => { + new Characteristic.Identifier(); + }); + }); + + describe("Identify", () => { + it("should be able to construct", () => { + new Characteristic.Identify(); + }); + }); + + describe("ImageMirroring", () => { + it("should be able to construct", () => { + new Characteristic.ImageMirroring(); + }); + }); + + describe("ImageRotation", () => { + it("should be able to construct", () => { + new Characteristic.ImageRotation(); + }); + }); + + describe("InputDeviceType", () => { + it("should be able to construct", () => { + new Characteristic.InputDeviceType(); + }); + }); + + describe("InputSourceType", () => { + it("should be able to construct", () => { + new Characteristic.InputSourceType(); + }); + }); + + describe("InUse", () => { + it("should be able to construct", () => { + new Characteristic.InUse(); + }); + }); + + describe("IsConfigured", () => { + it("should be able to construct", () => { + new Characteristic.IsConfigured(); + }); + }); + + describe("LeakDetected", () => { + it("should be able to construct", () => { + new Characteristic.LeakDetected(); + }); + }); + + describe("ListPairings", () => { + it("should be able to construct", () => { + new Characteristic.ListPairings(); + // noinspection JSDeprecatedSymbols + new Characteristic.PairingPairings(); + }); + }); + + describe("LockControlPoint", () => { + it("should be able to construct", () => { + new Characteristic.LockControlPoint(); + }); + }); + + describe("LockCurrentState", () => { + it("should be able to construct", () => { + new Characteristic.LockCurrentState(); + }); + }); + + describe("LockLastKnownAction", () => { + it("should be able to construct", () => { + new Characteristic.LockLastKnownAction(); + }); + }); + + describe("LockManagementAutoSecurityTimeout", () => { + it("should be able to construct", () => { + new Characteristic.LockManagementAutoSecurityTimeout(); + }); + }); + + describe("LockPhysicalControls", () => { + it("should be able to construct", () => { + new Characteristic.LockPhysicalControls(); + }); + }); + + describe("LockTargetState", () => { + it("should be able to construct", () => { + new Characteristic.LockTargetState(); + }); + }); + + describe("Logs", () => { + it("should be able to construct", () => { + new Characteristic.Logs(); + }); + }); + + describe("MACRetransmissionMaximum", () => { + it("should be able to construct", () => { + new Characteristic.MACRetransmissionMaximum(); + }); + }); + + describe("MACTransmissionCounters", () => { + it("should be able to construct", () => { + new Characteristic.MACTransmissionCounters(); + }); + }); + + describe("ManagedNetworkEnable", () => { + it("should be able to construct", () => { + new Characteristic.ManagedNetworkEnable(); + }); + }); + + describe("ManuallyDisabled", () => { + it("should be able to construct", () => { + new Characteristic.ManuallyDisabled(); + }); + }); + + describe("Manufacturer", () => { + it("should be able to construct", () => { + new Characteristic.Manufacturer(); + }); + }); + + describe("MaximumTransmitPower", () => { + it("should be able to construct", () => { + new Characteristic.MaximumTransmitPower(); + }); + }); + + describe("Model", () => { + it("should be able to construct", () => { + new Characteristic.Model(); + }); + }); + + describe("MotionDetected", () => { + it("should be able to construct", () => { + new Characteristic.MotionDetected(); + }); + }); + + describe("Mute", () => { + it("should be able to construct", () => { + new Characteristic.Mute(); + }); + }); + + describe("Name", () => { + it("should be able to construct", () => { + new Characteristic.Name(); + }); + }); + + describe("NetworkAccessViolationControl", () => { + it("should be able to construct", () => { + new Characteristic.NetworkAccessViolationControl(); + }); + }); + + describe("NetworkClientProfileControl", () => { + it("should be able to construct", () => { + new Characteristic.NetworkClientProfileControl(); + }); + }); + + describe("NetworkClientStatusControl", () => { + it("should be able to construct", () => { + new Characteristic.NetworkClientStatusControl(); + }); + }); + + describe("NightVision", () => { + it("should be able to construct", () => { + new Characteristic.NightVision(); + }); + }); + + describe("NitrogenDioxideDensity", () => { + it("should be able to construct", () => { + new Characteristic.NitrogenDioxideDensity(); + }); + }); + + describe("ObstructionDetected", () => { + it("should be able to construct", () => { + new Characteristic.ObstructionDetected(); + }); + }); + + describe("OccupancyDetected", () => { + it("should be able to construct", () => { + new Characteristic.OccupancyDetected(); + }); + }); + + describe("On", () => { + it("should be able to construct", () => { + new Characteristic.On(); + }); + }); + + describe("OperatingStateResponse", () => { + it("should be able to construct", () => { + new Characteristic.OperatingStateResponse(); + }); + }); + + describe("OpticalZoom", () => { + it("should be able to construct", () => { + new Characteristic.OpticalZoom(); + }); + }); + + describe("OutletInUse", () => { + it("should be able to construct", () => { + new Characteristic.OutletInUse(); + }); + }); + + describe("OzoneDensity", () => { + it("should be able to construct", () => { + new Characteristic.OzoneDensity(); + }); + }); + + describe("PairingFeatures", () => { + it("should be able to construct", () => { + new Characteristic.PairingFeatures(); + }); + }); + + describe("PairSetup", () => { + it("should be able to construct", () => { + new Characteristic.PairSetup(); + }); + }); + + describe("PairVerify", () => { + it("should be able to construct", () => { + new Characteristic.PairVerify(); + }); + }); + + describe("PasswordSetting", () => { + it("should be able to construct", () => { + new Characteristic.PasswordSetting(); + }); + }); + + describe("PeriodicSnapshotsActive", () => { + it("should be able to construct", () => { + new Characteristic.PeriodicSnapshotsActive(); + }); + }); + + describe("PictureMode", () => { + it("should be able to construct", () => { + new Characteristic.PictureMode(); + }); + }); + + describe("Ping", () => { + it("should be able to construct", () => { + new Characteristic.Ping(); + }); + }); + + describe("PM10Density", () => { + it("should be able to construct", () => { + new Characteristic.PM10Density(); + }); + }); + + describe("PM2_5Density", () => { + it("should be able to construct", () => { + new Characteristic.PM2_5Density(); + }); + }); + + describe("PositionState", () => { + it("should be able to construct", () => { + new Characteristic.PositionState(); + }); + }); + + describe("PowerModeSelection", () => { + it("should be able to construct", () => { + new Characteristic.PowerModeSelection(); + }); + }); + + describe("ProductData", () => { + it("should be able to construct", () => { + new Characteristic.ProductData(); + }); + }); + + describe("ProgrammableSwitchEvent", () => { + it("should be able to construct", () => { + new Characteristic.ProgrammableSwitchEvent(); + }); + }); + + describe("ProgrammableSwitchOutputState", () => { + it("should be able to construct", () => { + new Characteristic.ProgrammableSwitchOutputState(); + }); + }); + + describe("ProgramMode", () => { + it("should be able to construct", () => { + new Characteristic.ProgramMode(); + }); + }); + + describe("ReceivedSignalStrengthIndication", () => { + it("should be able to construct", () => { + new Characteristic.ReceivedSignalStrengthIndication(); + }); + }); + + describe("ReceiverSensitivity", () => { + it("should be able to construct", () => { + new Characteristic.ReceiverSensitivity(); + }); + }); + + describe("RecordingAudioActive", () => { + it("should be able to construct", () => { + new Characteristic.RecordingAudioActive(); + }); + }); + + describe("RelativeHumidityDehumidifierThreshold", () => { + it("should be able to construct", () => { + new Characteristic.RelativeHumidityDehumidifierThreshold(); + }); + }); + + describe("RelativeHumidityHumidifierThreshold", () => { + it("should be able to construct", () => { + new Characteristic.RelativeHumidityHumidifierThreshold(); + }); + }); + + describe("RelayControlPoint", () => { + it("should be able to construct", () => { + new Characteristic.RelayControlPoint(); + }); + }); + + describe("RelayEnabled", () => { + it("should be able to construct", () => { + new Characteristic.RelayEnabled(); + }); + }); + + describe("RelayState", () => { + it("should be able to construct", () => { + new Characteristic.RelayState(); + }); + }); + + describe("RemainingDuration", () => { + it("should be able to construct", () => { + new Characteristic.RemainingDuration(); + }); + }); + + describe("RemoteKey", () => { + it("should be able to construct", () => { + new Characteristic.RemoteKey(); + }); + }); + + describe("ResetFilterIndication", () => { + it("should be able to construct", () => { + new Characteristic.ResetFilterIndication(); + }); + }); + + describe("RotationDirection", () => { + it("should be able to construct", () => { + new Characteristic.RotationDirection(); + }); + }); + + describe("RotationSpeed", () => { + it("should be able to construct", () => { + new Characteristic.RotationSpeed(); + }); + }); + + describe("RouterStatus", () => { + it("should be able to construct", () => { + new Characteristic.RouterStatus(); + }); + }); + + describe("Saturation", () => { + it("should be able to construct", () => { + new Characteristic.Saturation(); + }); + }); + + describe("SecuritySystemAlarmType", () => { + it("should be able to construct", () => { + new Characteristic.SecuritySystemAlarmType(); + }); + }); + + describe("SecuritySystemCurrentState", () => { + it("should be able to construct", () => { + new Characteristic.SecuritySystemCurrentState(); + }); + }); + + describe("SecuritySystemTargetState", () => { + it("should be able to construct", () => { + new Characteristic.SecuritySystemTargetState(); + }); + }); + + describe("SelectedAudioStreamConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SelectedAudioStreamConfiguration(); + }); + }); + + describe("SelectedCameraRecordingConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SelectedCameraRecordingConfiguration(); + }); + }); + + describe("SelectedRTPStreamConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SelectedRTPStreamConfiguration(); + }); + }); + + describe("SerialNumber", () => { + it("should be able to construct", () => { + new Characteristic.SerialNumber(); + }); + }); + + describe("ServiceLabelIndex", () => { + it("should be able to construct", () => { + new Characteristic.ServiceLabelIndex(); + }); + }); + + describe("ServiceLabelNamespace", () => { + it("should be able to construct", () => { + new Characteristic.ServiceLabelNamespace(); + }); + }); + + describe("SetDuration", () => { + it("should be able to construct", () => { + new Characteristic.SetDuration(); + }); + }); + + describe("SetupDataStreamTransport", () => { + it("should be able to construct", () => { + new Characteristic.SetupDataStreamTransport(); + }); + }); + + describe("SetupEndpoints", () => { + it("should be able to construct", () => { + new Characteristic.SetupEndpoints(); + }); + }); + + describe("SetupTransferTransport", () => { + it("should be able to construct", () => { + new Characteristic.SetupTransferTransport(); + }); + }); + + describe("SignalToNoiseRatio", () => { + it("should be able to construct", () => { + new Characteristic.SignalToNoiseRatio(); + }); + }); + + describe("SiriInputType", () => { + it("should be able to construct", () => { + new Characteristic.SiriInputType(); + }); + }); + + describe("SlatType", () => { + it("should be able to construct", () => { + new Characteristic.SlatType(); + }); + }); + + describe("SleepDiscoveryMode", () => { + it("should be able to construct", () => { + new Characteristic.SleepDiscoveryMode(); + }); + }); + + describe("SleepInterval", () => { + it("should be able to construct", () => { + new Characteristic.SleepInterval(); + }); + }); + + describe("SmokeDetected", () => { + it("should be able to construct", () => { + new Characteristic.SmokeDetected(); + }); + }); + + describe("SoftwareRevision", () => { + it("should be able to construct", () => { + new Characteristic.SoftwareRevision(); + }); + }); + + describe("StatusActive", () => { + it("should be able to construct", () => { + new Characteristic.StatusActive(); + }); + }); + + describe("StatusFault", () => { + it("should be able to construct", () => { + new Characteristic.StatusFault(); + }); + }); + + describe("StatusJammed", () => { + it("should be able to construct", () => { + new Characteristic.StatusJammed(); + }); + }); + + describe("StatusLowBattery", () => { + it("should be able to construct", () => { + new Characteristic.StatusLowBattery(); + }); + }); + + describe("StatusTampered", () => { + it("should be able to construct", () => { + new Characteristic.StatusTampered(); + }); + }); + + describe("StreamingStatus", () => { + it("should be able to construct", () => { + new Characteristic.StreamingStatus(); + }); + }); + + describe("SulphurDioxideDensity", () => { + it("should be able to construct", () => { + new Characteristic.SulphurDioxideDensity(); + }); + }); + + describe("SupportedAudioRecordingConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedAudioRecordingConfiguration(); + }); + }); + + describe("SupportedAudioStreamConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedAudioStreamConfiguration(); + }); + }); + + describe("SupportedCameraRecordingConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedCameraRecordingConfiguration(); + }); + }); + + describe("SupportedCharacteristicValueTransitionConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedCharacteristicValueTransitionConfiguration(); + }); + }); + + describe("SupportedDataStreamTransportConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedDataStreamTransportConfiguration(); + }); + }); + + describe("SupportedDiagnosticsSnapshot", () => { + it("should be able to construct", () => { + new Characteristic.SupportedDiagnosticsSnapshot(); + }); + }); + + describe("SupportedRouterConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedRouterConfiguration(); + }); + }); + + describe("SupportedRTPConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedRTPConfiguration(); + }); + }); + + describe("SupportedTransferTransportConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedTransferTransportConfiguration(); + }); + }); + + describe("SupportedVideoRecordingConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedVideoRecordingConfiguration(); + }); + }); + + describe("SupportedVideoStreamConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.SupportedVideoStreamConfiguration(); + }); + }); + + describe("SwingMode", () => { + it("should be able to construct", () => { + new Characteristic.SwingMode(); + }); + }); + + describe("TargetAirPurifierState", () => { + it("should be able to construct", () => { + new Characteristic.TargetAirPurifierState(); + }); + }); + + describe("TargetControlList", () => { + it("should be able to construct", () => { + new Characteristic.TargetControlList(); + }); + }); + + describe("TargetControlSupportedConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.TargetControlSupportedConfiguration(); + }); + }); + + describe("TargetDoorState", () => { + it("should be able to construct", () => { + new Characteristic.TargetDoorState(); + }); + }); + + describe("TargetFanState", () => { + it("should be able to construct", () => { + new Characteristic.TargetFanState(); + }); + }); + + describe("TargetHeaterCoolerState", () => { + it("should be able to construct", () => { + new Characteristic.TargetHeaterCoolerState(); + }); + }); + + describe("TargetHeatingCoolingState", () => { + it("should be able to construct", () => { + new Characteristic.TargetHeatingCoolingState(); + }); + }); + + describe("TargetHorizontalTiltAngle", () => { + it("should be able to construct", () => { + new Characteristic.TargetHorizontalTiltAngle(); + }); + }); + + describe("TargetHumidifierDehumidifierState", () => { + it("should be able to construct", () => { + new Characteristic.TargetHumidifierDehumidifierState(); + }); + }); + + describe("TargetMediaState", () => { + it("should be able to construct", () => { + new Characteristic.TargetMediaState(); + }); + }); + + describe("TargetPosition", () => { + it("should be able to construct", () => { + new Characteristic.TargetPosition(); + }); + }); + + describe("TargetRelativeHumidity", () => { + it("should be able to construct", () => { + new Characteristic.TargetRelativeHumidity(); + }); + }); + + describe("TargetTemperature", () => { + it("should be able to construct", () => { + new Characteristic.TargetTemperature(); + }); + }); + + describe("TargetTiltAngle", () => { + it("should be able to construct", () => { + new Characteristic.TargetTiltAngle(); + }); + }); + + describe("TargetVerticalTiltAngle", () => { + it("should be able to construct", () => { + new Characteristic.TargetVerticalTiltAngle(); + }); + }); + + describe("TargetVisibilityState", () => { + it("should be able to construct", () => { + new Characteristic.TargetVisibilityState(); + }); + }); + + describe("TemperatureDisplayUnits", () => { + it("should be able to construct", () => { + new Characteristic.TemperatureDisplayUnits(); + }); + }); + + describe("ThirdPartyCameraActive", () => { + it("should be able to construct", () => { + new Characteristic.ThirdPartyCameraActive(); + }); + }); + + describe("ThreadControlPoint", () => { + it("should be able to construct", () => { + new Characteristic.ThreadControlPoint(); + }); + }); + + describe("ThreadNodeCapabilities", () => { + it("should be able to construct", () => { + new Characteristic.ThreadNodeCapabilities(); + }); + }); + + describe("ThreadOpenThreadVersion", () => { + it("should be able to construct", () => { + new Characteristic.ThreadOpenThreadVersion(); + }); + }); + + describe("ThreadStatus", () => { + it("should be able to construct", () => { + new Characteristic.ThreadStatus(); + }); + }); + + describe("TransmitPower", () => { + it("should be able to construct", () => { + new Characteristic.TransmitPower(); + }); + }); + + describe("TunnelConnectionTimeout", () => { + it("should be able to construct", () => { + new Characteristic.TunnelConnectionTimeout(); + }); + }); + + describe("TunneledAccessoryAdvertising", () => { + it("should be able to construct", () => { + new Characteristic.TunneledAccessoryAdvertising(); + }); + }); + + describe("TunneledAccessoryConnected", () => { + it("should be able to construct", () => { + new Characteristic.TunneledAccessoryConnected(); + }); + }); + + describe("TunneledAccessoryStateNumber", () => { + it("should be able to construct", () => { + new Characteristic.TunneledAccessoryStateNumber(); + }); + }); + + describe("ValveType", () => { + it("should be able to construct", () => { + new Characteristic.ValveType(); + }); + }); + + describe("Version", () => { + it("should be able to construct", () => { + new Characteristic.Version(); + }); + }); + + describe("VideoAnalysisActive", () => { + it("should be able to construct", () => { + new Characteristic.VideoAnalysisActive(); + }); + }); + + describe("VOCDensity", () => { + it("should be able to construct", () => { + new Characteristic.VOCDensity(); + }); + }); + + describe("Volume", () => { + it("should be able to construct", () => { + new Characteristic.Volume(); + }); + }); + + describe("VolumeControlType", () => { + it("should be able to construct", () => { + new Characteristic.VolumeControlType(); + }); + }); + + describe("VolumeSelector", () => { + it("should be able to construct", () => { + new Characteristic.VolumeSelector(); + }); + }); + + describe("WakeConfiguration", () => { + it("should be able to construct", () => { + new Characteristic.WakeConfiguration(); + }); + }); + + describe("WANConfigurationList", () => { + it("should be able to construct", () => { + new Characteristic.WANConfigurationList(); + }); + }); + + describe("WANStatusList", () => { + it("should be able to construct", () => { + new Characteristic.WANStatusList(); + }); + }); + + describe("WaterLevel", () => { + it("should be able to construct", () => { + new Characteristic.WaterLevel(); + }); + }); + + describe("WiFiCapabilities", () => { + it("should be able to construct", () => { + new Characteristic.WiFiCapabilities(); + }); + }); + + describe("WiFiConfigurationControl", () => { + it("should be able to construct", () => { + new Characteristic.WiFiConfigurationControl(); + }); + }); + + describe("WiFiSatelliteStatus", () => { + it("should be able to construct", () => { + new Characteristic.WiFiSatelliteStatus(); + }); + }); +}); diff --git a/src/lib/definitions/CharacteristicDefinitions.ts b/src/lib/definitions/CharacteristicDefinitions.ts new file mode 100644 index 000000000..acd03b6b1 --- /dev/null +++ b/src/lib/definitions/CharacteristicDefinitions.ts @@ -0,0 +1,4347 @@ +// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY +// V=856 + +import { Characteristic, Formats, Perms, Units } from "../Characteristic"; + +/** + * Characteristic "Access Control Level" + */ +export class AccessControlLevel extends Characteristic { + + public static readonly UUID: string = "000000E5-0000-1000-8000-0026BB765291"; + + constructor() { + super("Access Control Level", AccessControlLevel.UUID, { + format: Formats.UINT16, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AccessControlLevel = AccessControlLevel; + +/** + * Characteristic "Accessory Flags" + */ +export class AccessoryFlags extends Characteristic { + + public static readonly UUID: string = "000000A6-0000-1000-8000-0026BB765291"; + + public static readonly REQUIRES_ADDITIONAL_SETUP_BIT_MASK = 1; + + constructor() { + super("Accessory Flags", AccessoryFlags.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AccessoryFlags = AccessoryFlags; + +/** + * Characteristic "Accessory Identifier" + */ +export class AccessoryIdentifier extends Characteristic { + + public static readonly UUID: string = "00000057-0000-1000-8000-0026BB765291"; + + constructor() { + super("Accessory Identifier", AccessoryIdentifier.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AccessoryIdentifier = AccessoryIdentifier; + +/** + * Characteristic "Active" + */ +export class Active extends Characteristic { + + public static readonly UUID: string = "000000B0-0000-1000-8000-0026BB765291"; + + public static readonly INACTIVE = 0; + public static readonly ACTIVE = 1; + + constructor() { + super("Active", Active.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Active = Active; + +/** + * Characteristic "Active Identifier" + */ +export class ActiveIdentifier extends Characteristic { + + public static readonly UUID: string = "000000E7-0000-1000-8000-0026BB765291"; + + constructor() { + super("Active Identifier", ActiveIdentifier.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ActiveIdentifier = ActiveIdentifier; + +/** + * Characteristic "Activity Interval" + * @since iOS 14 + */ +export class ActivityInterval extends Characteristic { + + public static readonly UUID: string = "0000023B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Activity Interval", ActivityInterval.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ActivityInterval = ActivityInterval; + +/** + * Characteristic "Administrator Only Access" + */ +export class AdministratorOnlyAccess extends Characteristic { + + public static readonly UUID: string = "00000001-0000-1000-8000-0026BB765291"; + + constructor() { + super("Administrator Only Access", AdministratorOnlyAccess.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AdministratorOnlyAccess = AdministratorOnlyAccess; + +/** + * Characteristic "Air Particulate Density" + */ +export class AirParticulateDensity extends Characteristic { + + public static readonly UUID: string = "00000064-0000-1000-8000-0026BB765291"; + + constructor() { + super("Air Particulate Density", AirParticulateDensity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AirParticulateDensity = AirParticulateDensity; + +/** + * Characteristic "Air Particulate Size" + */ +export class AirParticulateSize extends Characteristic { + + public static readonly UUID: string = "00000065-0000-1000-8000-0026BB765291"; + + public static readonly _2_5_M = 0; + public static readonly _10_M = 1; + + constructor() { + super("Air Particulate Size", AirParticulateSize.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AirParticulateSize = AirParticulateSize; + +/** + * Characteristic "Air Quality" + */ +export class AirQuality extends Characteristic { + + public static readonly UUID: string = "00000095-0000-1000-8000-0026BB765291"; + + public static readonly UNKNOWN = 0; + public static readonly EXCELLENT = 1; + public static readonly GOOD = 2; + public static readonly FAIR = 3; + public static readonly INFERIOR = 4; + public static readonly POOR = 5; + + constructor() { + super("Air Quality", AirQuality.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 5, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AirQuality = AirQuality; + +/** + * Characteristic "App Matching Identifier" + */ +export class AppMatchingIdentifier extends Characteristic { + + public static readonly UUID: string = "000000A4-0000-1000-8000-0026BB765291"; + + constructor() { + super("App Matching Identifier", AppMatchingIdentifier.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AppMatchingIdentifier = AppMatchingIdentifier; + +/** + * Characteristic "Audio Feedback" + */ +export class AudioFeedback extends Characteristic { + + public static readonly UUID: string = "00000005-0000-1000-8000-0026BB765291"; + + constructor() { + super("Audio Feedback", AudioFeedback.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.AudioFeedback = AudioFeedback; + +/** + * Characteristic "Battery Level" + */ +export class BatteryLevel extends Characteristic { + + public static readonly UUID: string = "00000068-0000-1000-8000-0026BB765291"; + + constructor() { + super("Battery Level", BatteryLevel.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.BatteryLevel = BatteryLevel; + +/** + * Characteristic "Brightness" + */ +export class Brightness extends Characteristic { + + public static readonly UUID: string = "00000008-0000-1000-8000-0026BB765291"; + + constructor() { + super("Brightness", Brightness.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Brightness = Brightness; + +/** + * Characteristic "Button Event" + */ +export class ButtonEvent extends Characteristic { + + public static readonly UUID: string = "00000126-0000-1000-8000-0026BB765291"; + + constructor() { + super("Button Event", ButtonEvent.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ButtonEvent = ButtonEvent; + +/** + * Characteristic "Camera Operating Mode Indicator" + */ +export class CameraOperatingModeIndicator extends Characteristic { + + public static readonly UUID: string = "0000021D-0000-1000-8000-0026BB765291"; + + public static readonly DISABLE = 0; + public static readonly ENABLE = 1; + + constructor() { + super("Camera Operating Mode Indicator", CameraOperatingModeIndicator.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CameraOperatingModeIndicator = CameraOperatingModeIndicator; + +/** + * Characteristic "Carbon Dioxide Detected" + */ +export class CarbonDioxideDetected extends Characteristic { + + public static readonly UUID: string = "00000092-0000-1000-8000-0026BB765291"; + + public static readonly CO2_LEVELS_NORMAL = 0; + public static readonly CO2_LEVELS_ABNORMAL = 1; + + constructor() { + super("Carbon Dioxide Detected", CarbonDioxideDetected.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CarbonDioxideDetected = CarbonDioxideDetected; + +/** + * Characteristic "Carbon Dioxide Level" + */ +export class CarbonDioxideLevel extends Characteristic { + + public static readonly UUID: string = "00000093-0000-1000-8000-0026BB765291"; + + constructor() { + super("Carbon Dioxide Level", CarbonDioxideLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 100000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CarbonDioxideLevel = CarbonDioxideLevel; + +/** + * Characteristic "Carbon Dioxide Peak Level" + */ +export class CarbonDioxidePeakLevel extends Characteristic { + + public static readonly UUID: string = "00000094-0000-1000-8000-0026BB765291"; + + constructor() { + super("Carbon Dioxide Peak Level", CarbonDioxidePeakLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 100000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CarbonDioxidePeakLevel = CarbonDioxidePeakLevel; + +/** + * Characteristic "Carbon Monoxide Detected" + */ +export class CarbonMonoxideDetected extends Characteristic { + + public static readonly UUID: string = "00000069-0000-1000-8000-0026BB765291"; + + public static readonly CO_LEVELS_NORMAL = 0; + public static readonly CO_LEVELS_ABNORMAL = 1; + + constructor() { + super("Carbon Monoxide Detected", CarbonMonoxideDetected.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CarbonMonoxideDetected = CarbonMonoxideDetected; + +/** + * Characteristic "Carbon Monoxide Level" + */ +export class CarbonMonoxideLevel extends Characteristic { + + public static readonly UUID: string = "00000090-0000-1000-8000-0026BB765291"; + + constructor() { + super("Carbon Monoxide Level", CarbonMonoxideLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CarbonMonoxideLevel = CarbonMonoxideLevel; + +/** + * Characteristic "Carbon Monoxide Peak Level" + */ +export class CarbonMonoxidePeakLevel extends Characteristic { + + public static readonly UUID: string = "00000091-0000-1000-8000-0026BB765291"; + + constructor() { + super("Carbon Monoxide Peak Level", CarbonMonoxidePeakLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CarbonMonoxidePeakLevel = CarbonMonoxidePeakLevel; + +/** + * Characteristic "CCA Energy Detect Threshold" + * @since iOS 14 + */ +export class CCAEnergyDetectThreshold extends Characteristic { + + public static readonly UUID: string = "00000246-0000-1000-8000-0026BB765291"; + + constructor() { + super("CCA Energy Detect Threshold", CCAEnergyDetectThreshold.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CCAEnergyDetectThreshold = CCAEnergyDetectThreshold; + +/** + * Characteristic "CCA Signal Detect Threshold" + * @since iOS 14 + */ +export class CCASignalDetectThreshold extends Characteristic { + + public static readonly UUID: string = "00000245-0000-1000-8000-0026BB765291"; + + constructor() { + super("CCA Signal Detect Threshold", CCASignalDetectThreshold.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CCASignalDetectThreshold = CCASignalDetectThreshold; + +/** + * Characteristic "Characteristic Value Active Transition Count" + * @since iOS 14 + */ +export class CharacteristicValueActiveTransitionCount extends Characteristic { + + public static readonly UUID: string = "0000024B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Characteristic Value Active Transition Count", CharacteristicValueActiveTransitionCount.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CharacteristicValueActiveTransitionCount = CharacteristicValueActiveTransitionCount; + +/** + * Characteristic "Characteristic Value Transition Control" + * @since iOS 14 + */ +export class CharacteristicValueTransitionControl extends Characteristic { + + public static readonly UUID: string = "00000143-0000-1000-8000-0026BB765291"; + + constructor() { + super("Characteristic Value Transition Control", CharacteristicValueTransitionControl.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CharacteristicValueTransitionControl = CharacteristicValueTransitionControl; + +/** + * Characteristic "Charging State" + */ +export class ChargingState extends Characteristic { + + public static readonly UUID: string = "0000008F-0000-1000-8000-0026BB765291"; + + public static readonly NOT_CHARGING = 0; + public static readonly CHARGING = 1; + public static readonly NOT_CHARGEABLE = 2; + + constructor() { + super("Charging State", ChargingState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ChargingState = ChargingState; + +/** + * Characteristic "Closed Captions" + */ +export class ClosedCaptions extends Characteristic { + + public static readonly UUID: string = "000000DD-0000-1000-8000-0026BB765291"; + + public static readonly DISABLED = 0; + public static readonly ENABLED = 1; + + constructor() { + super("Closed Captions", ClosedCaptions.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ClosedCaptions = ClosedCaptions; + +/** + * Characteristic "Color Temperature" + */ +export class ColorTemperature extends Characteristic { + + public static readonly UUID: string = "000000CE-0000-1000-8000-0026BB765291"; + + constructor() { + super("Color Temperature", ColorTemperature.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 140, + maxValue: 500, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ColorTemperature = ColorTemperature; + +/** + * Characteristic "Configured Name" + */ +export class ConfiguredName extends Characteristic { + + public static readonly UUID: string = "000000E3-0000-1000-8000-0026BB765291"; + + constructor() { + super("Configured Name", ConfiguredName.UUID, { + format: Formats.STRING, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ConfiguredName = ConfiguredName; + +/** + * Characteristic "Contact Sensor State" + */ +export class ContactSensorState extends Characteristic { + + public static readonly UUID: string = "0000006A-0000-1000-8000-0026BB765291"; + + public static readonly CONTACT_DETECTED = 0; + public static readonly CONTACT_NOT_DETECTED = 1; + + constructor() { + super("Contact Sensor State", ContactSensorState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ContactSensorState = ContactSensorState; + +/** + * Characteristic "Cooling Threshold Temperature" + */ +export class CoolingThresholdTemperature extends Characteristic { + + public static readonly UUID: string = "0000000D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Cooling Threshold Temperature", CoolingThresholdTemperature.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.CELSIUS, + minValue: 10, + maxValue: 35, + minStep: 0.1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CoolingThresholdTemperature = CoolingThresholdTemperature; + +/** + * Characteristic "Current Air Purifier State" + */ +export class CurrentAirPurifierState extends Characteristic { + + public static readonly UUID: string = "000000A9-0000-1000-8000-0026BB765291"; + + public static readonly INACTIVE = 0; + public static readonly IDLE = 1; + public static readonly PURIFYING_AIR = 2; + + constructor() { + super("Current Air Purifier State", CurrentAirPurifierState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentAirPurifierState = CurrentAirPurifierState; + +/** + * Characteristic "Current Ambient Light Level" + */ +export class CurrentAmbientLightLevel extends Characteristic { + + public static readonly UUID: string = "0000006B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Ambient Light Level", CurrentAmbientLightLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.LUX, + minValue: 0.0001, + maxValue: 100000, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentAmbientLightLevel = CurrentAmbientLightLevel; + +/** + * Characteristic "Current Door State" + */ +export class CurrentDoorState extends Characteristic { + + public static readonly UUID: string = "0000000E-0000-1000-8000-0026BB765291"; + + public static readonly OPEN = 0; + public static readonly CLOSED = 1; + public static readonly OPENING = 2; + public static readonly CLOSING = 3; + public static readonly STOPPED = 4; + + constructor() { + super("Current Door State", CurrentDoorState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 4, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentDoorState = CurrentDoorState; + +/** + * Characteristic "Current Fan State" + */ +export class CurrentFanState extends Characteristic { + + public static readonly UUID: string = "000000AF-0000-1000-8000-0026BB765291"; + + public static readonly INACTIVE = 0; + public static readonly IDLE = 1; + public static readonly BLOWING_AIR = 2; + + constructor() { + super("Current Fan State", CurrentFanState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentFanState = CurrentFanState; + +/** + * Characteristic "Current Heater-Cooler State" + */ +export class CurrentHeaterCoolerState extends Characteristic { + + public static readonly UUID: string = "000000B1-0000-1000-8000-0026BB765291"; + + public static readonly INACTIVE = 0; + public static readonly IDLE = 1; + public static readonly HEATING = 2; + public static readonly COOLING = 3; + + constructor() { + super("Current Heater-Cooler State", CurrentHeaterCoolerState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentHeaterCoolerState = CurrentHeaterCoolerState; + +/** + * Characteristic "Current Heating Cooling State" + */ +export class CurrentHeatingCoolingState extends Characteristic { + + public static readonly UUID: string = "0000000F-0000-1000-8000-0026BB765291"; + + public static readonly OFF = 0; + public static readonly HEAT = 1; + public static readonly COOL = 2; + + constructor() { + super("Current Heating Cooling State", CurrentHeatingCoolingState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentHeatingCoolingState = CurrentHeatingCoolingState; + +/** + * Characteristic "Current Horizontal Tilt Angle" + */ +export class CurrentHorizontalTiltAngle extends Characteristic { + + public static readonly UUID: string = "0000006C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Horizontal Tilt Angle", CurrentHorizontalTiltAngle.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.ARC_DEGREE, + minValue: -90, + maxValue: 90, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentHorizontalTiltAngle = CurrentHorizontalTiltAngle; + +/** + * Characteristic "Current Humidifier-Dehumidifier State" + */ +export class CurrentHumidifierDehumidifierState extends Characteristic { + + public static readonly UUID: string = "000000B3-0000-1000-8000-0026BB765291"; + + public static readonly INACTIVE = 0; + public static readonly IDLE = 1; + public static readonly HUMIDIFYING = 2; + public static readonly DEHUMIDIFYING = 3; + + constructor() { + super("Current Humidifier-Dehumidifier State", CurrentHumidifierDehumidifierState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentHumidifierDehumidifierState = CurrentHumidifierDehumidifierState; + +/** + * Characteristic "Current Media State" + */ +export class CurrentMediaState extends Characteristic { + + public static readonly UUID: string = "000000E0-0000-1000-8000-0026BB765291"; + + public static readonly PLAY = 0; + public static readonly PAUSE = 1; + public static readonly STOP = 2; + public static readonly LOADING = 4; + public static readonly INTERRUPTED = 5; + + constructor() { + super("Current Media State", CurrentMediaState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 5, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentMediaState = CurrentMediaState; + +/** + * Characteristic "Current Position" + */ +export class CurrentPosition extends Characteristic { + + public static readonly UUID: string = "0000006D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Position", CurrentPosition.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentPosition = CurrentPosition; + +/** + * Characteristic "Current Relative Humidity" + */ +export class CurrentRelativeHumidity extends Characteristic { + + public static readonly UUID: string = "00000010-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Relative Humidity", CurrentRelativeHumidity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentRelativeHumidity = CurrentRelativeHumidity; + +/** + * Characteristic "Current Slat State" + */ +export class CurrentSlatState extends Characteristic { + + public static readonly UUID: string = "000000AA-0000-1000-8000-0026BB765291"; + + public static readonly FIXED = 0; + public static readonly JAMMED = 1; + public static readonly SWINGING = 2; + + constructor() { + super("Current Slat State", CurrentSlatState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentSlatState = CurrentSlatState; + +/** + * Characteristic "Current Temperature" + */ +export class CurrentTemperature extends Characteristic { + + public static readonly UUID: string = "00000011-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Temperature", CurrentTemperature.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.CELSIUS, + minValue: 0, + maxValue: 100, + minStep: 0.1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentTemperature = CurrentTemperature; + +/** + * Characteristic "Current Tilt Angle" + */ +export class CurrentTiltAngle extends Characteristic { + + public static readonly UUID: string = "000000C1-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Tilt Angle", CurrentTiltAngle.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.ARC_DEGREE, + minValue: -90, + maxValue: 90, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentTiltAngle = CurrentTiltAngle; + +/** + * Characteristic "Current Transport" + * @since iOS 14 + */ +export class CurrentTransport extends Characteristic { + + public static readonly UUID: string = "0000022B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Transport", CurrentTransport.UUID, { + format: Formats.BOOL, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentTransport = CurrentTransport; + +/** + * Characteristic "Current Vertical Tilt Angle" + */ +export class CurrentVerticalTiltAngle extends Characteristic { + + public static readonly UUID: string = "0000006E-0000-1000-8000-0026BB765291"; + + constructor() { + super("Current Vertical Tilt Angle", CurrentVerticalTiltAngle.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.ARC_DEGREE, + minValue: -90, + maxValue: 90, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentVerticalTiltAngle = CurrentVerticalTiltAngle; + +/** + * Characteristic "Current Visibility State" + */ +export class CurrentVisibilityState extends Characteristic { + + public static readonly UUID: string = "00000135-0000-1000-8000-0026BB765291"; + + public static readonly SHOWN = 0; + public static readonly HIDDEN = 1; + + constructor() { + super("Current Visibility State", CurrentVisibilityState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.CurrentVisibilityState = CurrentVisibilityState; + +/** + * Characteristic "Data Stream HAP Transport" + * @since iOS 14 + */ +export class DataStreamHAPTransport extends Characteristic { + + public static readonly UUID: string = "00000138-0000-1000-8000-0026BB765291"; + + constructor() { + super("Data Stream HAP Transport", DataStreamHAPTransport.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.DataStreamHAPTransport = DataStreamHAPTransport; + +/** + * Characteristic "Data Stream HAP Transport Interrupt" + * @since iOS 14 + */ +export class DataStreamHAPTransportInterrupt extends Characteristic { + + public static readonly UUID: string = "00000139-0000-1000-8000-0026BB765291"; + + constructor() { + super("Data Stream HAP Transport Interrupt", DataStreamHAPTransportInterrupt.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.DataStreamHAPTransportInterrupt = DataStreamHAPTransportInterrupt; + +/** + * Characteristic "Diagonal Field Of View" + * @since iOS 13.2 + */ +export class DiagonalFieldOfView extends Characteristic { + + public static readonly UUID: string = "00000224-0000-1000-8000-0026BB765291"; + + constructor() { + super("Diagonal Field Of View", DiagonalFieldOfView.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.ARC_DEGREE, + minValue: 0, + maxValue: 360, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.DiagonalFieldOfView = DiagonalFieldOfView; + +/** + * Characteristic "Digital Zoom" + */ +export class DigitalZoom extends Characteristic { + + public static readonly UUID: string = "0000011D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Digital Zoom", DigitalZoom.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minStep: 0.1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.DigitalZoom = DigitalZoom; + +/** + * Characteristic "Display Order" + */ +export class DisplayOrder extends Characteristic { + + public static readonly UUID: string = "00000136-0000-1000-8000-0026BB765291"; + + constructor() { + super("Display Order", DisplayOrder.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.DisplayOrder = DisplayOrder; + +/** + * Characteristic "Event Retransmission Maximum" + * @since iOS 14 + */ +export class EventRetransmissionMaximum extends Characteristic { + + public static readonly UUID: string = "0000023D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Event Retransmission Maximum", EventRetransmissionMaximum.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.EventRetransmissionMaximum = EventRetransmissionMaximum; + +/** + * Characteristic "Event Snapshots Active" + */ +export class EventSnapshotsActive extends Characteristic { + + public static readonly UUID: string = "00000223-0000-1000-8000-0026BB765291"; + + public static readonly DISABLE = 0; + public static readonly ENABLE = 1; + + constructor() { + super("Event Snapshots Active", EventSnapshotsActive.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.EventSnapshotsActive = EventSnapshotsActive; + +/** + * Characteristic "Event Transmission Counters" + * @since iOS 14 + */ +export class EventTransmissionCounters extends Characteristic { + + public static readonly UUID: string = "0000023E-0000-1000-8000-0026BB765291"; + + constructor() { + super("Event Transmission Counters", EventTransmissionCounters.UUID, { + format: Formats.UINT32, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.EventTransmissionCounters = EventTransmissionCounters; + +/** + * Characteristic "Filter Change Indication" + */ +export class FilterChangeIndication extends Characteristic { + + public static readonly UUID: string = "000000AC-0000-1000-8000-0026BB765291"; + + public static readonly FILTER_OK = 0; + public static readonly CHANGE_FILTER = 1; + + constructor() { + super("Filter Change Indication", FilterChangeIndication.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.FilterChangeIndication = FilterChangeIndication; + +/** + * Characteristic "Filter Life Level" + */ +export class FilterLifeLevel extends Characteristic { + + public static readonly UUID: string = "000000AB-0000-1000-8000-0026BB765291"; + + constructor() { + super("Filter Life Level", FilterLifeLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.FilterLifeLevel = FilterLifeLevel; + +/** + * Characteristic "Firmware Revision" + */ +export class FirmwareRevision extends Characteristic { + + public static readonly UUID: string = "00000052-0000-1000-8000-0026BB765291"; + + constructor() { + super("Firmware Revision", FirmwareRevision.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.FirmwareRevision = FirmwareRevision; + +/** + * Characteristic "Hardware Revision" + */ +export class HardwareRevision extends Characteristic { + + public static readonly UUID: string = "00000053-0000-1000-8000-0026BB765291"; + + constructor() { + super("Hardware Revision", HardwareRevision.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.HardwareRevision = HardwareRevision; + +/** + * Characteristic "Heart Beat" + * @since iOS 14 + */ +export class HeartBeat extends Characteristic { + + public static readonly UUID: string = "0000024A-0000-1000-8000-0026BB765291"; + + constructor() { + super("Heart Beat", HeartBeat.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.HeartBeat = HeartBeat; + +/** + * Characteristic "Heating Threshold Temperature" + */ +export class HeatingThresholdTemperature extends Characteristic { + + public static readonly UUID: string = "00000012-0000-1000-8000-0026BB765291"; + + constructor() { + super("Heating Threshold Temperature", HeatingThresholdTemperature.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.CELSIUS, + minValue: 0, + maxValue: 25, + minStep: 0.1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.HeatingThresholdTemperature = HeatingThresholdTemperature; + +/** + * Characteristic "Hold Position" + */ +export class HoldPosition extends Characteristic { + + public static readonly UUID: string = "0000006F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Hold Position", HoldPosition.UUID, { + format: Formats.BOOL, + perms: [Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.HoldPosition = HoldPosition; + +/** + * Characteristic "HomeKit Camera Active" + */ +export class HomeKitCameraActive extends Characteristic { + + public static readonly UUID: string = "0000021B-0000-1000-8000-0026BB765291"; + + public static readonly OFF = 0; + public static readonly ON = 1; + + constructor() { + super("HomeKit Camera Active", HomeKitCameraActive.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.HomeKitCameraActive = HomeKitCameraActive; + +/** + * Characteristic "Hue" + */ +export class Hue extends Characteristic { + + public static readonly UUID: string = "00000013-0000-1000-8000-0026BB765291"; + + constructor() { + super("Hue", Hue.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.ARC_DEGREE, + minValue: 0, + maxValue: 360, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Hue = Hue; + +/** + * Characteristic "Identifier" + */ +export class Identifier extends Characteristic { + + public static readonly UUID: string = "000000E6-0000-1000-8000-0026BB765291"; + + constructor() { + super("Identifier", Identifier.UUID, { + format: Formats.UINT32, + perms: [Perms.PAIRED_READ], + minValue: 0, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Identifier = Identifier; + +/** + * Characteristic "Identify" + */ +export class Identify extends Characteristic { + + public static readonly UUID: string = "00000014-0000-1000-8000-0026BB765291"; + + constructor() { + super("Identify", Identify.UUID, { + format: Formats.BOOL, + perms: [Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Identify = Identify; + +/** + * Characteristic "Image Mirroring" + */ +export class ImageMirroring extends Characteristic { + + public static readonly UUID: string = "0000011F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Image Mirroring", ImageMirroring.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ImageMirroring = ImageMirroring; + +/** + * Characteristic "Image Rotation" + */ +export class ImageRotation extends Characteristic { + + public static readonly UUID: string = "0000011E-0000-1000-8000-0026BB765291"; + + constructor() { + super("Image Rotation", ImageRotation.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.ARC_DEGREE, + minValue: 0, + maxValue: 360, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ImageRotation = ImageRotation; + +/** + * Characteristic "Input Device Type" + */ +export class InputDeviceType extends Characteristic { + + public static readonly UUID: string = "000000DC-0000-1000-8000-0026BB765291"; + + public static readonly OTHER = 0; + public static readonly TV = 1; + public static readonly RECORDING = 2; + public static readonly TUNER = 3; + public static readonly PLAYBACK = 4; + public static readonly AUDIO_SYSTEM = 5; + + constructor() { + super("Input Device Type", InputDeviceType.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 6, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.InputDeviceType = InputDeviceType; + +/** + * Characteristic "Input Source Type" + */ +export class InputSourceType extends Characteristic { + + public static readonly UUID: string = "000000DB-0000-1000-8000-0026BB765291"; + + public static readonly OTHER = 0; + public static readonly HOME_SCREEN = 1; + public static readonly TUNER = 2; + public static readonly HDMI = 3; + public static readonly COMPOSITE_VIDEO = 4; + public static readonly S_VIDEO = 5; + public static readonly COMPONENT_VIDEO = 6; + public static readonly DVI = 7; + public static readonly AIRPLAY = 8; + public static readonly USB = 9; + public static readonly APPLICATION = 10; + + constructor() { + super("Input Source Type", InputSourceType.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 10, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.InputSourceType = InputSourceType; + +/** + * Characteristic "In Use" + */ +export class InUse extends Characteristic { + + public static readonly UUID: string = "000000D2-0000-1000-8000-0026BB765291"; + + public static readonly NOT_IN_USE = 0; + public static readonly IN_USE = 1; + + constructor() { + super("In Use", InUse.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.InUse = InUse; + +/** + * Characteristic "Is Configured" + */ +export class IsConfigured extends Characteristic { + + public static readonly UUID: string = "000000D6-0000-1000-8000-0026BB765291"; + + public static readonly NOT_CONFIGURED = 0; + public static readonly CONFIGURED = 1; + + constructor() { + super("Is Configured", IsConfigured.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.IsConfigured = IsConfigured; + +/** + * Characteristic "Leak Detected" + */ +export class LeakDetected extends Characteristic { + + public static readonly UUID: string = "00000070-0000-1000-8000-0026BB765291"; + + public static readonly LEAK_NOT_DETECTED = 0; + public static readonly LEAK_DETECTED = 1; + + constructor() { + super("Leak Detected", LeakDetected.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LeakDetected = LeakDetected; + +/** + * Characteristic "List Pairings" + */ +export class ListPairings extends Characteristic { + + public static readonly UUID: string = "00000050-0000-1000-8000-0026BB765291"; + + constructor() { + super("List Pairings", ListPairings.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +// noinspection JSDeprecatedSymbols +Characteristic.PairingPairings = ListPairings; +Characteristic.ListPairings = ListPairings; + +/** + * Characteristic "Lock Control Point" + */ +export class LockControlPoint extends Characteristic { + + public static readonly UUID: string = "00000019-0000-1000-8000-0026BB765291"; + + constructor() { + super("Lock Control Point", LockControlPoint.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LockControlPoint = LockControlPoint; + +/** + * Characteristic "Lock Current State" + */ +export class LockCurrentState extends Characteristic { + + public static readonly UUID: string = "0000001D-0000-1000-8000-0026BB765291"; + + public static readonly UNSECURED = 0; + public static readonly SECURED = 1; + public static readonly JAMMED = 2; + public static readonly UNKNOWN = 3; + + constructor() { + super("Lock Current State", LockCurrentState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LockCurrentState = LockCurrentState; + +/** + * Characteristic "Lock Last Known Action" + */ +export class LockLastKnownAction extends Characteristic { + + public static readonly UUID: string = "0000001C-0000-1000-8000-0026BB765291"; + + public static readonly SECURED_PHYSICALLY_INTERIOR = 0; + public static readonly UNSECURED_PHYSICALLY_INTERIOR = 1; + public static readonly SECURED_PHYSICALLY_EXTERIOR = 2; + public static readonly UNSECURED_PHYSICALLY_EXTERIOR = 3; + public static readonly SECURED_BY_KEYPAD = 4; + public static readonly UNSECURED_BY_KEYPAD = 5; + public static readonly SECURED_REMOTELY = 6; + public static readonly UNSECURED_REMOTELY = 7; + public static readonly SECURED_BY_AUTO_SECURE_TIMEOUT = 8; + + constructor() { + super("Lock Last Known Action", LockLastKnownAction.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 8, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LockLastKnownAction = LockLastKnownAction; + +/** + * Characteristic "Lock Management Auto Security Timeout" + */ +export class LockManagementAutoSecurityTimeout extends Characteristic { + + public static readonly UUID: string = "0000001A-0000-1000-8000-0026BB765291"; + + constructor() { + super("Lock Management Auto Security Timeout", LockManagementAutoSecurityTimeout.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.SECONDS, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LockManagementAutoSecurityTimeout = LockManagementAutoSecurityTimeout; + +/** + * Characteristic "Lock Physical Controls" + */ +export class LockPhysicalControls extends Characteristic { + + public static readonly UUID: string = "000000A7-0000-1000-8000-0026BB765291"; + + public static readonly CONTROL_LOCK_DISABLED = 0; + public static readonly CONTROL_LOCK_ENABLED = 1; + + constructor() { + super("Lock Physical Controls", LockPhysicalControls.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LockPhysicalControls = LockPhysicalControls; + +/** + * Characteristic "Lock Target State" + */ +export class LockTargetState extends Characteristic { + + public static readonly UUID: string = "0000001E-0000-1000-8000-0026BB765291"; + + public static readonly UNSECURED = 0; + public static readonly SECURED = 1; + + constructor() { + super("Lock Target State", LockTargetState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.ADDITIONAL_AUTHORIZATION], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.LockTargetState = LockTargetState; + +/** + * Characteristic "Logs" + */ +export class Logs extends Characteristic { + + public static readonly UUID: string = "0000001F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Logs", Logs.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Logs = Logs; + +/** + * Characteristic "MAC Retransmission Maximum" + * @since iOS 14 + */ +export class MACRetransmissionMaximum extends Characteristic { + + public static readonly UUID: string = "00000247-0000-1000-8000-0026BB765291"; + + constructor() { + super("MAC Retransmission Maximum", MACRetransmissionMaximum.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.MACRetransmissionMaximum = MACRetransmissionMaximum; + +/** + * Characteristic "MAC Transmission Counters" + */ +export class MACTransmissionCounters extends Characteristic { + + public static readonly UUID: string = "00000248-0000-1000-8000-0026BB765291"; + + constructor() { + super("MAC Transmission Counters", MACTransmissionCounters.UUID, { + format: Formats.DATA, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.MACTransmissionCounters = MACTransmissionCounters; + +/** + * Characteristic "Managed Network Enable" + */ +export class ManagedNetworkEnable extends Characteristic { + + public static readonly UUID: string = "00000215-0000-1000-8000-0026BB765291"; + + public static readonly DISABLED = 0; + public static readonly ENABLED = 1; + + constructor() { + super("Managed Network Enable", ManagedNetworkEnable.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + minValue: 0, + maxValue: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ManagedNetworkEnable = ManagedNetworkEnable; + +/** + * Characteristic "Manually Disabled" + */ +export class ManuallyDisabled extends Characteristic { + + public static readonly UUID: string = "00000227-0000-1000-8000-0026BB765291"; + + public static readonly ENABLED = 0; + public static readonly DISABLED = 1; + + constructor() { + super("Manually Disabled", ManuallyDisabled.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ManuallyDisabled = ManuallyDisabled; + +/** + * Characteristic "Manufacturer" + */ +export class Manufacturer extends Characteristic { + + public static readonly UUID: string = "00000020-0000-1000-8000-0026BB765291"; + + constructor() { + super("Manufacturer", Manufacturer.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + maxLen: 64, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Manufacturer = Manufacturer; + +/** + * Characteristic "Maximum Transmit Power" + * @since iOS 14 + */ +export class MaximumTransmitPower extends Characteristic { + + public static readonly UUID: string = "00000243-0000-1000-8000-0026BB765291"; + + constructor() { + super("Maximum Transmit Power", MaximumTransmitPower.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.MaximumTransmitPower = MaximumTransmitPower; + +/** + * Characteristic "Model" + */ +export class Model extends Characteristic { + + public static readonly UUID: string = "00000021-0000-1000-8000-0026BB765291"; + + constructor() { + super("Model", Model.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + maxLen: 64, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Model = Model; + +/** + * Characteristic "Motion Detected" + */ +export class MotionDetected extends Characteristic { + + public static readonly UUID: string = "00000022-0000-1000-8000-0026BB765291"; + + constructor() { + super("Motion Detected", MotionDetected.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.MotionDetected = MotionDetected; + +/** + * Characteristic "Mute" + */ +export class Mute extends Characteristic { + + public static readonly UUID: string = "0000011A-0000-1000-8000-0026BB765291"; + + constructor() { + super("Mute", Mute.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Mute = Mute; + +/** + * Characteristic "Name" + */ +export class Name extends Characteristic { + + public static readonly UUID: string = "00000023-0000-1000-8000-0026BB765291"; + + constructor() { + super("Name", Name.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + maxLen: 64, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Name = Name; + +/** + * Characteristic "Network Access Violation Control" + */ +export class NetworkAccessViolationControl extends Characteristic { + + public static readonly UUID: string = "0000021F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Network Access Violation Control", NetworkAccessViolationControl.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.NetworkAccessViolationControl = NetworkAccessViolationControl; + +/** + * Characteristic "Network Client Profile Control" + */ +export class NetworkClientProfileControl extends Characteristic { + + public static readonly UUID: string = "0000020C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Network Client Profile Control", NetworkClientProfileControl.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.NetworkClientProfileControl = NetworkClientProfileControl; + +/** + * Characteristic "Network Client Status Control" + */ +export class NetworkClientStatusControl extends Characteristic { + + public static readonly UUID: string = "0000020D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Network Client Status Control", NetworkClientStatusControl.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.NetworkClientStatusControl = NetworkClientStatusControl; + +/** + * Characteristic "Night Vision" + */ +export class NightVision extends Characteristic { + + public static readonly UUID: string = "0000011B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Night Vision", NightVision.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.NightVision = NightVision; + +/** + * Characteristic "Nitrogen Dioxide Density" + */ +export class NitrogenDioxideDensity extends Characteristic { + + public static readonly UUID: string = "000000C4-0000-1000-8000-0026BB765291"; + + constructor() { + super("Nitrogen Dioxide Density", NitrogenDioxideDensity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.NitrogenDioxideDensity = NitrogenDioxideDensity; + +/** + * Characteristic "Obstruction Detected" + */ +export class ObstructionDetected extends Characteristic { + + public static readonly UUID: string = "00000024-0000-1000-8000-0026BB765291"; + + constructor() { + super("Obstruction Detected", ObstructionDetected.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ObstructionDetected = ObstructionDetected; + +/** + * Characteristic "Occupancy Detected" + */ +export class OccupancyDetected extends Characteristic { + + public static readonly UUID: string = "00000071-0000-1000-8000-0026BB765291"; + + public static readonly OCCUPANCY_NOT_DETECTED = 0; + public static readonly OCCUPANCY_DETECTED = 1; + + constructor() { + super("Occupancy Detected", OccupancyDetected.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.OccupancyDetected = OccupancyDetected; + +/** + * Characteristic "On" + */ +export class On extends Characteristic { + + public static readonly UUID: string = "00000025-0000-1000-8000-0026BB765291"; + + constructor() { + super("On", On.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.On = On; + +/** + * Characteristic "Operating State Response" + * @since iOS 14 + */ +export class OperatingStateResponse extends Characteristic { + + public static readonly UUID: string = "00000232-0000-1000-8000-0026BB765291"; + + constructor() { + super("Operating State Response", OperatingStateResponse.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.OperatingStateResponse = OperatingStateResponse; + +/** + * Characteristic "Optical Zoom" + */ +export class OpticalZoom extends Characteristic { + + public static readonly UUID: string = "0000011C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Optical Zoom", OpticalZoom.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minStep: 0.1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.OpticalZoom = OpticalZoom; + +/** + * Characteristic "Outlet In Use" + */ +export class OutletInUse extends Characteristic { + + public static readonly UUID: string = "00000026-0000-1000-8000-0026BB765291"; + + constructor() { + super("Outlet In Use", OutletInUse.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.OutletInUse = OutletInUse; + +/** + * Characteristic "Ozone Density" + */ +export class OzoneDensity extends Characteristic { + + public static readonly UUID: string = "000000C3-0000-1000-8000-0026BB765291"; + + constructor() { + super("Ozone Density", OzoneDensity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.OzoneDensity = OzoneDensity; + +/** + * Characteristic "Pairing Features" + */ +export class PairingFeatures extends Characteristic { + + public static readonly UUID: string = "0000004F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Pairing Features", PairingFeatures.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PairingFeatures = PairingFeatures; + +/** + * Characteristic "Pair Setup" + */ +export class PairSetup extends Characteristic { + + public static readonly UUID: string = "0000004C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Pair Setup", PairSetup.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PairSetup = PairSetup; + +/** + * Characteristic "Pair Verify" + */ +export class PairVerify extends Characteristic { + + public static readonly UUID: string = "0000004E-0000-1000-8000-0026BB765291"; + + constructor() { + super("Pair Verify", PairVerify.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PairVerify = PairVerify; + +/** + * Characteristic "Password Setting" + */ +export class PasswordSetting extends Characteristic { + + public static readonly UUID: string = "000000E4-0000-1000-8000-0026BB765291"; + + constructor() { + super("Password Setting", PasswordSetting.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PasswordSetting = PasswordSetting; + +/** + * Characteristic "Periodic Snapshots Active" + */ +export class PeriodicSnapshotsActive extends Characteristic { + + public static readonly UUID: string = "00000225-0000-1000-8000-0026BB765291"; + + public static readonly DISABLE = 0; + public static readonly ENABLE = 1; + + constructor() { + super("Periodic Snapshots Active", PeriodicSnapshotsActive.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PeriodicSnapshotsActive = PeriodicSnapshotsActive; + +/** + * Characteristic "Picture Mode" + */ +export class PictureMode extends Characteristic { + + public static readonly UUID: string = "000000E2-0000-1000-8000-0026BB765291"; + + public static readonly OTHER = 0; + public static readonly STANDARD = 1; + public static readonly CALIBRATED = 2; + public static readonly CALIBRATED_DARK = 3; + public static readonly VIVID = 4; + public static readonly GAME = 5; + public static readonly COMPUTER = 6; + public static readonly CUSTOM = 7; + + constructor() { + super("Picture Mode", PictureMode.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 13, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PictureMode = PictureMode; + +/** + * Characteristic "Ping" + * @since iOS 14 + */ +export class Ping extends Characteristic { + + public static readonly UUID: string = "0000023C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Ping", Ping.UUID, { + format: Formats.DATA, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Ping = Ping; + +/** + * Characteristic "PM10 Density" + */ +export class PM10Density extends Characteristic { + + public static readonly UUID: string = "000000C7-0000-1000-8000-0026BB765291"; + + constructor() { + super("PM10 Density", PM10Density.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PM10Density = PM10Density; + +/** + * Characteristic "PM2.5 Density" + */ +export class PM2_5Density extends Characteristic { + + public static readonly UUID: string = "000000C6-0000-1000-8000-0026BB765291"; + + constructor() { + super("PM2.5 Density", PM2_5Density.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PM2_5Density = PM2_5Density; + +/** + * Characteristic "Position State" + */ +export class PositionState extends Characteristic { + + public static readonly UUID: string = "00000072-0000-1000-8000-0026BB765291"; + + public static readonly DECREASING = 0; + public static readonly INCREASING = 1; + public static readonly STOPPED = 2; + + constructor() { + super("Position State", PositionState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PositionState = PositionState; + +/** + * Characteristic "Power Mode Selection" + */ +export class PowerModeSelection extends Characteristic { + + public static readonly UUID: string = "000000DF-0000-1000-8000-0026BB765291"; + + public static readonly SHOW = 0; + public static readonly HIDE = 1; + + constructor() { + super("Power Mode Selection", PowerModeSelection.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.PowerModeSelection = PowerModeSelection; + +/** + * Characteristic "Product Data" + */ +export class ProductData extends Characteristic { + + public static readonly UUID: string = "00000220-0000-1000-8000-0026BB765291"; + + constructor() { + super("Product Data", ProductData.UUID, { + format: Formats.DATA, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ProductData = ProductData; + +/** + * Characteristic "Programmable Switch Event" + */ +export class ProgrammableSwitchEvent extends Characteristic { + + public static readonly UUID: string = "00000073-0000-1000-8000-0026BB765291"; + + public static readonly SINGLE_PRESS = 0; + public static readonly DOUBLE_PRESS = 1; + public static readonly LONG_PRESS = 2; + + constructor() { + super("Programmable Switch Event", ProgrammableSwitchEvent.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ProgrammableSwitchEvent = ProgrammableSwitchEvent; + +/** + * Characteristic "Programmable Switch Output State" + */ +export class ProgrammableSwitchOutputState extends Characteristic { + + public static readonly UUID: string = "00000074-0000-1000-8000-0026BB765291"; + + constructor() { + super("Programmable Switch Output State", ProgrammableSwitchOutputState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ProgrammableSwitchOutputState = ProgrammableSwitchOutputState; + +/** + * Characteristic "Program Mode" + */ +export class ProgramMode extends Characteristic { + + public static readonly UUID: string = "000000D1-0000-1000-8000-0026BB765291"; + + public static readonly NO_PROGRAM_SCHEDULED = 0; + public static readonly PROGRAM_SCHEDULED = 1; + public static readonly PROGRAM_SCHEDULED_MANUAL_MODE_ = 2; + + constructor() { + super("Program Mode", ProgramMode.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ProgramMode = ProgramMode; + +/** + * Characteristic "Received Signal Strength Indication" + * @since iOS 14 + */ +export class ReceivedSignalStrengthIndication extends Characteristic { + + public static readonly UUID: string = "0000023F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Received Signal Strength Indication", ReceivedSignalStrengthIndication.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ReceivedSignalStrengthIndication = ReceivedSignalStrengthIndication; + +/** + * Characteristic "Receiver Sensitivity" + * @since iOS 14 + */ +export class ReceiverSensitivity extends Characteristic { + + public static readonly UUID: string = "00000244-0000-1000-8000-0026BB765291"; + + constructor() { + super("Receiver Sensitivity", ReceiverSensitivity.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ReceiverSensitivity = ReceiverSensitivity; + +/** + * Characteristic "Recording Audio Active" + */ +export class RecordingAudioActive extends Characteristic { + + public static readonly UUID: string = "00000226-0000-1000-8000-0026BB765291"; + + public static readonly DISABLE = 0; + public static readonly ENABLE = 1; + + constructor() { + super("Recording Audio Active", RecordingAudioActive.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RecordingAudioActive = RecordingAudioActive; + +/** + * Characteristic "Relative Humidity Dehumidifier Threshold" + */ +export class RelativeHumidityDehumidifierThreshold extends Characteristic { + + public static readonly UUID: string = "000000C9-0000-1000-8000-0026BB765291"; + + constructor() { + super("Relative Humidity Dehumidifier Threshold", RelativeHumidityDehumidifierThreshold.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RelativeHumidityDehumidifierThreshold = RelativeHumidityDehumidifierThreshold; + +/** + * Characteristic "Relative Humidity Humidifier Threshold" + */ +export class RelativeHumidityHumidifierThreshold extends Characteristic { + + public static readonly UUID: string = "000000CA-0000-1000-8000-0026BB765291"; + + constructor() { + super("Relative Humidity Humidifier Threshold", RelativeHumidityHumidifierThreshold.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RelativeHumidityHumidifierThreshold = RelativeHumidityHumidifierThreshold; + +/** + * Characteristic "Relay Control Point" + */ +export class RelayControlPoint extends Characteristic { + + public static readonly UUID: string = "0000005E-0000-1000-8000-0026BB765291"; + + constructor() { + super("Relay Control Point", RelayControlPoint.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RelayControlPoint = RelayControlPoint; + +/** + * Characteristic "Relay Enabled" + */ +export class RelayEnabled extends Characteristic { + + public static readonly UUID: string = "0000005B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Relay Enabled", RelayEnabled.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RelayEnabled = RelayEnabled; + +/** + * Characteristic "Relay State" + */ +export class RelayState extends Characteristic { + + public static readonly UUID: string = "0000005C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Relay State", RelayState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 5, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RelayState = RelayState; + +/** + * Characteristic "Remaining Duration" + */ +export class RemainingDuration extends Characteristic { + + public static readonly UUID: string = "000000D4-0000-1000-8000-0026BB765291"; + + constructor() { + super("Remaining Duration", RemainingDuration.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.SECONDS, + minValue: 0, + maxValue: 3600, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RemainingDuration = RemainingDuration; + +/** + * Characteristic "Remote Key" + */ +export class RemoteKey extends Characteristic { + + public static readonly UUID: string = "000000E1-0000-1000-8000-0026BB765291"; + + public static readonly REWIND = 0; + public static readonly FAST_FORWARD = 1; + public static readonly NEXT_TRACK = 2; + public static readonly PREVIOUS_TRACK = 3; + public static readonly ARROW_UP = 4; + public static readonly ARROW_DOWN = 5; + public static readonly ARROW_LEFT = 6; + public static readonly ARROW_RIGHT = 7; + public static readonly SELECT = 8; + public static readonly BACK = 9; + public static readonly EXIT = 10; + public static readonly PLAY_PAUSE = 11; + public static readonly INFORMATION = 15; + + constructor() { + super("Remote Key", RemoteKey.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 16, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RemoteKey = RemoteKey; + +/** + * Characteristic "Reset Filter Indication" + */ +export class ResetFilterIndication extends Characteristic { + + public static readonly UUID: string = "000000AD-0000-1000-8000-0026BB765291"; + + constructor() { + super("Reset Filter Indication", ResetFilterIndication.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_WRITE], + minValue: 1, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ResetFilterIndication = ResetFilterIndication; + +/** + * Characteristic "Rotation Direction" + */ +export class RotationDirection extends Characteristic { + + public static readonly UUID: string = "00000028-0000-1000-8000-0026BB765291"; + + public static readonly CLOCKWISE = 0; + public static readonly COUNTER_CLOCKWISE = 1; + + constructor() { + super("Rotation Direction", RotationDirection.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RotationDirection = RotationDirection; + +/** + * Characteristic "Rotation Speed" + */ +export class RotationSpeed extends Characteristic { + + public static readonly UUID: string = "00000029-0000-1000-8000-0026BB765291"; + + constructor() { + super("Rotation Speed", RotationSpeed.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RotationSpeed = RotationSpeed; + +/** + * Characteristic "Router Status" + */ +export class RouterStatus extends Characteristic { + + public static readonly UUID: string = "0000020E-0000-1000-8000-0026BB765291"; + + public static readonly READY = 0; + public static readonly NOT_READY = 1; + + constructor() { + super("Router Status", RouterStatus.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.RouterStatus = RouterStatus; + +/** + * Characteristic "Saturation" + */ +export class Saturation extends Characteristic { + + public static readonly UUID: string = "0000002F-0000-1000-8000-0026BB765291"; + + constructor() { + super("Saturation", Saturation.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Saturation = Saturation; + +/** + * Characteristic "Security System Alarm Type" + */ +export class SecuritySystemAlarmType extends Characteristic { + + public static readonly UUID: string = "0000008E-0000-1000-8000-0026BB765291"; + + constructor() { + super("Security System Alarm Type", SecuritySystemAlarmType.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SecuritySystemAlarmType = SecuritySystemAlarmType; + +/** + * Characteristic "Security System Current State" + */ +export class SecuritySystemCurrentState extends Characteristic { + + public static readonly UUID: string = "00000066-0000-1000-8000-0026BB765291"; + + public static readonly STAY_ARM = 0; + public static readonly AWAY_ARM = 1; + public static readonly NIGHT_ARM = 2; + public static readonly DISARMED = 3; + public static readonly ALARM_TRIGGERED = 4; + + constructor() { + super("Security System Current State", SecuritySystemCurrentState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 4, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SecuritySystemCurrentState = SecuritySystemCurrentState; + +/** + * Characteristic "Security System Target State" + */ +export class SecuritySystemTargetState extends Characteristic { + + public static readonly UUID: string = "00000067-0000-1000-8000-0026BB765291"; + + public static readonly STAY_ARM = 0; + public static readonly AWAY_ARM = 1; + public static readonly NIGHT_ARM = 2; + public static readonly DISARM = 3; + + constructor() { + super("Security System Target State", SecuritySystemTargetState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SecuritySystemTargetState = SecuritySystemTargetState; + +/** + * Characteristic "Selected Audio Stream Configuration" + */ +export class SelectedAudioStreamConfiguration extends Characteristic { + + public static readonly UUID: string = "00000128-0000-1000-8000-0026BB765291"; + + constructor() { + super("Selected Audio Stream Configuration", SelectedAudioStreamConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SelectedAudioStreamConfiguration = SelectedAudioStreamConfiguration; + +/** + * Characteristic "Selected Camera Recording Configuration" + */ +export class SelectedCameraRecordingConfiguration extends Characteristic { + + public static readonly UUID: string = "00000209-0000-1000-8000-0026BB765291"; + + constructor() { + super("Selected Camera Recording Configuration", SelectedCameraRecordingConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SelectedCameraRecordingConfiguration = SelectedCameraRecordingConfiguration; + +/** + * Characteristic "Selected RTP Stream Configuration" + */ +export class SelectedRTPStreamConfiguration extends Characteristic { + + public static readonly UUID: string = "00000117-0000-1000-8000-0026BB765291"; + + constructor() { + super("Selected RTP Stream Configuration", SelectedRTPStreamConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SelectedRTPStreamConfiguration = SelectedRTPStreamConfiguration; + +/** + * Characteristic "Serial Number" + */ +export class SerialNumber extends Characteristic { + + public static readonly UUID: string = "00000030-0000-1000-8000-0026BB765291"; + + constructor() { + super("Serial Number", SerialNumber.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + maxLen: 64, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SerialNumber = SerialNumber; + +/** + * Characteristic "Service Label Index" + */ +export class ServiceLabelIndex extends Characteristic { + + public static readonly UUID: string = "000000CB-0000-1000-8000-0026BB765291"; + + constructor() { + super("Service Label Index", ServiceLabelIndex.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ], + minValue: 1, + maxValue: 255, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ServiceLabelIndex = ServiceLabelIndex; + +/** + * Characteristic "Service Label Namespace" + */ +export class ServiceLabelNamespace extends Characteristic { + + public static readonly UUID: string = "000000CD-0000-1000-8000-0026BB765291"; + + public static readonly DOTS = 0; + public static readonly ARABIC_NUMERALS = 1; + + constructor() { + super("Service Label Namespace", ServiceLabelNamespace.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ], + minValue: 0, + maxValue: 4, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ServiceLabelNamespace = ServiceLabelNamespace; + +/** + * Characteristic "Set Duration" + */ +export class SetDuration extends Characteristic { + + public static readonly UUID: string = "000000D3-0000-1000-8000-0026BB765291"; + + constructor() { + super("Set Duration", SetDuration.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.SECONDS, + minValue: 0, + maxValue: 3600, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SetDuration = SetDuration; + +/** + * Characteristic "Setup Data Stream Transport" + */ +export class SetupDataStreamTransport extends Characteristic { + + public static readonly UUID: string = "00000131-0000-1000-8000-0026BB765291"; + + constructor() { + super("Setup Data Stream Transport", SetupDataStreamTransport.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SetupDataStreamTransport = SetupDataStreamTransport; + +/** + * Characteristic "Setup Endpoints" + */ +export class SetupEndpoints extends Characteristic { + + public static readonly UUID: string = "00000118-0000-1000-8000-0026BB765291"; + + constructor() { + super("Setup Endpoints", SetupEndpoints.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SetupEndpoints = SetupEndpoints; + +/** + * Characteristic "Setup Transfer Transport" + * @since iOS 13.4 + */ +export class SetupTransferTransport extends Characteristic { + + public static readonly UUID: string = "00000201-0000-1000-8000-0026BB765291"; + + constructor() { + super("Setup Transfer Transport", SetupTransferTransport.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SetupTransferTransport = SetupTransferTransport; + +/** + * Characteristic "Signal To Noise Ratio" + * @since iOS 14 + */ +export class SignalToNoiseRatio extends Characteristic { + + public static readonly UUID: string = "00000241-0000-1000-8000-0026BB765291"; + + constructor() { + super("Signal To Noise Ratio", SignalToNoiseRatio.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SignalToNoiseRatio = SignalToNoiseRatio; + +/** + * Characteristic "Siri Input Type" + */ +export class SiriInputType extends Characteristic { + + public static readonly UUID: string = "00000132-0000-1000-8000-0026BB765291"; + + public static readonly PUSH_BUTTON_TRIGGERED_APPLE_TV = 0; + + constructor() { + super("Siri Input Type", SiriInputType.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SiriInputType = SiriInputType; + +/** + * Characteristic "Slat Type" + */ +export class SlatType extends Characteristic { + + public static readonly UUID: string = "000000C0-0000-1000-8000-0026BB765291"; + + public static readonly HORIZONTAL = 0; + public static readonly VERTICAL = 1; + + constructor() { + super("Slat Type", SlatType.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SlatType = SlatType; + +/** + * Characteristic "Sleep Discovery Mode" + */ +export class SleepDiscoveryMode extends Characteristic { + + public static readonly UUID: string = "000000E8-0000-1000-8000-0026BB765291"; + + public static readonly NOT_DISCOVERABLE = 0; + public static readonly ALWAYS_DISCOVERABLE = 1; + + constructor() { + super("Sleep Discovery Mode", SleepDiscoveryMode.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SleepDiscoveryMode = SleepDiscoveryMode; + +/** + * Characteristic "Sleep Interval" + * @since iOS 14 + */ +export class SleepInterval extends Characteristic { + + public static readonly UUID: string = "0000023A-0000-1000-8000-0026BB765291"; + + constructor() { + super("Sleep Interval", SleepInterval.UUID, { + format: Formats.UINT32, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SleepInterval = SleepInterval; + +/** + * Characteristic "Smoke Detected" + */ +export class SmokeDetected extends Characteristic { + + public static readonly UUID: string = "00000076-0000-1000-8000-0026BB765291"; + + public static readonly SMOKE_NOT_DETECTED = 0; + public static readonly SMOKE_DETECTED = 1; + + constructor() { + super("Smoke Detected", SmokeDetected.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SmokeDetected = SmokeDetected; + +/** + * Characteristic "Software Revision" + */ +export class SoftwareRevision extends Characteristic { + + public static readonly UUID: string = "00000054-0000-1000-8000-0026BB765291"; + + constructor() { + super("Software Revision", SoftwareRevision.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SoftwareRevision = SoftwareRevision; + +/** + * Characteristic "Status Active" + */ +export class StatusActive extends Characteristic { + + public static readonly UUID: string = "00000075-0000-1000-8000-0026BB765291"; + + constructor() { + super("Status Active", StatusActive.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.StatusActive = StatusActive; + +/** + * Characteristic "Status Fault" + */ +export class StatusFault extends Characteristic { + + public static readonly UUID: string = "00000077-0000-1000-8000-0026BB765291"; + + public static readonly NO_FAULT = 0; + public static readonly GENERAL_FAULT = 1; + + constructor() { + super("Status Fault", StatusFault.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.StatusFault = StatusFault; + +/** + * Characteristic "Status Jammed" + */ +export class StatusJammed extends Characteristic { + + public static readonly UUID: string = "00000078-0000-1000-8000-0026BB765291"; + + public static readonly NOT_JAMMED = 0; + public static readonly JAMMED = 1; + + constructor() { + super("Status Jammed", StatusJammed.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.StatusJammed = StatusJammed; + +/** + * Characteristic "Status Low Battery" + */ +export class StatusLowBattery extends Characteristic { + + public static readonly UUID: string = "00000079-0000-1000-8000-0026BB765291"; + + public static readonly BATTERY_LEVEL_NORMAL = 0; + public static readonly BATTERY_LEVEL_LOW = 1; + + constructor() { + super("Status Low Battery", StatusLowBattery.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.StatusLowBattery = StatusLowBattery; + +/** + * Characteristic "Status Tampered" + */ +export class StatusTampered extends Characteristic { + + public static readonly UUID: string = "0000007A-0000-1000-8000-0026BB765291"; + + public static readonly NOT_TAMPERED = 0; + public static readonly TAMPERED = 1; + + constructor() { + super("Status Tampered", StatusTampered.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.StatusTampered = StatusTampered; + +/** + * Characteristic "Streaming Status" + */ +export class StreamingStatus extends Characteristic { + + public static readonly UUID: string = "00000120-0000-1000-8000-0026BB765291"; + + constructor() { + super("Streaming Status", StreamingStatus.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.StreamingStatus = StreamingStatus; + +/** + * Characteristic "Sulphur Dioxide Density" + */ +export class SulphurDioxideDensity extends Characteristic { + + public static readonly UUID: string = "000000C5-0000-1000-8000-0026BB765291"; + + constructor() { + super("Sulphur Dioxide Density", SulphurDioxideDensity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SulphurDioxideDensity = SulphurDioxideDensity; + +/** + * Characteristic "Supported Audio Recording Configuration" + */ +export class SupportedAudioRecordingConfiguration extends Characteristic { + + public static readonly UUID: string = "00000207-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Audio Recording Configuration", SupportedAudioRecordingConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedAudioRecordingConfiguration = SupportedAudioRecordingConfiguration; + +/** + * Characteristic "Supported Audio Stream Configuration" + */ +export class SupportedAudioStreamConfiguration extends Characteristic { + + public static readonly UUID: string = "00000115-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Audio Stream Configuration", SupportedAudioStreamConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedAudioStreamConfiguration = SupportedAudioStreamConfiguration; + +/** + * Characteristic "Supported Camera Recording Configuration" + */ +export class SupportedCameraRecordingConfiguration extends Characteristic { + + public static readonly UUID: string = "00000205-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Camera Recording Configuration", SupportedCameraRecordingConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedCameraRecordingConfiguration = SupportedCameraRecordingConfiguration; + +/** + * Characteristic "Supported Characteristic Value Transition Configuration" + * @since iOS 14 + */ +export class SupportedCharacteristicValueTransitionConfiguration extends Characteristic { + + public static readonly UUID: string = "00000144-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Characteristic Value Transition Configuration", SupportedCharacteristicValueTransitionConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedCharacteristicValueTransitionConfiguration = SupportedCharacteristicValueTransitionConfiguration; + +/** + * Characteristic "Supported Data Stream Transport Configuration" + */ +export class SupportedDataStreamTransportConfiguration extends Characteristic { + + public static readonly UUID: string = "00000130-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Data Stream Transport Configuration", SupportedDataStreamTransportConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedDataStreamTransportConfiguration = SupportedDataStreamTransportConfiguration; + +/** + * Characteristic "Supported Diagnostics Snapshot" + * @since iOS 14 + */ +export class SupportedDiagnosticsSnapshot extends Characteristic { + + public static readonly UUID: string = "00000238-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Diagnostics Snapshot", SupportedDiagnosticsSnapshot.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedDiagnosticsSnapshot = SupportedDiagnosticsSnapshot; + +/** + * Characteristic "Supported Router Configuration" + */ +export class SupportedRouterConfiguration extends Characteristic { + + public static readonly UUID: string = "00000210-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Router Configuration", SupportedRouterConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedRouterConfiguration = SupportedRouterConfiguration; + +/** + * Characteristic "Supported RTP Configuration" + */ +export class SupportedRTPConfiguration extends Characteristic { + + public static readonly UUID: string = "00000116-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported RTP Configuration", SupportedRTPConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedRTPConfiguration = SupportedRTPConfiguration; + +/** + * Characteristic "Supported Transfer Transport Configuration" + * @since iOS 13.4 + */ +export class SupportedTransferTransportConfiguration extends Characteristic { + + public static readonly UUID: string = "00000202-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Transfer Transport Configuration", SupportedTransferTransportConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedTransferTransportConfiguration = SupportedTransferTransportConfiguration; + +/** + * Characteristic "Supported Video Recording Configuration" + */ +export class SupportedVideoRecordingConfiguration extends Characteristic { + + public static readonly UUID: string = "00000206-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Video Recording Configuration", SupportedVideoRecordingConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedVideoRecordingConfiguration = SupportedVideoRecordingConfiguration; + +/** + * Characteristic "Supported Video Stream Configuration" + */ +export class SupportedVideoStreamConfiguration extends Characteristic { + + public static readonly UUID: string = "00000114-0000-1000-8000-0026BB765291"; + + constructor() { + super("Supported Video Stream Configuration", SupportedVideoStreamConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SupportedVideoStreamConfiguration = SupportedVideoStreamConfiguration; + +/** + * Characteristic "Swing Mode" + */ +export class SwingMode extends Characteristic { + + public static readonly UUID: string = "000000B6-0000-1000-8000-0026BB765291"; + + public static readonly SWING_DISABLED = 0; + public static readonly SWING_ENABLED = 1; + + constructor() { + super("Swing Mode", SwingMode.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.SwingMode = SwingMode; + +/** + * Characteristic "Target Air Purifier State" + */ +export class TargetAirPurifierState extends Characteristic { + + public static readonly UUID: string = "000000A8-0000-1000-8000-0026BB765291"; + + public static readonly MANUAL = 0; + public static readonly AUTO = 1; + + constructor() { + super("Target Air Purifier State", TargetAirPurifierState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetAirPurifierState = TargetAirPurifierState; + +/** + * Characteristic "Target Control List" + */ +export class TargetControlList extends Characteristic { + + public static readonly UUID: string = "00000124-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Control List", TargetControlList.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetControlList = TargetControlList; + +/** + * Characteristic "Target Control Supported Configuration" + */ +export class TargetControlSupportedConfiguration extends Characteristic { + + public static readonly UUID: string = "00000123-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Control Supported Configuration", TargetControlSupportedConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetControlSupportedConfiguration = TargetControlSupportedConfiguration; + +/** + * Characteristic "Target Door State" + */ +export class TargetDoorState extends Characteristic { + + public static readonly UUID: string = "00000032-0000-1000-8000-0026BB765291"; + + public static readonly OPEN = 0; + public static readonly CLOSED = 1; + + constructor() { + super("Target Door State", TargetDoorState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.ADDITIONAL_AUTHORIZATION], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetDoorState = TargetDoorState; + +/** + * Characteristic "Target Fan State" + */ +export class TargetFanState extends Characteristic { + + public static readonly UUID: string = "000000BF-0000-1000-8000-0026BB765291"; + + public static readonly MANUAL = 0; + public static readonly AUTO = 1; + + constructor() { + super("Target Fan State", TargetFanState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetFanState = TargetFanState; + +/** + * Characteristic "Target Heater-Cooler State" + */ +export class TargetHeaterCoolerState extends Characteristic { + + public static readonly UUID: string = "000000B2-0000-1000-8000-0026BB765291"; + + public static readonly AUTO = 0; + public static readonly HEAT = 1; + public static readonly COOL = 2; + + constructor() { + super("Target Heater-Cooler State", TargetHeaterCoolerState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetHeaterCoolerState = TargetHeaterCoolerState; + +/** + * Characteristic "Target Heating Cooling State" + */ +export class TargetHeatingCoolingState extends Characteristic { + + public static readonly UUID: string = "00000033-0000-1000-8000-0026BB765291"; + + public static readonly OFF = 0; + public static readonly HEAT = 1; + public static readonly COOL = 2; + public static readonly AUTO = 3; + + constructor() { + super("Target Heating Cooling State", TargetHeatingCoolingState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetHeatingCoolingState = TargetHeatingCoolingState; + +/** + * Characteristic "Target Horizontal Tilt Angle" + */ +export class TargetHorizontalTiltAngle extends Characteristic { + + public static readonly UUID: string = "0000007B-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Horizontal Tilt Angle", TargetHorizontalTiltAngle.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.ARC_DEGREE, + minValue: -90, + maxValue: 90, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetHorizontalTiltAngle = TargetHorizontalTiltAngle; + +/** + * Characteristic "Target Humidifier-Dehumidifier State" + */ +export class TargetHumidifierDehumidifierState extends Characteristic { + + public static readonly UUID: string = "000000B4-0000-1000-8000-0026BB765291"; + + /** + * @deprecated Removed in iOS 11. Use {@link HUMIDIFIER_OR_DEHUMIDIFIER} instead. + */ + public static readonly AUTO = 0; + + public static readonly HUMIDIFIER_OR_DEHUMIDIFIER = 0; + public static readonly HUMIDIFIER = 1; + public static readonly DEHUMIDIFIER = 2; + + constructor() { + super("Target Humidifier-Dehumidifier State", TargetHumidifierDehumidifierState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetHumidifierDehumidifierState = TargetHumidifierDehumidifierState; + +/** + * Characteristic "Target Media State" + */ +export class TargetMediaState extends Characteristic { + + public static readonly UUID: string = "00000137-0000-1000-8000-0026BB765291"; + + public static readonly PLAY = 0; + public static readonly PAUSE = 1; + public static readonly STOP = 2; + + constructor() { + super("Target Media State", TargetMediaState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 2, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetMediaState = TargetMediaState; + +/** + * Characteristic "Target Position" + */ +export class TargetPosition extends Characteristic { + + public static readonly UUID: string = "0000007C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Position", TargetPosition.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetPosition = TargetPosition; + +/** + * Characteristic "Target Relative Humidity" + */ +export class TargetRelativeHumidity extends Characteristic { + + public static readonly UUID: string = "00000034-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Relative Humidity", TargetRelativeHumidity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetRelativeHumidity = TargetRelativeHumidity; + +/** + * Characteristic "Target Temperature" + */ +export class TargetTemperature extends Characteristic { + + public static readonly UUID: string = "00000035-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Temperature", TargetTemperature.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.CELSIUS, + minValue: 10, + maxValue: 38, + minStep: 0.1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetTemperature = TargetTemperature; + +/** + * Characteristic "Target Tilt Angle" + */ +export class TargetTiltAngle extends Characteristic { + + public static readonly UUID: string = "000000C2-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Tilt Angle", TargetTiltAngle.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.ARC_DEGREE, + minValue: -90, + maxValue: 90, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetTiltAngle = TargetTiltAngle; + +/** + * Characteristic "Target Vertical Tilt Angle" + */ +export class TargetVerticalTiltAngle extends Characteristic { + + public static readonly UUID: string = "0000007D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Target Vertical Tilt Angle", TargetVerticalTiltAngle.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.ARC_DEGREE, + minValue: -90, + maxValue: 90, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetVerticalTiltAngle = TargetVerticalTiltAngle; + +/** + * Characteristic "Target Visibility State" + */ +export class TargetVisibilityState extends Characteristic { + + public static readonly UUID: string = "00000134-0000-1000-8000-0026BB765291"; + + public static readonly SHOWN = 0; + public static readonly HIDDEN = 1; + + constructor() { + super("Target Visibility State", TargetVisibilityState.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TargetVisibilityState = TargetVisibilityState; + +/** + * Characteristic "Temperature Display Units" + */ +export class TemperatureDisplayUnits extends Characteristic { + + public static readonly UUID: string = "00000036-0000-1000-8000-0026BB765291"; + + public static readonly CELSIUS = 0; + public static readonly FAHRENHEIT = 1; + + constructor() { + super("Temperature Display Units", TemperatureDisplayUnits.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TemperatureDisplayUnits = TemperatureDisplayUnits; + +/** + * Characteristic "Third Party Camera Active" + */ +export class ThirdPartyCameraActive extends Characteristic { + + public static readonly UUID: string = "0000021C-0000-1000-8000-0026BB765291"; + + public static readonly OFF = 0; + public static readonly ON = 1; + + constructor() { + super("Third Party Camera Active", ThirdPartyCameraActive.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ThirdPartyCameraActive = ThirdPartyCameraActive; + +/** + * Characteristic "Thread Control Point" + */ +export class ThreadControlPoint extends Characteristic { + + public static readonly UUID: string = "00000704-0000-1000-8000-0026BB765291"; + + constructor() { + super("Thread Control Point", ThreadControlPoint.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ThreadControlPoint = ThreadControlPoint; + +/** + * Characteristic "Thread Node Capabilities" + */ +export class ThreadNodeCapabilities extends Characteristic { + + public static readonly UUID: string = "00000702-0000-1000-8000-0026BB765291"; + + constructor() { + super("Thread Node Capabilities", ThreadNodeCapabilities.UUID, { + format: Formats.UINT16, + perms: [Perms.PAIRED_READ], + minValue: 0, + maxValue: 31, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ThreadNodeCapabilities = ThreadNodeCapabilities; + +/** + * Characteristic "Thread OpenThread Version" + */ +export class ThreadOpenThreadVersion extends Characteristic { + + public static readonly UUID: string = "00000706-0000-1000-8000-0026BB765291"; + + constructor() { + super("Thread OpenThread Version", ThreadOpenThreadVersion.UUID, { + format: Formats.STRING, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ThreadOpenThreadVersion = ThreadOpenThreadVersion; + +/** + * Characteristic "Thread Status" + */ +export class ThreadStatus extends Characteristic { + + public static readonly UUID: string = "00000703-0000-1000-8000-0026BB765291"; + + constructor() { + super("Thread Status", ThreadStatus.UUID, { + format: Formats.UINT16, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 6, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ThreadStatus = ThreadStatus; + +/** + * Characteristic "Transmit Power" + * @since iOS 14 + */ +export class TransmitPower extends Characteristic { + + public static readonly UUID: string = "00000242-0000-1000-8000-0026BB765291"; + + constructor() { + super("Transmit Power", TransmitPower.UUID, { + format: Formats.INT, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TransmitPower = TransmitPower; + +/** + * Characteristic "Tunnel Connection Timeout" + */ +export class TunnelConnectionTimeout extends Characteristic { + + public static readonly UUID: string = "00000061-0000-1000-8000-0026BB765291"; + + constructor() { + super("Tunnel Connection Timeout", TunnelConnectionTimeout.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TunnelConnectionTimeout = TunnelConnectionTimeout; + +/** + * Characteristic "Tunneled Accessory Advertising" + */ +export class TunneledAccessoryAdvertising extends Characteristic { + + public static readonly UUID: string = "00000060-0000-1000-8000-0026BB765291"; + + constructor() { + super("Tunneled Accessory Advertising", TunneledAccessoryAdvertising.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TunneledAccessoryAdvertising = TunneledAccessoryAdvertising; + +/** + * Characteristic "Tunneled Accessory Connected" + */ +export class TunneledAccessoryConnected extends Characteristic { + + public static readonly UUID: string = "00000059-0000-1000-8000-0026BB765291"; + + constructor() { + super("Tunneled Accessory Connected", TunneledAccessoryConnected.UUID, { + format: Formats.BOOL, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TunneledAccessoryConnected = TunneledAccessoryConnected; + +/** + * Characteristic "Tunneled Accessory State Number" + */ +export class TunneledAccessoryStateNumber extends Characteristic { + + public static readonly UUID: string = "00000058-0000-1000-8000-0026BB765291"; + + constructor() { + super("Tunneled Accessory State Number", TunneledAccessoryStateNumber.UUID, { + format: Formats.INT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.TunneledAccessoryStateNumber = TunneledAccessoryStateNumber; + +/** + * Characteristic "Valve Type" + */ +export class ValveType extends Characteristic { + + public static readonly UUID: string = "000000D5-0000-1000-8000-0026BB765291"; + + public static readonly GENERIC_VALVE = 0; + public static readonly IRRIGATION = 1; + public static readonly SHOWER_HEAD = 2; + public static readonly WATER_FAUCET = 3; + + constructor() { + super("Valve Type", ValveType.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.ValveType = ValveType; + +/** + * Characteristic "Version" + */ +export class Version extends Characteristic { + + public static readonly UUID: string = "00000037-0000-1000-8000-0026BB765291"; + + constructor() { + super("Version", Version.UUID, { + format: Formats.STRING, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + maxLen: 64, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Version = Version; + +/** + * Characteristic "Video Analysis Active" + * @since iOS 14 + */ +export class VideoAnalysisActive extends Characteristic { + + public static readonly UUID: string = "00000229-0000-1000-8000-0026BB765291"; + + constructor() { + super("Video Analysis Active", VideoAnalysisActive.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.VideoAnalysisActive = VideoAnalysisActive; + +/** + * Characteristic "VOC Density" + */ +export class VOCDensity extends Characteristic { + + public static readonly UUID: string = "000000C8-0000-1000-8000-0026BB765291"; + + constructor() { + super("VOC Density", VOCDensity.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 1000, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.VOCDensity = VOCDensity; + +/** + * Characteristic "Volume" + */ +export class Volume extends Characteristic { + + public static readonly UUID: string = "00000119-0000-1000-8000-0026BB765291"; + + constructor() { + super("Volume", Volume.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.Volume = Volume; + +/** + * Characteristic "Volume Control Type" + */ +export class VolumeControlType extends Characteristic { + + public static readonly UUID: string = "000000E9-0000-1000-8000-0026BB765291"; + + public static readonly NONE = 0; + public static readonly RELATIVE = 1; + public static readonly RELATIVE_WITH_CURRENT = 2; + public static readonly ABSOLUTE = 3; + + constructor() { + super("Volume Control Type", VolumeControlType.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 3, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.VolumeControlType = VolumeControlType; + +/** + * Characteristic "Volume Selector" + */ +export class VolumeSelector extends Characteristic { + + public static readonly UUID: string = "000000EA-0000-1000-8000-0026BB765291"; + + public static readonly INCREMENT = 0; + public static readonly DECREMENT = 1; + + constructor() { + super("Volume Selector", VolumeSelector.UUID, { + format: Formats.UINT8, + perms: [Perms.PAIRED_WRITE], + minValue: 0, + maxValue: 1, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.VolumeSelector = VolumeSelector; + +/** + * Characteristic "Wake Configuration" + * @since iOS 13.4 + */ +export class WakeConfiguration extends Characteristic { + + public static readonly UUID: string = "00000222-0000-1000-8000-0026BB765291"; + + constructor() { + super("Wake Configuration", WakeConfiguration.UUID, { + format: Formats.TLV8, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WakeConfiguration = WakeConfiguration; + +/** + * Characteristic "WAN Configuration List" + */ +export class WANConfigurationList extends Characteristic { + + public static readonly UUID: string = "00000211-0000-1000-8000-0026BB765291"; + + constructor() { + super("WAN Configuration List", WANConfigurationList.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WANConfigurationList = WANConfigurationList; + +/** + * Characteristic "WAN Status List" + */ +export class WANStatusList extends Characteristic { + + public static readonly UUID: string = "00000212-0000-1000-8000-0026BB765291"; + + constructor() { + super("WAN Status List", WANStatusList.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WANStatusList = WANStatusList; + +/** + * Characteristic "Water Level" + */ +export class WaterLevel extends Characteristic { + + public static readonly UUID: string = "000000B5-0000-1000-8000-0026BB765291"; + + constructor() { + super("Water Level", WaterLevel.UUID, { + format: Formats.FLOAT, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + unit: Units.PERCENTAGE, + minValue: 0, + maxValue: 100, + minStep: 1, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WaterLevel = WaterLevel; + +/** + * Characteristic "Wi-Fi Capabilities" + * @since iOS 14 + */ +export class WiFiCapabilities extends Characteristic { + + public static readonly UUID: string = "0000022C-0000-1000-8000-0026BB765291"; + + constructor() { + super("Wi-Fi Capabilities", WiFiCapabilities.UUID, { + format: Formats.UINT32, + perms: [Perms.PAIRED_READ], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WiFiCapabilities = WiFiCapabilities; + +/** + * Characteristic "Wi-Fi Configuration Control" + * @since iOS 14 + */ +export class WiFiConfigurationControl extends Characteristic { + + public static readonly UUID: string = "0000022D-0000-1000-8000-0026BB765291"; + + constructor() { + super("Wi-Fi Configuration Control", WiFiConfigurationControl.UUID, { + format: Formats.TLV8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.TIMED_WRITE, Perms.WRITE_RESPONSE], + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WiFiConfigurationControl = WiFiConfigurationControl; + +/** + * Characteristic "Wi-Fi Satellite Status" + */ +export class WiFiSatelliteStatus extends Characteristic { + + public static readonly UUID: string = "0000021E-0000-1000-8000-0026BB765291"; + + public static readonly UNKNOWN = 0; + public static readonly CONNECTED = 1; + public static readonly NOT_CONNECTED = 2; + + constructor() { + super("Wi-Fi Satellite Status", WiFiSatelliteStatus.UUID, { + format: Formats.UINT8, + perms: [Perms.NOTIFY, Perms.PAIRED_READ], + minValue: 0, + maxValue: 2, + }); + this.value = this.getDefaultValue(); + } +} +Characteristic.WiFiSatelliteStatus = WiFiSatelliteStatus; + diff --git a/src/lib/definitions/ServiceDefinitions.spec.ts b/src/lib/definitions/ServiceDefinitions.spec.ts new file mode 100644 index 000000000..6b640e862 --- /dev/null +++ b/src/lib/definitions/ServiceDefinitions.spec.ts @@ -0,0 +1,1452 @@ +// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY +import "./"; + +import { Characteristic } from "../Characteristic"; +import { Service } from "../Service"; + +describe("ServiceDefinitions", () => { + describe("AccessControl", () => { + it("should be able to construct", () => { + const service0 = new Service.AccessControl(); + const service1 = new Service.AccessControl("test name"); + const service2 = new Service.AccessControl("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("AccessoryInformation", () => { + it("should be able to construct", () => { + const service0 = new Service.AccessoryInformation(); + const service1 = new Service.AccessoryInformation("test name"); + const service2 = new Service.AccessoryInformation("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("AccessoryRuntimeInformation", () => { + it("should be able to construct", () => { + const service0 = new Service.AccessoryRuntimeInformation(); + const service1 = new Service.AccessoryRuntimeInformation("test name"); + const service2 = new Service.AccessoryRuntimeInformation("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("AirPurifier", () => { + it("should be able to construct", () => { + const service0 = new Service.AirPurifier(); + const service1 = new Service.AirPurifier("test name"); + const service2 = new Service.AirPurifier("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("AirQualitySensor", () => { + it("should be able to construct", () => { + const service0 = new Service.AirQualitySensor(); + const service1 = new Service.AirQualitySensor("test name"); + const service2 = new Service.AirQualitySensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("AudioStreamManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.AudioStreamManagement(); + const service1 = new Service.AudioStreamManagement("test name"); + const service2 = new Service.AudioStreamManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Battery", () => { + it("should be able to construct", () => { + const service0 = new Service.Battery(); + const service1 = new Service.Battery("test name"); + const service2 = new Service.Battery("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + // noinspection JSDeprecatedSymbols + + new Service.BatteryService(); + }); + }); + + describe("CameraOperatingMode", () => { + it("should be able to construct", () => { + const service0 = new Service.CameraOperatingMode(); + const service1 = new Service.CameraOperatingMode("test name"); + const service2 = new Service.CameraOperatingMode("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("CameraRecordingManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.CameraRecordingManagement(); + const service1 = new Service.CameraRecordingManagement("test name"); + const service2 = new Service.CameraRecordingManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + // noinspection JSDeprecatedSymbols + + new Service.CameraEventRecordingManagement(); + }); + }); + + describe("CameraRTPStreamManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.CameraRTPStreamManagement(); + const service1 = new Service.CameraRTPStreamManagement("test name"); + const service2 = new Service.CameraRTPStreamManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("CarbonDioxideSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.CarbonDioxideSensor(); + const service1 = new Service.CarbonDioxideSensor("test name"); + const service2 = new Service.CarbonDioxideSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("CarbonMonoxideSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.CarbonMonoxideSensor(); + const service1 = new Service.CarbonMonoxideSensor("test name"); + const service2 = new Service.CarbonMonoxideSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("CloudRelay", () => { + it("should be able to construct", () => { + const service0 = new Service.CloudRelay(); + const service1 = new Service.CloudRelay("test name"); + const service2 = new Service.CloudRelay("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + // noinspection JSDeprecatedSymbols + + new Service.Relay(); + }); + }); + + describe("ContactSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.ContactSensor(); + const service1 = new Service.ContactSensor("test name"); + const service2 = new Service.ContactSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("DataStreamTransportManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.DataStreamTransportManagement(); + const service1 = new Service.DataStreamTransportManagement("test name"); + const service2 = new Service.DataStreamTransportManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Diagnostics", () => { + it("should be able to construct", () => { + const service0 = new Service.Diagnostics(); + const service1 = new Service.Diagnostics("test name"); + const service2 = new Service.Diagnostics("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Door", () => { + it("should be able to construct", () => { + const service0 = new Service.Door(); + const service1 = new Service.Door("test name"); + const service2 = new Service.Door("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Doorbell", () => { + it("should be able to construct", () => { + const service0 = new Service.Doorbell(); + const service1 = new Service.Doorbell("test name"); + const service2 = new Service.Doorbell("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Fan", () => { + it("should be able to construct", () => { + const service0 = new Service.Fan(); + const service1 = new Service.Fan("test name"); + const service2 = new Service.Fan("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Fanv2", () => { + it("should be able to construct", () => { + const service0 = new Service.Fanv2(); + const service1 = new Service.Fanv2("test name"); + const service2 = new Service.Fanv2("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Faucet", () => { + it("should be able to construct", () => { + const service0 = new Service.Faucet(); + const service1 = new Service.Faucet("test name"); + const service2 = new Service.Faucet("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("FilterMaintenance", () => { + it("should be able to construct", () => { + const service0 = new Service.FilterMaintenance(); + const service1 = new Service.FilterMaintenance("test name"); + const service2 = new Service.FilterMaintenance("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("GarageDoorOpener", () => { + it("should be able to construct", () => { + const service0 = new Service.GarageDoorOpener(); + const service1 = new Service.GarageDoorOpener("test name"); + const service2 = new Service.GarageDoorOpener("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("HeaterCooler", () => { + it("should be able to construct", () => { + const service0 = new Service.HeaterCooler(); + const service1 = new Service.HeaterCooler("test name"); + const service2 = new Service.HeaterCooler("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("HumidifierDehumidifier", () => { + it("should be able to construct", () => { + const service0 = new Service.HumidifierDehumidifier(); + const service1 = new Service.HumidifierDehumidifier("test name"); + const service2 = new Service.HumidifierDehumidifier("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("HumiditySensor", () => { + it("should be able to construct", () => { + const service0 = new Service.HumiditySensor(); + const service1 = new Service.HumiditySensor("test name"); + const service2 = new Service.HumiditySensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("InputSource", () => { + it("should be able to construct", () => { + const service0 = new Service.InputSource(); + const service1 = new Service.InputSource("test name"); + const service2 = new Service.InputSource("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("IrrigationSystem", () => { + it("should be able to construct", () => { + const service0 = new Service.IrrigationSystem(); + const service1 = new Service.IrrigationSystem("test name"); + const service2 = new Service.IrrigationSystem("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("LeakSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.LeakSensor(); + const service1 = new Service.LeakSensor("test name"); + const service2 = new Service.LeakSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Lightbulb", () => { + it("should be able to construct", () => { + const service0 = new Service.Lightbulb(); + const service1 = new Service.Lightbulb("test name"); + const service2 = new Service.Lightbulb("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("LightSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.LightSensor(); + const service1 = new Service.LightSensor("test name"); + const service2 = new Service.LightSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("LockManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.LockManagement(); + const service1 = new Service.LockManagement("test name"); + const service2 = new Service.LockManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("LockMechanism", () => { + it("should be able to construct", () => { + const service0 = new Service.LockMechanism(); + const service1 = new Service.LockMechanism("test name"); + const service2 = new Service.LockMechanism("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Microphone", () => { + it("should be able to construct", () => { + const service0 = new Service.Microphone(); + const service1 = new Service.Microphone("test name"); + const service2 = new Service.Microphone("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("MotionSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.MotionSensor(); + const service1 = new Service.MotionSensor("test name"); + const service2 = new Service.MotionSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("OccupancySensor", () => { + it("should be able to construct", () => { + const service0 = new Service.OccupancySensor(); + const service1 = new Service.OccupancySensor("test name"); + const service2 = new Service.OccupancySensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Outlet", () => { + it("should be able to construct", () => { + const service0 = new Service.Outlet(); + const service1 = new Service.Outlet("test name"); + const service2 = new Service.Outlet("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Pairing", () => { + it("should be able to construct", () => { + const service0 = new Service.Pairing(); + const service1 = new Service.Pairing("test name"); + const service2 = new Service.Pairing("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("PowerManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.PowerManagement(); + const service1 = new Service.PowerManagement("test name"); + const service2 = new Service.PowerManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("ProtocolInformation", () => { + it("should be able to construct", () => { + const service0 = new Service.ProtocolInformation(); + const service1 = new Service.ProtocolInformation("test name"); + const service2 = new Service.ProtocolInformation("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("SecuritySystem", () => { + it("should be able to construct", () => { + const service0 = new Service.SecuritySystem(); + const service1 = new Service.SecuritySystem("test name"); + const service2 = new Service.SecuritySystem("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("ServiceLabel", () => { + it("should be able to construct", () => { + const service0 = new Service.ServiceLabel(); + const service1 = new Service.ServiceLabel("test name"); + const service2 = new Service.ServiceLabel("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Siri", () => { + it("should be able to construct", () => { + const service0 = new Service.Siri(); + const service1 = new Service.Siri("test name"); + const service2 = new Service.Siri("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Slats", () => { + it("should be able to construct", () => { + const service0 = new Service.Slats(); + const service1 = new Service.Slats("test name"); + const service2 = new Service.Slats("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + // noinspection JSDeprecatedSymbols + + new Service.Slat(); + }); + }); + + describe("SmartSpeaker", () => { + it("should be able to construct", () => { + const service0 = new Service.SmartSpeaker(); + const service1 = new Service.SmartSpeaker("test name"); + const service2 = new Service.SmartSpeaker("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("SmokeSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.SmokeSensor(); + const service1 = new Service.SmokeSensor("test name"); + const service2 = new Service.SmokeSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Speaker", () => { + it("should be able to construct", () => { + const service0 = new Service.Speaker(); + const service1 = new Service.Speaker("test name"); + const service2 = new Service.Speaker("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("StatefulProgrammableSwitch", () => { + it("should be able to construct", () => { + const service0 = new Service.StatefulProgrammableSwitch(); + const service1 = new Service.StatefulProgrammableSwitch("test name"); + const service2 = new Service.StatefulProgrammableSwitch("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("StatelessProgrammableSwitch", () => { + it("should be able to construct", () => { + const service0 = new Service.StatelessProgrammableSwitch(); + const service1 = new Service.StatelessProgrammableSwitch("test name"); + const service2 = new Service.StatelessProgrammableSwitch("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Switch", () => { + it("should be able to construct", () => { + const service0 = new Service.Switch(); + const service1 = new Service.Switch("test name"); + const service2 = new Service.Switch("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("TargetControl", () => { + it("should be able to construct", () => { + const service0 = new Service.TargetControl(); + const service1 = new Service.TargetControl("test name"); + const service2 = new Service.TargetControl("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("TargetControlManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.TargetControlManagement(); + const service1 = new Service.TargetControlManagement("test name"); + const service2 = new Service.TargetControlManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Television", () => { + it("should be able to construct", () => { + const service0 = new Service.Television(); + const service1 = new Service.Television("test name"); + const service2 = new Service.Television("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("TelevisionSpeaker", () => { + it("should be able to construct", () => { + const service0 = new Service.TelevisionSpeaker(); + const service1 = new Service.TelevisionSpeaker("test name"); + const service2 = new Service.TelevisionSpeaker("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("TemperatureSensor", () => { + it("should be able to construct", () => { + const service0 = new Service.TemperatureSensor(); + const service1 = new Service.TemperatureSensor("test name"); + const service2 = new Service.TemperatureSensor("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Thermostat", () => { + it("should be able to construct", () => { + const service0 = new Service.Thermostat(); + const service1 = new Service.Thermostat("test name"); + const service2 = new Service.Thermostat("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("ThreadTransport", () => { + it("should be able to construct", () => { + const service0 = new Service.ThreadTransport(); + const service1 = new Service.ThreadTransport("test name"); + const service2 = new Service.ThreadTransport("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("TransferTransportManagement", () => { + it("should be able to construct", () => { + const service0 = new Service.TransferTransportManagement(); + const service1 = new Service.TransferTransportManagement("test name"); + const service2 = new Service.TransferTransportManagement("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Tunnel", () => { + it("should be able to construct", () => { + const service0 = new Service.Tunnel(); + const service1 = new Service.Tunnel("test name"); + const service2 = new Service.Tunnel("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + // noinspection JSDeprecatedSymbols + + new Service.TunneledBTLEAccessoryService(); + }); + }); + + describe("Valve", () => { + it("should be able to construct", () => { + const service0 = new Service.Valve(); + const service1 = new Service.Valve("test name"); + const service2 = new Service.Valve("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("WiFiRouter", () => { + it("should be able to construct", () => { + const service0 = new Service.WiFiRouter(); + const service1 = new Service.WiFiRouter("test name"); + const service2 = new Service.WiFiRouter("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("WiFiSatellite", () => { + it("should be able to construct", () => { + const service0 = new Service.WiFiSatellite(); + const service1 = new Service.WiFiSatellite("test name"); + const service2 = new Service.WiFiSatellite("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("WiFiTransport", () => { + it("should be able to construct", () => { + const service0 = new Service.WiFiTransport(); + const service1 = new Service.WiFiTransport("test name"); + const service2 = new Service.WiFiTransport("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("Window", () => { + it("should be able to construct", () => { + const service0 = new Service.Window(); + const service1 = new Service.Window("test name"); + const service2 = new Service.Window("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); + + describe("WindowCovering", () => { + it("should be able to construct", () => { + const service0 = new Service.WindowCovering(); + const service1 = new Service.WindowCovering("test name"); + const service2 = new Service.WindowCovering("test name", "test sub type"); + + expect(service0.displayName).toBe(""); + expect(service0.testCharacteristic(Characteristic.Name)).toBe(false); + expect(service0.subtype).toBeUndefined(); + + expect(service1.displayName).toBe("test name"); + expect(service1.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service1.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service1.subtype).toBeUndefined(); + + expect(service2.displayName).toBe("test name"); + expect(service2.testCharacteristic(Characteristic.Name)).toBe(true); + expect(service2.getCharacteristic(Characteristic.Name).value).toBe("test name"); + expect(service2.subtype).toBe("test sub type"); + }); + }); +}); diff --git a/src/lib/definitions/ServiceDefinitions.ts b/src/lib/definitions/ServiceDefinitions.ts new file mode 100644 index 000000000..942f96fd6 --- /dev/null +++ b/src/lib/definitions/ServiceDefinitions.ts @@ -0,0 +1,1465 @@ +// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY +// V=856 + +import { Characteristic } from "../Characteristic"; +import { Service } from "../Service"; + +/** + * Service "Access Control" + */ +export class AccessControl extends Service { + + public static readonly UUID: string = "000000DA-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, AccessControl.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.AccessControlLevel); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.PasswordSetting); + } +} +Service.AccessControl = AccessControl; + +/** + * Service "Accessory Information" + */ +export class AccessoryInformation extends Service { + + public static readonly UUID: string = "0000003E-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, AccessoryInformation.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Identify); + this.addCharacteristic(Characteristic.Manufacturer); + this.addCharacteristic(Characteristic.Model); + if (!this.testCharacteristic(Characteristic.Name)) { // workaround for Name characteristic collision in constructor + this.addCharacteristic(Characteristic.Name).updateValue("Unnamed Service"); + } + this.addCharacteristic(Characteristic.SerialNumber); + this.addCharacteristic(Characteristic.FirmwareRevision); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.AccessoryFlags); + this.addOptionalCharacteristic(Characteristic.AppMatchingIdentifier); + this.addOptionalCharacteristic(Characteristic.ConfiguredName); + this.addOptionalCharacteristic(Characteristic.HardwareRevision); + this.addOptionalCharacteristic(Characteristic.SoftwareRevision); + this.addOptionalCharacteristic(Characteristic.ProductData); + } +} +Service.AccessoryInformation = AccessoryInformation; + +/** + * Service "Accessory Runtime Information" + */ +export class AccessoryRuntimeInformation extends Service { + + public static readonly UUID: string = "00000239-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, AccessoryRuntimeInformation.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Ping); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.ActivityInterval); + this.addOptionalCharacteristic(Characteristic.HeartBeat); + this.addOptionalCharacteristic(Characteristic.SleepInterval); + } +} +Service.AccessoryRuntimeInformation = AccessoryRuntimeInformation; + +/** + * Service "Air Purifier" + */ +export class AirPurifier extends Service { + + public static readonly UUID: string = "000000BB-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, AirPurifier.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.CurrentAirPurifierState); + this.addCharacteristic(Characteristic.TargetAirPurifierState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.RotationSpeed); + this.addOptionalCharacteristic(Characteristic.SwingMode); + } +} +Service.AirPurifier = AirPurifier; + +/** + * Service "Air Quality Sensor" + */ +export class AirQualitySensor extends Service { + + public static readonly UUID: string = "0000008D-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, AirQualitySensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.AirQuality); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.NitrogenDioxideDensity); + this.addOptionalCharacteristic(Characteristic.OzoneDensity); + this.addOptionalCharacteristic(Characteristic.PM10Density); + this.addOptionalCharacteristic(Characteristic.PM2_5Density); + this.addOptionalCharacteristic(Characteristic.SulphurDioxideDensity); + this.addOptionalCharacteristic(Characteristic.VOCDensity); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.AirQualitySensor = AirQualitySensor; + +/** + * Service "Audio Stream Management" + */ +export class AudioStreamManagement extends Service { + + public static readonly UUID: string = "00000127-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, AudioStreamManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SupportedAudioStreamConfiguration); + this.addCharacteristic(Characteristic.SelectedAudioStreamConfiguration); + } +} +Service.AudioStreamManagement = AudioStreamManagement; + +/** + * Service "Battery" + */ +export class Battery extends Service { + + public static readonly UUID: string = "00000096-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Battery.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.StatusLowBattery); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.BatteryLevel); + this.addOptionalCharacteristic(Characteristic.ChargingState); + this.addOptionalCharacteristic(Characteristic.Name); + } +} +// noinspection JSDeprecatedSymbols +Service.BatteryService = Battery; +Service.Battery = Battery; + +/** + * Service "Camera Operating Mode" + */ +export class CameraOperatingMode extends Service { + + public static readonly UUID: string = "0000021A-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, CameraOperatingMode.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.EventSnapshotsActive); + this.addCharacteristic(Characteristic.HomeKitCameraActive); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.CameraOperatingModeIndicator); + this.addOptionalCharacteristic(Characteristic.ManuallyDisabled); + this.addOptionalCharacteristic(Characteristic.NightVision); + this.addOptionalCharacteristic(Characteristic.PeriodicSnapshotsActive); + this.addOptionalCharacteristic(Characteristic.ThirdPartyCameraActive); + this.addOptionalCharacteristic(Characteristic.DiagonalFieldOfView); + } +} +Service.CameraOperatingMode = CameraOperatingMode; + +/** + * Service "Camera Recording Management" + */ +export class CameraRecordingManagement extends Service { + + public static readonly UUID: string = "00000204-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, CameraRecordingManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.SupportedCameraRecordingConfiguration); + this.addCharacteristic(Characteristic.SupportedVideoRecordingConfiguration); + this.addCharacteristic(Characteristic.SupportedAudioRecordingConfiguration); + this.addCharacteristic(Characteristic.SelectedCameraRecordingConfiguration); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.RecordingAudioActive); + } +} +// noinspection JSDeprecatedSymbols +Service.CameraEventRecordingManagement = CameraRecordingManagement; +Service.CameraRecordingManagement = CameraRecordingManagement; + +/** + * Service "Camera RTP Stream Management" + */ +export class CameraRTPStreamManagement extends Service { + + public static readonly UUID: string = "00000110-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, CameraRTPStreamManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SelectedRTPStreamConfiguration); + this.addCharacteristic(Characteristic.SetupEndpoints); + this.addCharacteristic(Characteristic.StreamingStatus); + this.addCharacteristic(Characteristic.SupportedAudioStreamConfiguration); + this.addCharacteristic(Characteristic.SupportedRTPConfiguration); + this.addCharacteristic(Characteristic.SupportedVideoStreamConfiguration); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Active); + } +} +Service.CameraRTPStreamManagement = CameraRTPStreamManagement; + +/** + * Service "Carbon Dioxide Sensor" + */ +export class CarbonDioxideSensor extends Service { + + public static readonly UUID: string = "00000097-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, CarbonDioxideSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CarbonDioxideDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.CarbonDioxideLevel); + this.addOptionalCharacteristic(Characteristic.CarbonDioxidePeakLevel); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.CarbonDioxideSensor = CarbonDioxideSensor; + +/** + * Service "Carbon Monoxide Sensor" + */ +export class CarbonMonoxideSensor extends Service { + + public static readonly UUID: string = "0000007F-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, CarbonMonoxideSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CarbonMonoxideDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.CarbonMonoxideLevel); + this.addOptionalCharacteristic(Characteristic.CarbonMonoxidePeakLevel); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.CarbonMonoxideSensor = CarbonMonoxideSensor; + +/** + * Service "Cloud Relay" + */ +export class CloudRelay extends Service { + + public static readonly UUID: string = "0000005A-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, CloudRelay.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.RelayControlPoint); + this.addCharacteristic(Characteristic.RelayState); + this.addCharacteristic(Characteristic.RelayEnabled); + } +} +// noinspection JSDeprecatedSymbols +Service.Relay = CloudRelay; +Service.CloudRelay = CloudRelay; + +/** + * Service "Contact Sensor" + */ +export class ContactSensor extends Service { + + public static readonly UUID: string = "00000080-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, ContactSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ContactSensorState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.ContactSensor = ContactSensor; + +/** + * Service "Data Stream Transport Management" + */ +export class DataStreamTransportManagement extends Service { + + public static readonly UUID: string = "00000129-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, DataStreamTransportManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SetupDataStreamTransport); + this.addCharacteristic(Characteristic.SupportedDataStreamTransportConfiguration); + this.addCharacteristic(Characteristic.Version); + } +} +Service.DataStreamTransportManagement = DataStreamTransportManagement; + +/** + * Service "Diagnostics" + */ +export class Diagnostics extends Service { + + public static readonly UUID: string = "00000237-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Diagnostics.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SupportedDiagnosticsSnapshot); + } +} +Service.Diagnostics = Diagnostics; + +/** + * Service "Door" + */ +export class Door extends Service { + + public static readonly UUID: string = "00000081-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Door.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentPosition); + this.addCharacteristic(Characteristic.PositionState); + this.addCharacteristic(Characteristic.TargetPosition); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.ObstructionDetected); + this.addOptionalCharacteristic(Characteristic.HoldPosition); + } +} +Service.Door = Door; + +/** + * Service "Doorbell" + */ +export class Doorbell extends Service { + + public static readonly UUID: string = "00000121-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Doorbell.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ProgrammableSwitchEvent); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Brightness); + this.addOptionalCharacteristic(Characteristic.Mute); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.OperatingStateResponse); + this.addOptionalCharacteristic(Characteristic.Volume); + } +} +Service.Doorbell = Doorbell; + +/** + * Service "Fan" + */ +export class Fan extends Service { + + public static readonly UUID: string = "00000040-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Fan.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.On); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.RotationDirection); + this.addOptionalCharacteristic(Characteristic.RotationSpeed); + } +} +Service.Fan = Fan; + +/** + * Service "Fanv2" + */ +export class Fanv2 extends Service { + + public static readonly UUID: string = "000000B7-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Fanv2.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.CurrentFanState); + this.addOptionalCharacteristic(Characteristic.TargetFanState); + this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.RotationDirection); + this.addOptionalCharacteristic(Characteristic.RotationSpeed); + this.addOptionalCharacteristic(Characteristic.SwingMode); + } +} +Service.Fanv2 = Fanv2; + +/** + * Service "Faucet" + */ +export class Faucet extends Service { + + public static readonly UUID: string = "000000D7-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Faucet.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusFault); + } +} +Service.Faucet = Faucet; + +/** + * Service "Filter Maintenance" + */ +export class FilterMaintenance extends Service { + + public static readonly UUID: string = "000000BA-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, FilterMaintenance.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.FilterChangeIndication); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.FilterLifeLevel); + this.addOptionalCharacteristic(Characteristic.ResetFilterIndication); + this.addOptionalCharacteristic(Characteristic.Name); + } +} +Service.FilterMaintenance = FilterMaintenance; + +/** + * Service "Garage Door Opener" + */ +export class GarageDoorOpener extends Service { + + public static readonly UUID: string = "00000041-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, GarageDoorOpener.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentDoorState); + this.addCharacteristic(Characteristic.TargetDoorState); + this.addCharacteristic(Characteristic.ObstructionDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.LockCurrentState); + this.addOptionalCharacteristic(Characteristic.LockTargetState); + this.addOptionalCharacteristic(Characteristic.Name); + } +} +Service.GarageDoorOpener = GarageDoorOpener; + +/** + * Service "Heater-Cooler" + */ +export class HeaterCooler extends Service { + + public static readonly UUID: string = "000000BC-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, HeaterCooler.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.CurrentHeaterCoolerState); + this.addCharacteristic(Characteristic.TargetHeaterCoolerState); + this.addCharacteristic(Characteristic.CurrentTemperature); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.RotationSpeed); + this.addOptionalCharacteristic(Characteristic.SwingMode); + this.addOptionalCharacteristic(Characteristic.CoolingThresholdTemperature); + this.addOptionalCharacteristic(Characteristic.HeatingThresholdTemperature); + this.addOptionalCharacteristic(Characteristic.TemperatureDisplayUnits); + } +} +Service.HeaterCooler = HeaterCooler; + +/** + * Service "Humidifier-Dehumidifier" + */ +export class HumidifierDehumidifier extends Service { + + public static readonly UUID: string = "000000BD-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, HumidifierDehumidifier.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.CurrentHumidifierDehumidifierState); + this.addCharacteristic(Characteristic.TargetHumidifierDehumidifierState); + this.addCharacteristic(Characteristic.CurrentRelativeHumidity); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.RelativeHumidityDehumidifierThreshold); + this.addOptionalCharacteristic(Characteristic.RelativeHumidityHumidifierThreshold); + this.addOptionalCharacteristic(Characteristic.RotationSpeed); + this.addOptionalCharacteristic(Characteristic.SwingMode); + this.addOptionalCharacteristic(Characteristic.WaterLevel); + } +} +Service.HumidifierDehumidifier = HumidifierDehumidifier; + +/** + * Service "Humidity Sensor" + */ +export class HumiditySensor extends Service { + + public static readonly UUID: string = "00000082-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, HumiditySensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentRelativeHumidity); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.HumiditySensor = HumiditySensor; + +/** + * Service "Input Source" + */ +export class InputSource extends Service { + + public static readonly UUID: string = "000000D9-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, InputSource.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ConfiguredName); + this.addCharacteristic(Characteristic.InputSourceType); + this.addCharacteristic(Characteristic.IsConfigured); + if (!this.testCharacteristic(Characteristic.Name)) { // workaround for Name characteristic collision in constructor + this.addCharacteristic(Characteristic.Name).updateValue("Unnamed Service"); + } + this.addCharacteristic(Characteristic.CurrentVisibilityState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Identifier); + this.addOptionalCharacteristic(Characteristic.InputDeviceType); + this.addOptionalCharacteristic(Characteristic.TargetVisibilityState); + } +} +Service.InputSource = InputSource; + +/** + * Service "Irrigation-System" + */ +export class IrrigationSystem extends Service { + + public static readonly UUID: string = "000000CF-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, IrrigationSystem.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.ProgramMode); + this.addCharacteristic(Characteristic.InUse); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.RemainingDuration); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusFault); + } +} +Service.IrrigationSystem = IrrigationSystem; + +/** + * Service "Leak Sensor" + */ +export class LeakSensor extends Service { + + public static readonly UUID: string = "00000083-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, LeakSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.LeakDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.LeakSensor = LeakSensor; + +/** + * Service "Lightbulb" + */ +export class Lightbulb extends Service { + + public static readonly UUID: string = "00000043-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Lightbulb.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.On); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Brightness); + this.addOptionalCharacteristic(Characteristic.CharacteristicValueActiveTransitionCount); + this.addOptionalCharacteristic(Characteristic.CharacteristicValueTransitionControl); + this.addOptionalCharacteristic(Characteristic.ColorTemperature); + this.addOptionalCharacteristic(Characteristic.Hue); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.Saturation); + this.addOptionalCharacteristic(Characteristic.SupportedCharacteristicValueTransitionConfiguration); + } +} +Service.Lightbulb = Lightbulb; + +/** + * Service "Light Sensor" + */ +export class LightSensor extends Service { + + public static readonly UUID: string = "00000084-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, LightSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentAmbientLightLevel); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.LightSensor = LightSensor; + +/** + * Service "Lock Management" + */ +export class LockManagement extends Service { + + public static readonly UUID: string = "00000044-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, LockManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.LockControlPoint); + this.addCharacteristic(Characteristic.Version); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.AdministratorOnlyAccess); + this.addOptionalCharacteristic(Characteristic.AudioFeedback); + this.addOptionalCharacteristic(Characteristic.CurrentDoorState); + this.addOptionalCharacteristic(Characteristic.LockManagementAutoSecurityTimeout); + this.addOptionalCharacteristic(Characteristic.LockLastKnownAction); + this.addOptionalCharacteristic(Characteristic.Logs); + this.addOptionalCharacteristic(Characteristic.MotionDetected); + } +} +Service.LockManagement = LockManagement; + +/** + * Service "Lock Mechanism" + */ +export class LockMechanism extends Service { + + public static readonly UUID: string = "00000045-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, LockMechanism.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.LockCurrentState); + this.addCharacteristic(Characteristic.LockTargetState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + } +} +Service.LockMechanism = LockMechanism; + +/** + * Service "Microphone" + */ +export class Microphone extends Service { + + public static readonly UUID: string = "00000112-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Microphone.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Mute); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Volume); + } +} +Service.Microphone = Microphone; + +/** + * Service "Motion Sensor" + */ +export class MotionSensor extends Service { + + public static readonly UUID: string = "00000085-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, MotionSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.MotionDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.MotionSensor = MotionSensor; + +/** + * Service "Occupancy Sensor" + */ +export class OccupancySensor extends Service { + + public static readonly UUID: string = "00000086-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, OccupancySensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.OccupancyDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.OccupancySensor = OccupancySensor; + +/** + * Service "Outlet" + * @since iOS 13 + */ +export class Outlet extends Service { + + public static readonly UUID: string = "00000047-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Outlet.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.On); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.OutletInUse); + } +} +Service.Outlet = Outlet; + +/** + * Service "Pairing" + */ +export class Pairing extends Service { + + public static readonly UUID: string = "00000055-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Pairing.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ListPairings); + this.addCharacteristic(Characteristic.PairSetup); + this.addCharacteristic(Characteristic.PairVerify); + this.addCharacteristic(Characteristic.PairingFeatures); + } +} +Service.Pairing = Pairing; + +/** + * Service "Power Management" + */ +export class PowerManagement extends Service { + + public static readonly UUID: string = "00000221-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, PowerManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.WakeConfiguration); + } +} +Service.PowerManagement = PowerManagement; + +/** + * Service "Protocol Information" + */ +export class ProtocolInformation extends Service { + + public static readonly UUID: string = "000000A2-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, ProtocolInformation.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Version); + } +} +Service.ProtocolInformation = ProtocolInformation; + +/** + * Service "Security System" + */ +export class SecuritySystem extends Service { + + public static readonly UUID: string = "0000007E-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, SecuritySystem.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SecuritySystemCurrentState); + this.addCharacteristic(Characteristic.SecuritySystemTargetState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.SecuritySystemAlarmType); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.SecuritySystem = SecuritySystem; + +/** + * Service "Service Label" + */ +export class ServiceLabel extends Service { + + public static readonly UUID: string = "000000CC-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, ServiceLabel.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ServiceLabelNamespace); + } +} +Service.ServiceLabel = ServiceLabel; + +/** + * Service "Siri" + */ +export class Siri extends Service { + + public static readonly UUID: string = "00000133-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Siri.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SiriInputType); + } +} +Service.Siri = Siri; + +/** + * Service "Slats" + */ +export class Slats extends Service { + + public static readonly UUID: string = "000000B9-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Slats.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentSlatState); + this.addCharacteristic(Characteristic.SlatType); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.SwingMode); + this.addOptionalCharacteristic(Characteristic.CurrentTiltAngle); + this.addOptionalCharacteristic(Characteristic.TargetTiltAngle); + } +} +// noinspection JSDeprecatedSymbols +Service.Slat = Slats; +Service.Slats = Slats; + +/** + * Service "Smart Speaker" + */ +export class SmartSpeaker extends Service { + + public static readonly UUID: string = "00000228-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, SmartSpeaker.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentMediaState); + this.addCharacteristic(Characteristic.TargetMediaState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.ConfiguredName); + this.addOptionalCharacteristic(Characteristic.Mute); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.Volume); + } +} +Service.SmartSpeaker = SmartSpeaker; + +/** + * Service "Smoke Sensor" + */ +export class SmokeSensor extends Service { + + public static readonly UUID: string = "00000087-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, SmokeSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SmokeDetected); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.SmokeSensor = SmokeSensor; + +/** + * Service "Speaker" + * @since iOS 10 + */ +export class Speaker extends Service { + + public static readonly UUID: string = "00000113-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Speaker.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Mute); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Active); + this.addOptionalCharacteristic(Characteristic.Volume); + } +} +Service.Speaker = Speaker; + +/** + * Service "Stateful Programmable Switch" + */ +export class StatefulProgrammableSwitch extends Service { + + public static readonly UUID: string = "00000088-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, StatefulProgrammableSwitch.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ProgrammableSwitchEvent); + this.addCharacteristic(Characteristic.ProgrammableSwitchOutputState); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + } +} +Service.StatefulProgrammableSwitch = StatefulProgrammableSwitch; + +/** + * Service "Stateless Programmable Switch" + */ +export class StatelessProgrammableSwitch extends Service { + + public static readonly UUID: string = "00000089-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, StatelessProgrammableSwitch.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ProgrammableSwitchEvent); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.ServiceLabelIndex); + } +} +Service.StatelessProgrammableSwitch = StatelessProgrammableSwitch; + +/** + * Service "Switch" + */ +export class Switch extends Service { + + public static readonly UUID: string = "00000049-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Switch.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.On); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + } +} +Service.Switch = Switch; + +/** + * Service "Target Control" + */ +export class TargetControl extends Service { + + public static readonly UUID: string = "00000125-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, TargetControl.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.ActiveIdentifier); + this.addCharacteristic(Characteristic.ButtonEvent); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + } +} +Service.TargetControl = TargetControl; + +/** + * Service "Target Control Management" + */ +export class TargetControlManagement extends Service { + + public static readonly UUID: string = "00000122-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, TargetControlManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.TargetControlSupportedConfiguration); + this.addCharacteristic(Characteristic.TargetControlList); + } +} +Service.TargetControlManagement = TargetControlManagement; + +/** + * Service "Television" + */ +export class Television extends Service { + + public static readonly UUID: string = "000000D8-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Television.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.ActiveIdentifier); + this.addCharacteristic(Characteristic.ConfiguredName); + this.addCharacteristic(Characteristic.RemoteKey); + this.addCharacteristic(Characteristic.SleepDiscoveryMode); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Brightness); + this.addOptionalCharacteristic(Characteristic.ClosedCaptions); + this.addOptionalCharacteristic(Characteristic.DisplayOrder); + this.addOptionalCharacteristic(Characteristic.CurrentMediaState); + this.addOptionalCharacteristic(Characteristic.TargetMediaState); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.PictureMode); + this.addOptionalCharacteristic(Characteristic.PowerModeSelection); + } +} +Service.Television = Television; + +/** + * Service "Television Speaker" + */ +export class TelevisionSpeaker extends Service { + + public static readonly UUID: string = "00000113-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, TelevisionSpeaker.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Mute); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Active); + this.addOptionalCharacteristic(Characteristic.Volume); + this.addOptionalCharacteristic(Characteristic.VolumeControlType); + this.addOptionalCharacteristic(Characteristic.VolumeSelector); + } +} +Service.TelevisionSpeaker = TelevisionSpeaker; + +/** + * Service "Temperature Sensor" + */ +export class TemperatureSensor extends Service { + + public static readonly UUID: string = "0000008A-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, TemperatureSensor.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentTemperature); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.StatusActive); + this.addOptionalCharacteristic(Characteristic.StatusFault); + this.addOptionalCharacteristic(Characteristic.StatusLowBattery); + this.addOptionalCharacteristic(Characteristic.StatusTampered); + } +} +Service.TemperatureSensor = TemperatureSensor; + +/** + * Service "Thermostat" + */ +export class Thermostat extends Service { + + public static readonly UUID: string = "0000004A-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Thermostat.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentHeatingCoolingState); + this.addCharacteristic(Characteristic.TargetHeatingCoolingState); + this.addCharacteristic(Characteristic.CurrentTemperature); + this.addCharacteristic(Characteristic.TargetTemperature); + this.addCharacteristic(Characteristic.TemperatureDisplayUnits); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.CurrentRelativeHumidity); + this.addOptionalCharacteristic(Characteristic.TargetRelativeHumidity); + this.addOptionalCharacteristic(Characteristic.CoolingThresholdTemperature); + this.addOptionalCharacteristic(Characteristic.HeatingThresholdTemperature); + } +} +Service.Thermostat = Thermostat; + +/** + * Service "Thread Transport" + */ +export class ThreadTransport extends Service { + + public static readonly UUID: string = "00000701-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, ThreadTransport.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentTransport); + this.addCharacteristic(Characteristic.ThreadControlPoint); + this.addCharacteristic(Characteristic.ThreadNodeCapabilities); + this.addCharacteristic(Characteristic.ThreadStatus); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.CCAEnergyDetectThreshold); + this.addOptionalCharacteristic(Characteristic.CCASignalDetectThreshold); + this.addOptionalCharacteristic(Characteristic.EventRetransmissionMaximum); + this.addOptionalCharacteristic(Characteristic.EventTransmissionCounters); + this.addOptionalCharacteristic(Characteristic.MACRetransmissionMaximum); + this.addOptionalCharacteristic(Characteristic.MACTransmissionCounters); + this.addOptionalCharacteristic(Characteristic.ReceiverSensitivity); + this.addOptionalCharacteristic(Characteristic.ReceivedSignalStrengthIndication); + this.addOptionalCharacteristic(Characteristic.SignalToNoiseRatio); + this.addOptionalCharacteristic(Characteristic.ThreadOpenThreadVersion); + this.addOptionalCharacteristic(Characteristic.TransmitPower); + this.addOptionalCharacteristic(Characteristic.MaximumTransmitPower); + } +} +Service.ThreadTransport = ThreadTransport; + +/** + * Service "Transfer Transport Management" + */ +export class TransferTransportManagement extends Service { + + public static readonly UUID: string = "00000203-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, TransferTransportManagement.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.SupportedTransferTransportConfiguration); + this.addCharacteristic(Characteristic.SetupTransferTransport); + } +} +Service.TransferTransportManagement = TransferTransportManagement; + +/** + * Service "Tunnel" + */ +export class Tunnel extends Service { + + public static readonly UUID: string = "00000056-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Tunnel.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.AccessoryIdentifier); + this.addCharacteristic(Characteristic.TunnelConnectionTimeout); + this.addCharacteristic(Characteristic.TunneledAccessoryAdvertising); + this.addCharacteristic(Characteristic.TunneledAccessoryConnected); + this.addCharacteristic(Characteristic.TunneledAccessoryStateNumber); + } +} +// noinspection JSDeprecatedSymbols +Service.TunneledBTLEAccessoryService = Tunnel; +Service.Tunnel = Tunnel; + +/** + * Service "Valve" + */ +export class Valve extends Service { + + public static readonly UUID: string = "000000D0-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Valve.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.Active); + this.addCharacteristic(Characteristic.InUse); + this.addCharacteristic(Characteristic.ValveType); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.IsConfigured); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.RemainingDuration); + this.addOptionalCharacteristic(Characteristic.ServiceLabelIndex); + this.addOptionalCharacteristic(Characteristic.SetDuration); + this.addOptionalCharacteristic(Characteristic.StatusFault); + } +} +Service.Valve = Valve; + +/** + * Service "Wi-Fi Router" + */ +export class WiFiRouter extends Service { + + public static readonly UUID: string = "0000020A-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, WiFiRouter.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.ConfiguredName); + this.addCharacteristic(Characteristic.ManagedNetworkEnable); + this.addCharacteristic(Characteristic.NetworkAccessViolationControl); + this.addCharacteristic(Characteristic.NetworkClientProfileControl); + this.addCharacteristic(Characteristic.NetworkClientStatusControl); + this.addCharacteristic(Characteristic.RouterStatus); + this.addCharacteristic(Characteristic.SupportedRouterConfiguration); + this.addCharacteristic(Characteristic.WANConfigurationList); + this.addCharacteristic(Characteristic.WANStatusList); + } +} +Service.WiFiRouter = WiFiRouter; + +/** + * Service "Wi-Fi Satellite" + */ +export class WiFiSatellite extends Service { + + public static readonly UUID: string = "0000020F-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, WiFiSatellite.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.WiFiSatelliteStatus); + } +} +Service.WiFiSatellite = WiFiSatellite; + +/** + * Service "Wi-Fi Transport" + */ +export class WiFiTransport extends Service { + + public static readonly UUID: string = "0000022A-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, WiFiTransport.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentTransport); + this.addCharacteristic(Characteristic.WiFiCapabilities); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.WiFiConfigurationControl); + } +} +Service.WiFiTransport = WiFiTransport; + +/** + * Service "Window" + */ +export class Window extends Service { + + public static readonly UUID: string = "0000008B-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, Window.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentPosition); + this.addCharacteristic(Characteristic.PositionState); + this.addCharacteristic(Characteristic.TargetPosition); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.ObstructionDetected); + this.addOptionalCharacteristic(Characteristic.HoldPosition); + } +} +Service.Window = Window; + +/** + * Service "Window Covering" + */ +export class WindowCovering extends Service { + + public static readonly UUID: string = "0000008C-0000-1000-8000-0026BB765291"; + + constructor(displayName?: string, subtype?: string) { + super(displayName, WindowCovering.UUID, subtype); + + // Required Characteristics + this.addCharacteristic(Characteristic.CurrentPosition); + this.addCharacteristic(Characteristic.PositionState); + this.addCharacteristic(Characteristic.TargetPosition); + + // Optional Characteristics + this.addOptionalCharacteristic(Characteristic.CurrentHorizontalTiltAngle); + this.addOptionalCharacteristic(Characteristic.TargetHorizontalTiltAngle); + this.addOptionalCharacteristic(Characteristic.Name); + this.addOptionalCharacteristic(Characteristic.ObstructionDetected); + this.addOptionalCharacteristic(Characteristic.HoldPosition); + this.addOptionalCharacteristic(Characteristic.CurrentVerticalTiltAngle); + this.addOptionalCharacteristic(Characteristic.TargetVerticalTiltAngle); + } +} +Service.WindowCovering = WindowCovering; + diff --git a/src/lib/definitions/generate-definitions.ts b/src/lib/definitions/generate-definitions.ts new file mode 100644 index 000000000..a2b43c124 --- /dev/null +++ b/src/lib/definitions/generate-definitions.ts @@ -0,0 +1,769 @@ +import assert from "assert"; +import { Command } from "commander"; +import fs from "fs"; +import path from "path"; +import plist from "simple-plist"; +import { Characteristic, Formats, Units } from "../Characteristic"; +import { toLongForm } from "../util/uuid"; +import { + CharacteristicClassAdditions, + CharacteristicDeprecatedNames, + CharacteristicHidden, + CharacteristicManualAdditions, + CharacteristicNameOverrides, + CharacteristicSinceInformation, + CharacteristicValidValuesOverride, ServiceCharacteristicConfigurationOverrides, + ServiceDeprecatedNames, + ServiceManualAdditions, + ServiceNameOverrides, + ServiceSinceInformation +} from "./generator-configuration"; + +// noinspection JSUnusedLocalSymbols +const temp = Characteristic; // this to have "../Characteristic" not being only type import, otherwise this would not result in a require statement + +const command = new Command("generate-definitions") + .version("1.0.0") + .option("-f, --force") + .option("-m, --metadata ", "Define a custom location for the plain-metadata.config file", + "/System/Library/PrivateFrameworks/HomeKitDaemon.framework/Resources/plain-metadata.config") + .requiredOption("-s, --simulator ", "Define the path to the accessory simulator."); + +command.parse(process.argv); +const options = command.opts(); + +const metadataFile: string = options.metadata; +const simulator: string = options.simulator; +if (!fs.existsSync(metadataFile)) { + console.warn(`The metadata file at '${metadataFile}' does not exist!`); + process.exit(1); +} +if (!fs.existsSync(simulator)) { + console.warn(`The simulator app directory '${simulator}' does not exist!`); + process.exit(1); +} + +const defaultPlist: string = path.resolve(simulator, "Contents/Frameworks/HAPAccessoryKit.framework/Resources/default.metadata.plist"); +const defaultMfiPlist: string = path.resolve(simulator, "Contents/Frameworks/HAPAccessoryKit.framework/Resources/default_mfi.metadata.plist"); + +interface CharacteristicDefinition { + DefaultDescription: string, + Format: string, + LocalizationKey: string, + Properties: number, + ShortUUID: string, + MaxValue?: number, + MinValue?: number, + MaxLength?: number, + // MinLength is another property present on the SerialNumber characteristic. Though we already have a special check for that + StepValue?: number, + Units?: string, +} + +interface SimulatorCharacteristicDefinition { + UUID: string; + Name: string; + Format: string; + Constraints?: Constraints; + Permissions: string[]; // stuff like "securedRead", "securedWrite", "writeResponse" or "timedWrite" + Properties: string[]; // stuff like "read", "write", "cnotify", "uncnotify" +} + +interface Constraints { + StepValue?: number; + MaximumValue?: number; + MinimumValue?: number; + ValidValues?: Record; + ValidBits?: Record; +} + +interface ServiceDefinition { + Characteristics: { + Optional: string[], + Required: string[] + }, + DefaultDescription: string, + LocalizationKey: string, + ShortUUID: string, +} + +interface PropertyDefinition { + DefaultDescription: string; + LocalizationKey: string; + Position: number; +} + +interface UnitDefinition { + DefaultDescription: string, + LocalizationKey: string; +} + +interface CategoryDefinition { + DefaultDescription: string; + Identifier: number; + UUID: string; +} + +export interface GeneratedCharacteristic { + id: string; + UUID: string, + name: string, + className: string, + deprecatedClassName?: string; + since?: string, + + format: string, + units?: string, + properties: number, + maxValue?: number, + minValue?: number, + stepValue?: number, + maxLength?: number, + + validValues?: Record; // + validBitMasks?: Record; + + classAdditions?: string[], +} + +export interface GeneratedService { + id: string, + UUID: string, + name: string, + className: string, + deprecatedClassName?: string, + since?: string, + + requiredCharacteristics: string[]; + optionalCharacteristics?: string[]; +} + +const plistData = plist.readFileSync(metadataFile); +const simulatorPlistData = plist.readFileSync(defaultPlist); +const simulatorMfiPlistData = fs.existsSync(defaultMfiPlist)? plist.readFileSync(defaultMfiPlist): undefined; + +if (plistData.SchemaVersion !== 1) { + console.warn(`Detected unsupported schema version ${plistData.SchemaVersion}!`); +} +if (plistData.PlistDictionary.SchemaVersion !== 1) { + console.warn(`Detect unsupported PlistDictionary schema version ${plistData.PlistDictionary.SchemaVersion}!`); +} + +console.log(`Parsing version ${plistData.Version}...`); + +const shouldParseCharacteristics = checkWrittenVersion("./CharacteristicDefinitions.ts", plistData.Version); +const shouldParseServices = checkWrittenVersion("./ServiceDefinitions.ts", plistData.Version); + +if (!options.force && (!shouldParseCharacteristics || !shouldParseServices)) { + console.log("Parsed schema version " + plistData.Version + " is older than what's already generated. " + + "User --force option to generate and overwrite nonetheless!"); + process.exit(1); +} + +const undefinedUnits: string[] = ["micrograms/m^3", "ppm"]; + +let characteristics: Record; +const simulatorCharacteristics: Map = new Map(); +let services: Record; +let units: Record; +let categories: Record; +const properties: Map = new Map(); +try { + characteristics = checkDefined(plistData.PlistDictionary.HAP.Characteristics); + services = checkDefined(plistData.PlistDictionary.HAP.Services); + units = checkDefined(plistData.PlistDictionary.HAP.Units); + categories = checkDefined(plistData.PlistDictionary.HomeKit.Categories); + + const props: Record = checkDefined(plistData.PlistDictionary.HAP.Properties); + // noinspection JSUnusedLocalSymbols + for (const [id, definition] of Object.entries(props).sort(([a, aDef], [b, bDef]) => aDef.Position - bDef.Position)) { + const perm = characteristicPerm(id); + if (perm) { + const num = 1 << definition.Position; + properties.set(num, perm); + } + } + + for (const characteristic of (simulatorPlistData.Characteristics as SimulatorCharacteristicDefinition[])) { + simulatorCharacteristics.set(characteristic.UUID, characteristic); + } + if (simulatorMfiPlistData) { + for (const characteristic of (simulatorMfiPlistData.Characteristics as SimulatorCharacteristicDefinition[])) { + simulatorCharacteristics.set(characteristic.UUID, characteristic); + } + } +} catch (error) { + console.log("Unexpected structure of the plist file!"); + throw error; +} + +// first step is to check if we are up to date on categories +for (const definition of Object.values(categories)) { + if (definition.Identifier > 36) { + console.log(`Detected a new category '${definition.DefaultDescription}' with id ${definition.Identifier}`); + } +} + +const characteristicOutput = fs.createWriteStream(path.join(__dirname, "CharacteristicDefinitions.ts")); + +characteristicOutput.write("// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY\n"); +characteristicOutput.write(`// V=${plistData.Version}\n`); +characteristicOutput.write("\n"); + +characteristicOutput.write("import { Characteristic, Formats, Perms, Units } from \"../Characteristic\";\n\n"); + +/** + * Characteristics + */ + +const generatedCharacteristics: Record = {}; +const writtenCharacteristicEntries: Record = {}; // Characteristic. = + +for (const [id, definition] of Object.entries(characteristics)) { + try { + if (CharacteristicHidden.has(id)) { + continue; + } + + // "Carbon dioxide Detected" -> "Carbon Dioxide Detected" + const name = (CharacteristicNameOverrides.get(id) ?? definition.DefaultDescription).split(" ").map(entry => entry[0].toUpperCase() + entry.slice(1)).join(" "); + const deprecatedName = CharacteristicDeprecatedNames.get(id); + + // "Target Door State" -> "TargetDoorState", "PM2.5" -> "PM2_5" + const className = name.replace(/[\s\-]/g, "").replace(/[.]/g, "_"); + const deprecatedClassName = deprecatedName?.replace(/[\s\-]/g, "").replace(/[.]/g, "_"); + const longUUID = toLongForm(definition.ShortUUID); + + const simulatorCharacteristic = simulatorCharacteristics.get(longUUID); + + const validValues = simulatorCharacteristic?.Constraints?.ValidValues || {}; + const validValuesOverride = CharacteristicValidValuesOverride.get(id); + if (validValuesOverride) { + for (const [key, value] of Object.entries(validValuesOverride)) { + validValues[key] = value; + } + } + for (const [value, name] of Object.entries(validValues)) { + let constName = name.toUpperCase().replace(/[^\w]+/g, "_"); + if (/^[1-9]/.test(constName)) { + constName = "_" + constName; // variables can't start with a number + } + validValues[value] = constName; + } + const validBits = simulatorCharacteristic?.Constraints?.ValidBits; + let validBitMasks: Record | undefined = undefined; + if (validBits) { + validBitMasks = {}; + for (const [value, name] of Object.entries(validBits)) { + let constName = name.toUpperCase().replace(/[^\w]+/g, "_"); + if (/^[1-9]/.test(constName)) { + constName = "_" + constName; // variables can't start with a number + } + validBitMasks["" + (1 << parseInt(value))] = constName + "_BIT_MASK"; + } + } + + generatedCharacteristics[id] = { + id: id, + UUID: longUUID, + name: name, + className: className, + deprecatedClassName: deprecatedClassName, + since: CharacteristicSinceInformation.get(id), + + format: definition.Format, + units: definition.Units, + properties: definition.Properties, + minValue: definition.MinValue, + maxValue: definition.MaxValue, + stepValue: definition.StepValue, + + maxLength: definition.MaxLength, + + validValues: Object.entries(validValues).length? validValues: undefined, + validBitMasks: validBitMasks, + classAdditions: CharacteristicClassAdditions.get(id), + }; + writtenCharacteristicEntries[className] = className; + if (deprecatedClassName) { + writtenCharacteristicEntries[deprecatedClassName] = className; + } + } catch (error) { + throw new Error("Error thrown generating characteristic '" + id + "' (" + definition.DefaultDescription + "): " + error.message); + } +} + +for (const [id, generated] of CharacteristicManualAdditions) { + generatedCharacteristics[id] = generated; + writtenCharacteristicEntries[generated.className] = generated.className; + if (generated.deprecatedClassName) { + writtenCharacteristicEntries[generated.deprecatedClassName] = generated.className; + } +} + +for (const generated of Object.values(generatedCharacteristics) + .sort((a, b) => a.className.localeCompare(b.className))) { + try { + characteristicOutput.write("/**\n"); + characteristicOutput.write(" * Characteristic \"" + generated.name + "\"\n"); + if (generated.since) { + characteristicOutput.write(" * @since iOS " + generated.since + "\n"); + } + characteristicOutput.write(" */\n"); + + + characteristicOutput.write("export class " + generated.className + " extends Characteristic {\n\n"); + + characteristicOutput.write(" public static readonly UUID: string = \"" + generated.UUID + "\";\n\n"); + + const classAdditions = generated.classAdditions; + if (classAdditions) { + characteristicOutput.write(classAdditions.map(line => " " + line + "\n").join("") + "\n"); + } + + if (generated.validValues) { + for (let [value, name] of Object.entries(generated.validValues)) { + characteristicOutput.write(` public static readonly ${name} = ${value};\n`); + } + characteristicOutput.write("\n"); + } + if (generated.validBitMasks) { + for (let [value, name] of Object.entries(generated.validBitMasks)) { + characteristicOutput.write(` public static readonly ${name} = ${value};\n`); + } + characteristicOutput.write("\n"); + } + + characteristicOutput.write(" constructor() {\n"); + characteristicOutput.write(" super(\"" + generated.name + "\", " + generated.className + ".UUID, {\n"); + characteristicOutput.write(" format: Formats." + characteristicFormat(generated.format) + ",\n"); + characteristicOutput.write(" perms: [" + generatePermsString(generated.properties) + "],\n") + if (generated.units && !undefinedUnits.includes(generated.units)) { + characteristicOutput.write(" unit: Units." + characteristicUnit(generated.units) + ",\n"); + } + if (generated.minValue != null) { + characteristicOutput.write(" minValue: " + generated.minValue + ",\n"); + } + if (generated.maxValue != null) { + characteristicOutput.write(" maxValue: " + generated.maxValue + ",\n"); + } + if (generated.stepValue != null) { + characteristicOutput.write(" minStep: " + generated.stepValue + ",\n"); + } + if (generated.maxLength != null) { + characteristicOutput.write(" maxLen: " + generated.maxLength + ",\n"); + } + characteristicOutput.write(" });\n"); + characteristicOutput.write(" this.value = this.getDefaultValue();\n"); + characteristicOutput.write(" }\n"); + characteristicOutput.write("}\n"); + if (generated.deprecatedClassName) { + characteristicOutput.write("// noinspection JSDeprecatedSymbols\n"); + characteristicOutput.write("Characteristic." + generated.deprecatedClassName + " = " + generated.className + ";\n"); + } + characteristicOutput.write("Characteristic." + generated.className + " = " + generated.className + ";\n\n"); + } catch (error) { + throw new Error("Error thrown writing characteristic '" + generated.id + "' (" + generated.className + "): " + error.message); + } +} + +characteristicOutput.end(); + +const characteristicProperties = Object.entries(writtenCharacteristicEntries).sort(([a], [b]) => a.localeCompare(b)); +rewriteProperties("Characteristic", characteristicProperties); +writeCharacteristicTestFile(); + +/** + * Services + */ + +const serviceOutput = fs.createWriteStream(path.join(__dirname, "ServiceDefinitions.ts")); + +serviceOutput.write("// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY\n"); +serviceOutput.write(`// V=${plistData.Version}\n`); +serviceOutput.write("\n"); + +serviceOutput.write("import { Characteristic } from \"../Characteristic\";\n"); +serviceOutput.write("import { Service } from \"../Service\";\n\n"); + +const generatedServices: Record = {}; +const writtenServiceEntries: Record = {}; // Service. = + +for (const [id, definition] of Object.entries(services)) { + try { + // "Carbon dioxide Sensor" -> "Carbon Dioxide Sensor" + const name = (ServiceNameOverrides.get(id) ?? definition.DefaultDescription).split(" ").map(entry => entry[0].toUpperCase() + entry.slice(1)).join(" "); + const deprecatedName = ServiceDeprecatedNames.get(id); + + const className = name.replace(/[\s\-]/g, "").replace(/[.]/g, "_"); + const deprecatedClassName = deprecatedName?.replace(/[\s\-]/g, "").replace(/[.]/g, "_"); + + const longUUID = toLongForm(definition.ShortUUID); + + const requiredCharacteristics = definition.Characteristics.Required; + const optionalCharacteristics = definition.Characteristics.Optional; + + const configurationOverride = ServiceCharacteristicConfigurationOverrides.get(id); + if (configurationOverride) { + if (configurationOverride.removedRequired) { + for (const entry of configurationOverride.removedRequired) { + const index = requiredCharacteristics.indexOf(entry); + if (index !== -1) { + requiredCharacteristics.splice(index, 1); + } + } + } + if (configurationOverride.removedOptional) { + for (const entry of configurationOverride.removedOptional) { + const index = optionalCharacteristics.indexOf(entry); + if (index !== -1) { + optionalCharacteristics.splice(index, 1); + } + } + } + + if (configurationOverride.addedRequired) { + for (const entry of configurationOverride.addedRequired) { + if (!requiredCharacteristics.includes(entry)) { + requiredCharacteristics.push(entry); + } + } + } + if (configurationOverride.addedOptional) { + for (const entry of configurationOverride.addedOptional) { + if (!optionalCharacteristics.includes(entry)) { + optionalCharacteristics.push(entry); + } + } + } + } + + generatedServices[id] = { + id: id, + UUID: longUUID, + name: name, + className: className, + deprecatedClassName: deprecatedClassName, + since: ServiceSinceInformation.get(id), + + requiredCharacteristics: requiredCharacteristics, + optionalCharacteristics: optionalCharacteristics, + } + writtenServiceEntries[className] = className; + if (deprecatedClassName) { + writtenServiceEntries[deprecatedClassName] = className; + } + } catch (error) { + throw new Error("Error thrown generating service '" + id + "' (" + definition.DefaultDescription + "): " + error.message); + } +} + +for (const [id, generated] of ServiceManualAdditions) { + generatedServices[id] = generated; + writtenServiceEntries[generated.className] = generated.className; + if (generated.deprecatedClassName) { + writtenServiceEntries[generated.deprecatedClassName] = generated.className; + } +} + +for (const generated of Object.values(generatedServices) + .sort((a, b) => a.className.localeCompare(b.className))) { + try { + serviceOutput.write("/**\n"); + serviceOutput.write(" * Service \"" + generated.name + "\"\n"); + if (generated.since) { + serviceOutput.write(" * @since iOS " + generated.since + "\n"); + } + serviceOutput.write(" */\n"); + + serviceOutput.write("export class " + generated.className + " extends Service {\n\n"); + + serviceOutput.write(" public static readonly UUID: string = \"" + generated.UUID + "\";\n\n"); + + serviceOutput.write(" constructor(displayName?: string, subtype?: string) {\n"); + serviceOutput.write(" super(displayName, " + generated.className + ".UUID, subtype);\n\n"); + + serviceOutput.write(" // Required Characteristics\n"); + for (const required of generated.requiredCharacteristics) { + const characteristic = generatedCharacteristics[required]; + if (!characteristic) { + console.warn("Could not find required characteristic " + required + " for " + generated.className); + continue; + } + + if (required === "name") { + serviceOutput.write(" if (!this.testCharacteristic(Characteristic.Name)) { // workaround for Name characteristic collision in constructor\n"); + serviceOutput.write(" this.addCharacteristic(Characteristic.Name).updateValue(\"Unnamed Service\");\n"); + serviceOutput.write(" }\n"); + } else { + serviceOutput.write(" this.addCharacteristic(Characteristic." + characteristic.className + ");\n"); + } + } + + if (generated.optionalCharacteristics) { + serviceOutput.write("\n // Optional Characteristics\n"); + for (const optional of generated.optionalCharacteristics) { + const characteristic = generatedCharacteristics[optional]; + if (!characteristic) { + console.warn("Could not find optional characteristic " + optional + " for " + generated.className); + continue; + } + serviceOutput.write(" this.addOptionalCharacteristic(Characteristic." + characteristic.className + ");\n"); + } + } + + serviceOutput.write(" }\n}\n"); + if (generated.deprecatedClassName) { + serviceOutput.write("// noinspection JSDeprecatedSymbols\n"); + serviceOutput.write("Service." + generated.deprecatedClassName + " = " + generated.className + ";\n"); + } + serviceOutput.write("Service." + generated.className + " = " + generated.className + ";\n\n"); + } catch (error) { + throw new Error("Error thrown writing service '" + generated.id + "' (" + generated.className + "): " + error.message); + } +} + +serviceOutput.end(); + + +const serviceProperties = Object.entries(writtenServiceEntries).sort(([a], [b]) => a.localeCompare(b)); +rewriteProperties("Service", serviceProperties); +writeServicesTestFile(); + +// ------------------------ utils ------------------------ +function checkDefined(input: T): T { + if (!input) { + throw new Error("value is undefined!"); + } + + return input; +} + +function characteristicFormat(format: string): string { + // @ts-expect-error + for (const [key, value] of Object.entries(Formats)) { + if (value === format) { + return key; + } + } + + throw new Error("Unknown characteristic format '" + format + "'"); +} + +function characteristicUnit(unit: string): string { + // @ts-expect-error + for (const [key, value] of Object.entries(Units)) { + if (value === unit) { + return key; + } + } + + throw new Error("Unknown characteristic format '" + unit + "'"); +} + +function characteristicPerm(id: string): string | undefined { + switch (id) { + case "aa": + return "ADDITIONAL_AUTHORIZATION"; + case "hidden": + return "HIDDEN"; + case "notify": + return "NOTIFY"; + case "read": + return "PAIRED_READ"; + case "timedWrite": + return "TIMED_WRITE"; + case "write": + return "PAIRED_WRITE"; + case "writeResponse": + return "WRITE_RESPONSE"; + case "broadcast": // used for bluetooth + return undefined; + default: + throw new Error("Received unknown perms id: " + id); + } +} + +function generatePermsString(propertiesBitMap: number): string { + const perms: string [] = []; + + for (const [bitMap, name] of properties) { + if ((propertiesBitMap | bitMap) === propertiesBitMap) { // if it stays the same the bit is set + perms.push("Perms." + name); + } + } + + const result = perms.join(", "); + assert(result != "", "perms string cannot be empty (" + propertiesBitMap + ")"); + return result; +} + +function checkWrittenVersion(filePath: string, parsingVersion: number): boolean { + filePath = path.resolve(__dirname, filePath); + + const content = fs.readFileSync(filePath, { encoding: "utf8" }).split("\n", 3); + const v = content[1]; + if (!v.startsWith("// V=")) { + throw new Error("Could not detect definition version for '" + filePath + "'"); + } + + const version = parseInt(v.replace("// V=", "")); + return parsingVersion >= version; +} + +function rewriteProperties(className: string, properties: [key: string, value: string][]): void { + const filePath = path.resolve(__dirname, "../" + className + ".ts"); + if (!fs.existsSync(filePath)) { + throw new Error("File '" + filePath + "' does not exists!"); + } + + const file = fs.readFileSync(filePath, { encoding: "utf8"}); + const lines = file.split("\n"); + + let i = 0; + + let importStart = -1; + let importEnd = -1; + let foundImport = false; + + for (; i < lines.length; i++) { + const line = lines[i]; + if (line === "import {") { + importStart = i; // save last import start; + } else if (line === "} from \"./definitions\";") { + importEnd = i; + foundImport = true; + break; + } + } + if (!foundImport) { + throw new Error("Could not find import section!"); + } + + let startIndex = -1; + let stopIndex = -1; + + for (; i < lines.length; i++) { + if (lines[i] === " // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-") { + startIndex = i; + break; + } + } + if (startIndex === -1) { + throw new Error("Could not find start pattern in file!"); + } + for (; i < lines.length; i++) { + if (lines[i] === " // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=") { + stopIndex = i; + break; + } + } + if (stopIndex === -1) { + throw new Error("Could not find stop pattern in file!"); + } + + const importSize = importEnd - importStart - 1; + const newImports = properties + .filter(([key, value]) => key === value) + .map(([key]) => " " + key + ","); + lines.splice(importStart + 1, importSize, ...newImports); // remove current imports + + const importDelta = newImports.length - importSize; + + startIndex += importDelta; + stopIndex += importDelta; + + const amount = stopIndex - startIndex - 1; + const newContentLines = properties.map(([key, value]) => { + let line = ""; + if (key !== value) { + line += " /**\n"; + line += " * @deprecated Please use {@link " + className + "." + value + "}.\n"; + line += " */ \n"; + } + line += " public static " + key + ": typeof " + value + ";"; + return line; + }); + lines.splice(startIndex + 1, amount, ...newContentLines); // insert new lines + + const resultContent = lines.join("\n"); + fs.writeFileSync(filePath, resultContent, { encoding: "utf8" }); +} + +function writeCharacteristicTestFile(): void { + const characteristics = Object.values(generatedCharacteristics).sort((a, b) => a.className.localeCompare(b.className)); + + const testOutput = fs.createWriteStream(path.resolve(__dirname, "./CharacteristicDefinitions.spec.ts"), { encoding: "utf8" }); + testOutput.write("// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY\n"); + testOutput.write("import \"./\";\n\n"); + testOutput.write("import { Characteristic } from \"../Characteristic\";\n\n"); + testOutput.write("describe(\"CharacteristicDefinitions\", () => {"); + + for (const generated of characteristics) { + testOutput.write("\n"); + testOutput.write(" describe(\"" + generated.className + "\", () => {\n"); + + // first test is just calling the constructor + testOutput.write(" it(\"should be able to construct\", () => {\n"); + testOutput.write(" new Characteristic." + generated.className + "();\n"); + if (generated.deprecatedClassName) { + testOutput.write(" // noinspection JSDeprecatedSymbols\n"); + testOutput.write(" new Characteristic." + generated.deprecatedClassName + "();\n"); + } + testOutput.write(" });\n"); + + testOutput.write(" });\n"); + } + + testOutput.write("});\n"); + testOutput.end(); +} + +function writeServicesTestFile(): void { + const services = Object.values(generatedServices).sort((a, b) => a.className.localeCompare(b.className)); + + const testOutput = fs.createWriteStream(path.resolve(__dirname, "./ServiceDefinitions.spec.ts"), { encoding: "utf8" }); + testOutput.write("// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY\n"); + testOutput.write("import \"./\";\n\n"); + testOutput.write("import { Characteristic } from \"../Characteristic\";\n"); + testOutput.write("import { Service } from \"../Service\";\n\n"); + testOutput.write("describe(\"ServiceDefinitions\", () => {"); + + for (const generated of services) { + testOutput.write("\n"); + testOutput.write(" describe(\"" + generated.className + "\", () => {\n"); + + // first test is just calling the constructor + testOutput.write(" it(\"should be able to construct\", () => {\n"); + + testOutput.write(" const service0 = new Service." + generated.className + "();\n"); + testOutput.write(" const service1 = new Service." + generated.className + "(\"test name\");\n"); + testOutput.write(" const service2 = new Service." + generated.className + "(\"test name\", \"test sub type\");\n\n"); + + testOutput.write(" expect(service0.displayName).toBe(\"\");\n"); + testOutput.write(" expect(service0.testCharacteristic(Characteristic.Name)).toBe(" + generated.requiredCharacteristics.includes("name") + ");\n"); + testOutput.write(" expect(service0.subtype).toBeUndefined();\n\n"); + + testOutput.write(" expect(service1.displayName).toBe(\"test name\");\n"); + testOutput.write(" expect(service1.testCharacteristic(Characteristic.Name)).toBe(true);\n"); + testOutput.write(" expect(service1.getCharacteristic(Characteristic.Name).value).toBe(\"test name\");\n"); + testOutput.write(" expect(service1.subtype).toBeUndefined();\n\n"); + + testOutput.write(" expect(service2.displayName).toBe(\"test name\");\n"); + testOutput.write(" expect(service2.testCharacteristic(Characteristic.Name)).toBe(true);\n"); + testOutput.write(" expect(service2.getCharacteristic(Characteristic.Name).value).toBe(\"test name\");\n"); + testOutput.write(" expect(service2.subtype).toBe(\"test sub type\");\n"); + + if (generated.deprecatedClassName) { + testOutput.write(" // noinspection JSDeprecatedSymbols\n"); + testOutput.write("\n new Service." + generated.deprecatedClassName + "();\n"); + } + + testOutput.write(" });\n"); + + testOutput.write(" });\n"); + } + + testOutput.write("});\n"); + testOutput.end(); +} diff --git a/src/lib/definitions/generator-configuration.ts b/src/lib/definitions/generator-configuration.ts new file mode 100644 index 000000000..3513d0636 --- /dev/null +++ b/src/lib/definitions/generator-configuration.ts @@ -0,0 +1,155 @@ +import { GeneratedCharacteristic, GeneratedService } from "./generate-definitions"; + +export const CharacteristicHidden: Set = new Set([ + "service-signature", // BLE +]); + +export const CharacteristicNameOverrides: Map = new Map([ + ["air-quality", "Air Quality"], + ["app-matching-identifier", "App Matching Identifier"], + ["cloud-relay.control-point", "Relay Control Point"], + ["cloud-relay.current-state", "Relay State"], + ["cloud-relay.enabled", "Relay Enabled"], + ["density.voc", "VOC Density"], + ["filter.reset-indication", "Reset Filter Indication"], // Filter Reset Change Indication + ["light-level.current", "Current Ambient Light Level"], + ["network-client-control", "Network Client Profile Control"], + ["on", "On"], + ["selected-stream-configuration", "Selected RTP Stream Configuration"], + ["service-label-index", "Service Label Index"], + ["service-label-namespace", "Service Label Namespace"], + ["setup-stream-endpoint", "Setup Endpoints"], + ["snr", "Signal To Noise Ratio"], + ["supported-target-configuration", "Target Control Supported Configuration"], + ["target-list", "Target Control List"], + ["tunneled-accessory.advertising", "Tunneled Accessory Advertising"], + ["tunneled-accessory.connected", "Tunneled Accessory Connected"], + ["water-level", "Water Level"], +]); + +export const CharacteristicDeprecatedNames: Map = new Map([ // keep in mind that the displayName will change + ["list-pairings", "Pairing Pairings"], +]); + +export const CharacteristicValidValuesOverride: Map> = new Map([ + ["closed-captions", { "0": "Disabled", "1": "Enabled" }], + ["input-device-type", { "0": "Other", "1": "TV", "2": "Recording", "3": "Tuner", "4": "Playback", "5": "Audio System"}], + ["input-source-type", { "0": "Other", "1": "Home Screen", "2": "Tuner", "3": "HDMI", "4": "Composite Video", "5": "S Video", + "6": "Component Video", "7": "DVI", "8": "AirPlay", "9": "USB", "10": "Application" }], + ["managed-network-enable", { "0": "Disabled", "1": "Enabled" }], + ["manually-disabled", { "0": "Enabled", "1": "Disabled" }], + ["media-state.current", { "0": "Play", "1": "Pause", "2": "Stop", "4": "LOADING", "5": "Interrupted" }], + ["media-state.target", { "0": "Play", "1": "Pause", "2": "Stop" }], + ["picture-mode", { "0": "Other", "1": "Standard", "2": "Calibrated", "3": "Calibrated Dark", "4": "Vivid", "5": "Game", "6": "Computer", "7": "Custom" }], + ["power-mode-selection", { "0": "Show", "1": "Hide" }], + ["recording-audio-active", { "0": "Disable", "1": "Enable"}], + ["remote-key", { "0": "Rewind", "1": "Fast Forward", "2": "Next Track", "3": "Previous Track", "4": "Arrow Up", "5": "Arrow Down", + "6": "Arrow Left", "7": "Arrow Right", "8": "Select", "9": "Back", "10": "Exit", "11": "Play Pause", "15": "Information" }], + ["router-status", { "0": "Ready", "1": "Not Ready" }], + ["siri-input-type", { "0": "Push Button Triggered Apple TV"}], + ["sleep-discovery-mode", { "0": "Not Discoverable", "1": "Always Discoverable" }], + ["visibility-state.current", { "0": "Shown", "1": "Hidden" }], + ["visibility-state.target", { "0": "Shown", "1": "Hidden" }], + ["volume-control-type", { "0": "None", "1": "Relative", "2": "Relative With Current", "3": "Absolute" }], + ["volume-selector", { "0": "Increment", "1": "Decrement" }], + ["wifi-satellite-status", { "0": "Unknown", "1": "Connected", "2": "Not Connected" }], +] as [string, Record][]); + +export const CharacteristicClassAdditions: Map = new Map([ + ["humidifier-dehumidifier.state.target", ["/**\n * @deprecated Removed in iOS 11. Use {@link HUMIDIFIER_OR_DEHUMIDIFIER} instead.\n */\n public static readonly AUTO = 0;"]] +]); + +export const CharacteristicManualAdditions: Map = new Map([ + ["diagonal-field-of-view", { + id: "diagonal-field-of-view", + UUID: "00000224-0000-1000-8000-0026BB765291", + name: "Diagonal Field Of View", + className: "DiagonalFieldOfView", + since: "13.2", + + format: "float", + units: "arcdegrees", + properties: 3, // notify, paired read + minValue: 0, + maxValue: 360, + }], +]); + +export const ServiceNameOverrides: Map = new Map([ + ["accessory-information", "Accessory Information"], + ["camera-rtp-stream-management", "Camera RTP Stream Management"], + ["fanv2", "Fanv2"], + ["service-label", "Service Label"], + ["smart-speaker", "Smart Speaker"], + ["speaker", "Television Speaker"], // has some additional accessories +]); + +export const ServiceDeprecatedNames: Map = new Map([ + ["battery", "Battery Service"], + ["camera-recording-management", "Camera Event Recording Management"], + ["cloud-relay", "Relay"], + ["slats", "Slat"], + ["tunnel", "Tunneled BTLE Accessory Service"], +]); + +interface CharacteristicConfigurationOverride { + addedRequired?: string[], + removedRequired?: string[], + addedOptional?: string[], + removedOptional?: string[], +} + +export const ServiceCharacteristicConfigurationOverrides: Map = new Map([ + ["accessory-information", { addedRequired: ["firmware.revision"], removedOptional: ["firmware.revision"] }], + ["camera-operating-mode", { addedOptional: ["diagonal-field-of-view"] }], +]); + +export const ServiceManualAdditions: Map = new Map([ + ["og-speaker", { // same as Speaker service just a bit different + id: "og-speaker", + UUID: "00000113-0000-1000-8000-0026BB765291", + name: "Speaker", + className: "Speaker", + since: "10", + + requiredCharacteristics: ["mute"], + optionalCharacteristics: ["active", "volume"], + }] +]); + +export const CharacteristicSinceInformation: Map = new Map([ + ["activity-interval", "14"], + ["cca-energy-detect-threshold", "14"], + ["cca-signal-detect-threshold", "14"], + ["characteristic-value-active-transition-count", "14"], + ["characteristic-value-transition-control", "14"], + ["current-transport", "14"], + ["data-stream-hap-transport", "14"], + ["data-stream-hap-transport-interrupt", "14"], + ["event-retransmission-maximum", "14"], + ["event-transmission-counters", "14"], + ["heart-beat", "14"], + ["mac-retransmission-maximum", "14"], + ["mac-retransmission-counters", "14"], + ["operating-state-response", "14"], + ["ping", "14"], + ["receiver-sensitivity", "14"], + ["rssi", "14"], + ["setup-transfer-transport", "13.4"], + ["sleep-interval", "14"], + ["snr", "14"], + ["supported-characteristic-value-transition-configuration", "14"], + ["supported-diagnostics-snapshot", "14"], + ["supported-transfer-transport-configuration", "13.4"], + ["transmit-power", "14"], + ["transmit-power-maximum", "14"], + ["transfer-transport-management", "13.4"], + ["video-analysis-active", "14"], + ["wake-configuration", "13.4"], + ["wifi-capabilities", "14"], + ["wifi-configuration-control", "14"], +]); + +export const ServiceSinceInformation: Map = new Map([ + ["outlet", "13"], +]); diff --git a/src/lib/definitions/index.ts b/src/lib/definitions/index.ts new file mode 100644 index 000000000..9a5664a56 --- /dev/null +++ b/src/lib/definitions/index.ts @@ -0,0 +1,2 @@ +export * from "./CharacteristicDefinitions"; +export * from "./ServiceDefinitions"; diff --git a/src/lib/gen/HomeKit-Bridge.ts b/src/lib/gen/HomeKit-Bridge.ts deleted file mode 100644 index 462dc3d9b..000000000 --- a/src/lib/gen/HomeKit-Bridge.ts +++ /dev/null @@ -1,644 +0,0 @@ -import { Characteristic, Formats, Perms } from '../Characteristic'; -import { Service } from '../Service'; - -/** - * - * Removed in iOS 11 - * - */ - -/** - * Characteristic "App Matching Identifier" - */ - -export class AppMatchingIdentifier extends Characteristic { - - static readonly UUID: string = '000000A4-0000-1000-8000-0026BB765291'; - - constructor() { - super('App Matching Identifier', AppMatchingIdentifier.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AppMatchingIdentifier = AppMatchingIdentifier; - -/** - * Characteristic "Programmable Switch Output State" - */ - -export class ProgrammableSwitchOutputState extends Characteristic { - - static readonly UUID: string = '00000074-0000-1000-8000-0026BB765291'; - - constructor() { - super('Programmable Switch Output State', ProgrammableSwitchOutputState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ProgrammableSwitchOutputState = ProgrammableSwitchOutputState; - -/** - * Characteristic "Software Revision" - */ - -export class SoftwareRevision extends Characteristic { - - static readonly UUID: string = '00000054-0000-1000-8000-0026BB765291'; - - constructor() { - super('Software Revision', SoftwareRevision.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SoftwareRevision = SoftwareRevision; - -/** - * Service "Camera Control" - */ - -export class CameraControl extends Service { - - static readonly UUID: string = '00000111-0000-1000-8000-0026BB765291' - - constructor(displayName: string, subtype: string) { - super(displayName, CameraControl.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.On); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.CurrentHorizontalTiltAngle); - this.addOptionalCharacteristic(Characteristic.CurrentVerticalTiltAngle); - this.addOptionalCharacteristic(Characteristic.TargetHorizontalTiltAngle); - this.addOptionalCharacteristic(Characteristic.TargetVerticalTiltAngle); - this.addOptionalCharacteristic(Characteristic.NightVision); - this.addOptionalCharacteristic(Characteristic.OpticalZoom); - this.addOptionalCharacteristic(Characteristic.DigitalZoom); - this.addOptionalCharacteristic(Characteristic.ImageRotation); - this.addOptionalCharacteristic(Characteristic.ImageMirroring); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.CameraControl = CameraControl; - -/** - * Service "Stateful Programmable Switch" - */ - -export class StatefulProgrammableSwitch extends Service { - - static readonly UUID: string = '00000088-0000-1000-8000-0026BB765291' - - constructor(displayName: string, subtype: string) { - super(displayName, StatefulProgrammableSwitch.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ProgrammableSwitchEvent); - this.addCharacteristic(Characteristic.ProgrammableSwitchOutputState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.StatefulProgrammableSwitch = StatefulProgrammableSwitch; - -/** - * - * Removed in iOS 10 - * - */ - -/** - * Characteristic "Accessory Identifier" - */ - -export class AccessoryIdentifier extends Characteristic { - - static readonly UUID: string = '00000057-0000-1000-8000-0026BB765291'; - - constructor() { - super('Accessory Identifier', AccessoryIdentifier.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AccessoryIdentifier = AccessoryIdentifier; - -/** - * Characteristic "Category" - */ - -export class Category extends Characteristic { - - static readonly UUID: string = '000000A3-0000-1000-8000-0026BB765291'; - - constructor() { - super('Category', Category.UUID, { - format: Formats.UINT16, - maxValue: 16, - minValue: 1, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Category = Category; - -/** - * Characteristic "Configure Bridged Accessory" - */ - -export class ConfigureBridgedAccessory extends Characteristic { - - static readonly UUID: string = '000000A0-0000-1000-8000-0026BB765291'; - - constructor() { - super('Configure Bridged Accessory', ConfigureBridgedAccessory.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ConfigureBridgedAccessory = ConfigureBridgedAccessory; - -/** - * Characteristic "Configure Bridged Accessory Status" - */ - -export class ConfigureBridgedAccessoryStatus extends Characteristic { - - static readonly UUID: string = '0000009D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Configure Bridged Accessory Status', ConfigureBridgedAccessoryStatus.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ConfigureBridgedAccessoryStatus = ConfigureBridgedAccessoryStatus; - -/** - * Characteristic "Current Time" - */ - -export class CurrentTime extends Characteristic { - - static readonly UUID: string = '0000009B-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Time', CurrentTime.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentTime = CurrentTime; - -/** - * Characteristic "Day of the Week" - */ - -export class DayoftheWeek extends Characteristic { - - static readonly UUID: string = '00000098-0000-1000-8000-0026BB765291'; - - constructor() { - super('Day of the Week', DayoftheWeek.UUID, { - format: Formats.UINT8, - maxValue: 7, - minValue: 1, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.DayoftheWeek = DayoftheWeek; - -/** - * Characteristic "Discover Bridged Accessories" - */ - -export class DiscoverBridgedAccessories extends Characteristic { - - // The value property of DiscoverBridgedAccessories must be one of the following: - static readonly START_DISCOVERY = 0; - static readonly STOP_DISCOVERY = 1; - - static readonly UUID: string = '0000009E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Discover Bridged Accessories', DiscoverBridgedAccessories.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.DiscoverBridgedAccessories = DiscoverBridgedAccessories; - -/** - * Characteristic "Discovered Bridged Accessories" - */ - -export class DiscoveredBridgedAccessories extends Characteristic { - - static readonly UUID: string = '0000009F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Discovered Bridged Accessories', DiscoveredBridgedAccessories.UUID, { - format: Formats.UINT16, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.DiscoveredBridgedAccessories = DiscoveredBridgedAccessories; - -/** - * Characteristic "Link Quality" - */ - -export class LinkQuality extends Characteristic { - - static readonly UUID: string = '0000009C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Link Quality', LinkQuality.UUID, { - format: Formats.UINT8, - maxValue: 4, - minValue: 1, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LinkQuality = LinkQuality; - -/** - * Characteristic "Reachable" - */ - -export class Reachable extends Characteristic { - - static readonly UUID: string = '00000063-0000-1000-8000-0026BB765291'; - - constructor() { - super('Reachable', Reachable.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Reachable = Reachable; - -/** - * Characteristic "Relay Control Point" - */ - -export class RelayControlPoint extends Characteristic { - - static readonly UUID: string = '0000005E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Relay Control Point', RelayControlPoint.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RelayControlPoint = RelayControlPoint; - -/** - * Characteristic "Relay Enabled" - */ - -export class RelayEnabled extends Characteristic { - - static readonly UUID: string = '0000005B-0000-1000-8000-0026BB765291'; - - constructor() { - super('Relay Enabled', RelayEnabled.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RelayEnabled = RelayEnabled; - -/** - * Characteristic "Relay State" - */ - -export class RelayState extends Characteristic { - - static readonly UUID: string = '0000005C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Relay State', RelayState.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RelayState = RelayState; - -/** - * Characteristic "Time Update" - */ - -export class TimeUpdate extends Characteristic { - - static readonly UUID: string = '0000009A-0000-1000-8000-0026BB765291'; - - constructor() { - super('Time Update', TimeUpdate.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TimeUpdate = TimeUpdate; - -/** - * Characteristic "Tunnel Connection Timeout " - */ - -export class TunnelConnectionTimeout extends Characteristic { - - static readonly UUID: string = '00000061-0000-1000-8000-0026BB765291'; - - constructor() { - super('Tunnel Connection Timeout ', TunnelConnectionTimeout.UUID, { - format: Formats.UINT32, - perms: [Perms.PAIRED_WRITE, Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TunnelConnectionTimeout = TunnelConnectionTimeout; - -/** - * Characteristic "Tunneled Accessory Advertising" - */ - -export class TunneledAccessoryAdvertising extends Characteristic { - - static readonly UUID: string = '00000060-0000-1000-8000-0026BB765291'; - - constructor() { - super('Tunneled Accessory Advertising', TunneledAccessoryAdvertising.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_WRITE, Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TunneledAccessoryAdvertising = TunneledAccessoryAdvertising; - -/** - * Characteristic "Tunneled Accessory Connected" - */ - -export class TunneledAccessoryConnected extends Characteristic { - - static readonly UUID: string = '00000059-0000-1000-8000-0026BB765291'; - - constructor() { - super('Tunneled Accessory Connected', TunneledAccessoryConnected.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_WRITE, Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TunneledAccessoryConnected = TunneledAccessoryConnected; - -/** - * Characteristic "Tunneled Accessory State Number" - */ - -export class TunneledAccessoryStateNumber extends Characteristic { - - static readonly UUID: string = '00000058-0000-1000-8000-0026BB765291'; - - constructor() { - super('Tunneled Accessory State Number', TunneledAccessoryStateNumber.UUID, { - format: Formats.FLOAT, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TunneledAccessoryStateNumber = TunneledAccessoryStateNumber; - -/** - * Service "Bridge Configuration" - */ - -export class BridgeConfiguration extends Service { - - static readonly UUID: string = '000000A1-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, BridgeConfiguration.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ConfigureBridgedAccessoryStatus); - this.addCharacteristic(Characteristic.DiscoverBridgedAccessories); - this.addCharacteristic(Characteristic.DiscoveredBridgedAccessories); - this.addCharacteristic(Characteristic.ConfigureBridgedAccessory); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.BridgeConfiguration = BridgeConfiguration; - -/** - * Service "Bridging State" - */ - -export class BridgingState extends Service { - - static readonly UUID: string = '00000062-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, BridgingState.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Reachable); - this.addCharacteristic(Characteristic.LinkQuality); - this.addCharacteristic(Characteristic.AccessoryIdentifier); - this.addCharacteristic(Characteristic.Category); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.BridgingState = BridgingState; - -/** - * Service "Pairing" - */ - -export class Pairing extends Service { - - static readonly UUID: string = '00000055-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, Pairing.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.PairSetup); - this.addCharacteristic(Characteristic.PairVerify); - this.addCharacteristic(Characteristic.PairingFeatures); - this.addCharacteristic(Characteristic.PairingPairings); - - // Optional Characteristics - } -} - -Service.Pairing = Pairing; - -/** - * Service "Protocol Information" - */ - -export class ProtocolInformation extends Service { - - static readonly UUID: string = '000000A2-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, ProtocolInformation.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Version); - - // Optional Characteristics - } -} - -Service.ProtocolInformation = ProtocolInformation; - -/** - * Service "Relay" - */ - -export class Relay extends Service { - - static readonly UUID: string = '0000005A-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, Relay.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.RelayEnabled); - this.addCharacteristic(Characteristic.RelayState); - this.addCharacteristic(Characteristic.RelayControlPoint); - - // Optional Characteristics - } -} - -Service.Relay = Relay; - -/** - * Service "Time Information" - */ - -export class TimeInformation extends Service { - - static readonly UUID: string = '00000099-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, TimeInformation.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentTime); - this.addCharacteristic(Characteristic.DayoftheWeek); - this.addCharacteristic(Characteristic.TimeUpdate); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.TimeInformation = TimeInformation; - -/** - * Service "Tunneled BTLE Accessory Service" - */ - -export class TunneledBTLEAccessoryService extends Service { - - static readonly UUID: string = '00000056-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, TunneledBTLEAccessoryService.UUID, subtype); - - // Required Characteristics - if (!this.testCharacteristic(Characteristic.Name)) { // workaround for name characteristic collision in constructor - this.addCharacteristic(Characteristic.Name); - } - this.addCharacteristic(Characteristic.AccessoryIdentifier); - this.addCharacteristic(Characteristic.TunneledAccessoryStateNumber); - this.addCharacteristic(Characteristic.TunneledAccessoryConnected); - this.addCharacteristic(Characteristic.TunneledAccessoryAdvertising); - this.addCharacteristic(Characteristic.TunnelConnectionTimeout); - - // Optional Characteristics - } -} - -Service.TunneledBTLEAccessoryService = TunneledBTLEAccessoryService; diff --git a/src/lib/gen/HomeKit-DataStream.ts b/src/lib/gen/HomeKit-DataStream.ts deleted file mode 100644 index 0437dc290..000000000 --- a/src/lib/gen/HomeKit-DataStream.ts +++ /dev/null @@ -1,66 +0,0 @@ -// manually created - -import {Characteristic, Formats, Perms} from '../Characteristic'; -import {Service} from "../Service"; - - -/** - * Characteristic "Supported Data Stream Transport Configuration" - */ - -export class SupportedDataStreamTransportConfiguration extends Characteristic { - - static readonly UUID: string = '00000130-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Data Stream Transport Configuration', SupportedDataStreamTransportConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SupportedDataStreamTransportConfiguration = SupportedDataStreamTransportConfiguration; - -/** - * Characteristic "Setup Data Stream Transport" - */ - -export class SetupDataStreamTransport extends Characteristic { - - static readonly UUID: string = '00000131-0000-1000-8000-0026BB765291'; - - constructor() { - super('Setup Data Stream Transport', SetupDataStreamTransport.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE] - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SetupDataStreamTransport = SetupDataStreamTransport; - - -/** - * Service "Data Stream Transport Management" - */ - -export class DataStreamTransportManagement extends Service { - - static readonly UUID: string = '00000129-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, DataStreamTransportManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SupportedDataStreamTransportConfiguration); - this.addCharacteristic(Characteristic.SetupDataStreamTransport); - this.addCharacteristic(Characteristic.Version); - } -} - -Service.DataStreamTransportManagement = DataStreamTransportManagement; diff --git a/src/lib/gen/HomeKit-Remote.ts b/src/lib/gen/HomeKit-Remote.ts deleted file mode 100644 index e6565f05b..000000000 --- a/src/lib/gen/HomeKit-Remote.ts +++ /dev/null @@ -1,190 +0,0 @@ -// manually created - -import { Access, Characteristic, Formats, Perms } from '../Characteristic'; -import { Service } from '../Service'; - - -/** - * Characteristic "Target Control Supported Configuration" - */ - -export class TargetControlSupportedConfiguration extends Characteristic { - - static readonly UUID: string = '00000123-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Control Supported Configuration', TargetControlSupportedConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetControlSupportedConfiguration = TargetControlSupportedConfiguration; - -/** - * Characteristic "Target Control List" - */ - -export class TargetControlList extends Characteristic { - - static readonly UUID: string = '00000124-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Control List', TargetControlList.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_WRITE, Perms.PAIRED_READ, Perms.WRITE_RESPONSE], - adminOnlyAccess: [Access.READ, Access.WRITE], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.TargetControlList = TargetControlList; - -/** - * Characteristic "Button Event" - */ - -export class ButtonEvent extends Characteristic { - - static readonly UUID: string = '00000126-0000-1000-8000-0026BB765291'; - - constructor() { - super('Button Event', ButtonEvent.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY], - adminOnlyAccess: [Access.NOTIFY], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.ButtonEvent = ButtonEvent; - -/** - * Characteristic "Selected Audio Stream Configuration" - */ - -export class SelectedAudioStreamConfiguration extends Characteristic { - - static readonly UUID: string = '00000128-0000-1000-8000-0026BB765291'; - - constructor() { - super('Selected Audio Stream Configuration', SelectedAudioStreamConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SelectedAudioStreamConfiguration = SelectedAudioStreamConfiguration; - -/** - * Characteristic "Siri Input Type" - */ - -export class SiriInputType extends Characteristic { - - static readonly PUSH_BUTTON_TRIGGERED_APPLE_TV = 0; - - static readonly UUID: string = '00000132-0000-1000-8000-0026BB765291'; - - constructor() { - super('Siri Input Type', SiriInputType.UUID, { - format: Formats.UINT8, - minValue: 0, - maxValue: 0, - validValues: [0], - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SiriInputType = SiriInputType; - -/** - * Service "Target Control Management" - */ - -export class TargetControlManagement extends Service { - - static readonly UUID: string = '00000122-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, TargetControlManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.TargetControlSupportedConfiguration); - this.addCharacteristic(Characteristic.TargetControlList); - } -} - -Service.TargetControlManagement = TargetControlManagement; - -/** - * Service "Target Control" - */ - -export class TargetControl extends Service { - - static readonly UUID: string = '00000125-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, TargetControl.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ActiveIdentifier); - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.ButtonEvent); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.TargetControl = TargetControl; - -/** - * Service "Audio Stream Management" - */ - -export class AudioStreamManagement extends Service { - - static readonly UUID: string = '00000127-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, AudioStreamManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SupportedAudioStreamConfiguration); - this.addCharacteristic(Characteristic.SelectedAudioStreamConfiguration); - } -} - -Service.AudioStreamManagement = AudioStreamManagement; - -/** - * Service "Siri" - */ - -export class Siri extends Service { - - static readonly UUID: string = '00000133-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, Siri.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SiriInputType); - } -} - -Service.Siri = Siri; diff --git a/src/lib/gen/HomeKit-TV.ts b/src/lib/gen/HomeKit-TV.ts deleted file mode 100644 index f43f5546a..000000000 --- a/src/lib/gen/HomeKit-TV.ts +++ /dev/null @@ -1,543 +0,0 @@ -// Manually created from metadata in HomeKitDaemon - -import { Characteristic, Perms, Formats } from '../Characteristic'; -import { Service } from '../Service'; - -/** - * Characteristic "Active Identifier" - */ - -export class ActiveIdentifier extends Characteristic { - - static readonly UUID: string = '000000E7-0000-1000-8000-0026BB765291'; - - constructor() { - super('Active Identifier', ActiveIdentifier.UUID, { - format: Formats.UINT32, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ActiveIdentifier = ActiveIdentifier; - -/** - * Characteristic "Configured Name" - */ - -export class ConfiguredName extends Characteristic { - - static readonly UUID: string = '000000E3-0000-1000-8000-0026BB765291'; - - constructor() { - super('Configured Name', ConfiguredName.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ConfiguredName = ConfiguredName; - -/** - * Characteristic "Sleep Discovery Mode" - */ - -export class SleepDiscoveryMode extends Characteristic { - -// The value property of SleepDiscoveryMode must be one of the following: - static readonly NOT_DISCOVERABLE = 0; - static readonly ALWAYS_DISCOVERABLE = 1; - - static readonly UUID: string = '000000E8-0000-1000-8000-0026BB765291'; - - constructor() { - super('Sleep Discovery Mode', SleepDiscoveryMode.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SleepDiscoveryMode = SleepDiscoveryMode; - -/** - * Characteristic "Closed Captions" - */ - -export class ClosedCaptions extends Characteristic { - - // The value property of ClosedCaptions must be one of the following: - static readonly DISABLED = 0; - static readonly ENABLED = 1; - - static readonly UUID: string = '000000DD-0000-1000-8000-0026BB765291'; - - constructor() { - super('Closed Captions', ClosedCaptions.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ClosedCaptions = ClosedCaptions; - -/** - * Characteristic "Display Order" - */ - -export class DisplayOrder extends Characteristic { - - static readonly UUID: string = '00000136-0000-1000-8000-0026BB765291'; - - constructor() { - super('Display Order', DisplayOrder.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.DisplayOrder = DisplayOrder; - -/** - * Characteristic "Current Media State" - */ - -export class CurrentMediaState extends Characteristic { - - static readonly PLAY = 0; - static readonly PAUSE = 1; - static readonly STOP = 2; - // 3 is unknown (maybe some Television specific value) - static readonly LOADING = 4; // seems to be SmartSpeaker specific - static readonly INTERRUPTED = 5; // seems to be SmartSpeaker specific - - static readonly UUID: string = '000000E0-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Media State', CurrentMediaState.UUID, { - format: Formats.UINT8, - maxValue: 5, - minValue: 0, - validValues: [0,1,2,3,4,5], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentMediaState = CurrentMediaState; - -/** - * Characteristic "Target Media State" - */ - -export class TargetMediaState extends Characteristic { - -// The value property of TargetMediaState must be one of the following: - static readonly PLAY = 0; - static readonly PAUSE = 1; - static readonly STOP = 2; - - static readonly UUID: string = '00000137-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Media State', TargetMediaState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0,1,2,3], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetMediaState = TargetMediaState; - -/** - * Characteristic "Picture Mode" - */ - -export class PictureMode extends Characteristic { - -// The value property of PictureMode must be one of the following: - static readonly OTHER = 0; - static readonly STANDARD = 1; - static readonly CALIBRATED = 2; - static readonly CALIBRATED_DARK = 3; - static readonly VIVID = 4; - static readonly GAME = 5; - static readonly COMPUTER = 6; - static readonly CUSTOM = 7; - - static readonly UUID: string = '000000E2-0000-1000-8000-0026BB765291'; - - constructor() { - super('Picture Mode', PictureMode.UUID, { - format: Formats.UINT8, - maxValue: 13, - minValue: 0, - validValues: [0,1,2,3,4,5,6,7,8,9,10,11,12,13], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PictureMode = PictureMode; - -/** - * Characteristic "Power Mode Selection" - */ - -export class PowerModeSelection extends Characteristic { - - // The value property of PowerModeSelection must be one of the following: - static readonly SHOW = 0; - static readonly HIDE = 1; - - static readonly UUID: string = '000000DF-0000-1000-8000-0026BB765291'; - - constructor() { - super('Power Mode Selection', PowerModeSelection.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PowerModeSelection = PowerModeSelection; - -/** - * Characteristic "Remote Key" - */ - -export class RemoteKey extends Characteristic { - -// The value property of RemoteKey must be one of the following: - static readonly REWIND = 0; - static readonly FAST_FORWARD = 1; - static readonly NEXT_TRACK = 2; - static readonly PREVIOUS_TRACK = 3; - static readonly ARROW_UP = 4; - static readonly ARROW_DOWN = 5; - static readonly ARROW_LEFT = 6; - static readonly ARROW_RIGHT = 7; - static readonly SELECT = 8; - static readonly BACK = 9; - static readonly EXIT = 10; - static readonly PLAY_PAUSE = 11; - static readonly INFORMATION = 15; - - static readonly UUID: string = '000000E1-0000-1000-8000-0026BB765291'; - - constructor() { - super('Remote Key', RemoteKey.UUID, { - format: Formats.UINT8, - maxValue: 16, - minValue: 0, - validValues: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RemoteKey = RemoteKey; - -/** - * Characteristic "Input Source Type" - */ - -export class InputSourceType extends Characteristic { - -// The value property of InputSourceType must be one of the following: - static readonly OTHER = 0; - static readonly HOME_SCREEN = 1; - static readonly TUNER = 2; - static readonly HDMI = 3; - static readonly COMPOSITE_VIDEO = 4; - static readonly S_VIDEO = 5; - static readonly COMPONENT_VIDEO = 6; - static readonly DVI = 7; - static readonly AIRPLAY = 8; - static readonly USB = 9; - static readonly APPLICATION = 10; - - static readonly UUID: string = '000000DB-0000-1000-8000-0026BB765291'; - - constructor() { - super('Input Source Type', InputSourceType.UUID, { - format: Formats.UINT8, - maxValue: 10, - minValue: 0, - validValues: [0,1,2,3,4,5,6,7,8,9,10], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.InputSourceType = InputSourceType; - -/** - * Characteristic "Input Device Type" - */ - -export class InputDeviceType extends Characteristic { - - // The value property of InputDeviceType must be one of the following: - static readonly OTHER = 0; - static readonly TV = 1; - static readonly RECORDING = 2; - static readonly TUNER = 3; - static readonly PLAYBACK = 4; - static readonly AUDIO_SYSTEM = 5; - static readonly UNKNOWN_6 = 6; // introduce in iOS 14; "UNKNOWN_6" is not stable API, changes as soon as the type is known - - static readonly UUID: string = '000000DC-0000-1000-8000-0026BB765291'; - - constructor() { - super('Input Device Type', InputDeviceType.UUID, { - format: Formats.UINT8, - maxValue: 6, - minValue: 0, - validValues: [0,1,2,3,4,5], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.InputDeviceType = InputDeviceType; - -/** - * Characteristic "Identifier" - */ - -export class Identifier extends Characteristic { - - static readonly UUID: string = '000000E6-0000-1000-8000-0026BB765291'; - - constructor() { - super('Identifier', Identifier.UUID, { - format: Formats.UINT32, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Identifier = Identifier; - -/** - * Characteristic "Current Visibility State" - */ - -export class CurrentVisibilityState extends Characteristic { - -// The value property of CurrentVisibilityState must be one of the following: - static readonly SHOWN = 0; - static readonly HIDDEN = 1; - - static readonly UUID: string = '00000135-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Visibility State', CurrentVisibilityState.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0,1,2,3], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentVisibilityState = CurrentVisibilityState; - -/** - * Characteristic "Target Visibility State" - */ - -export class TargetVisibilityState extends Characteristic { - -// The value property of TargetVisibilityState must be one of the following: - static readonly SHOWN = 0; - static readonly HIDDEN = 1; - - static readonly UUID: string = '00000134-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Visibility State', TargetVisibilityState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetVisibilityState = TargetVisibilityState; - -/** - * Characteristic "Volume Control Type" - */ - -export class VolumeControlType extends Characteristic { - -// The value property of VolumeControlType must be one of the following: - static readonly NONE = 0; - static readonly RELATIVE = 1; - static readonly RELATIVE_WITH_CURRENT = 2; - static readonly ABSOLUTE = 3; - - static readonly UUID: string = '000000E9-0000-1000-8000-0026BB765291'; - - constructor() { - super('Volume Control Type', VolumeControlType.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0,1,2,3], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.VolumeControlType = VolumeControlType; - -/** - * Characteristic "Volume Selector" - */ - -export class VolumeSelector extends Characteristic { - -// The value property of VolumeSelector must be one of the following: - static readonly INCREMENT = 0; - static readonly DECREMENT = 1; - - static readonly UUID: string = '000000EA-0000-1000-8000-0026BB765291'; - - constructor() { - super('Volume Selector', VolumeSelector.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.VolumeSelector = VolumeSelector; - - -/** - * Service "Television" - */ - -export class Television extends Service { - - static readonly UUID: string = '000000D8-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, Television.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.ActiveIdentifier); - this.addCharacteristic(Characteristic.ConfiguredName); - this.addCharacteristic(Characteristic.RemoteKey); - this.addCharacteristic(Characteristic.SleepDiscoveryMode); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Brightness); - this.addOptionalCharacteristic(Characteristic.ClosedCaptions); - this.addOptionalCharacteristic(Characteristic.DisplayOrder); - this.addOptionalCharacteristic(Characteristic.CurrentMediaState); - this.addOptionalCharacteristic(Characteristic.TargetMediaState); - this.addOptionalCharacteristic(Characteristic.PictureMode); - this.addOptionalCharacteristic(Characteristic.PowerModeSelection); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Television = Television; - -/** - * Service "Input Source" - */ - -export class InputSource extends Service { - - static readonly UUID: string = '000000D9-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, InputSource.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ConfiguredName); - this.addCharacteristic(Characteristic.InputSourceType); - this.addCharacteristic(Characteristic.IsConfigured); - if (!this.testCharacteristic(Characteristic.Name)) { // workaround for name characteristic collision in constructor - this.addCharacteristic(Characteristic.Name).updateValue("Unnamed InputSource"); - } - this.addCharacteristic(Characteristic.CurrentVisibilityState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Identifier); - this.addOptionalCharacteristic(Characteristic.InputDeviceType); - this.addOptionalCharacteristic(Characteristic.TargetVisibilityState); - } -} - -Service.InputSource = InputSource; - -/** - * Service "Television Speaker" - */ - -export class TelevisionSpeaker extends Service { - - static readonly UUID: string = '00000113-0000-1000-8000-0026BB765291'; - - constructor(displayName: string, subtype: string) { - super(displayName, TelevisionSpeaker.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Mute); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Active); - this.addOptionalCharacteristic(Characteristic.Volume); - this.addOptionalCharacteristic(Characteristic.VolumeControlType); - this.addOptionalCharacteristic(Characteristic.VolumeSelector); - } -} - -Service.TelevisionSpeaker = TelevisionSpeaker; diff --git a/src/lib/gen/HomeKit.ts b/src/lib/gen/HomeKit.ts deleted file mode 100644 index 41f50adb8..000000000 --- a/src/lib/gen/HomeKit.ts +++ /dev/null @@ -1,5258 +0,0 @@ -// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY - -import { Characteristic, Formats, Perms, Units } from '../Characteristic'; -import { Service } from '../Service'; - -/** - * Characteristic "Access Control Level" - */ - -export class AccessControlLevel extends Characteristic { - - static readonly UUID: string = '000000E5-0000-1000-8000-0026BB765291'; - - constructor() { - super('Access Control Level', AccessControlLevel.UUID, { - format: Formats.UINT16, - perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], - maxValue: 2, - minValue: 0, - minStep: 1, - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AccessControlLevel = AccessControlLevel; - -/** - * Characteristic "Accessory Flags" - */ - -export class AccessoryFlags extends Characteristic { - - static readonly UUID: string = '000000A6-0000-1000-8000-0026BB765291'; - - constructor() { - super('Accessory Flags', AccessoryFlags.UUID, { - format: Formats.UINT32, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AccessoryFlags = AccessoryFlags; - -/** - * Characteristic "Product Data" - */ - -export class ProductData extends Characteristic { - - static readonly UUID: string = '00000220-0000-1000-8000-0026BB765291'; - - constructor() { - super('Product Data', ProductData.UUID, { - format: Formats.DATA, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ProductData = ProductData; - -/** - * Characteristic "Active" - */ - -export class Active extends Characteristic { - - // The value property of Active must be one of the following: - static readonly INACTIVE = 0; - static readonly ACTIVE = 1; - - static readonly UUID: string = '000000B0-0000-1000-8000-0026BB765291'; - - constructor() { - super('Active', Active.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Active = Active; - -/** - * Characteristic "Administrator Only Access" - */ - -export class AdministratorOnlyAccess extends Characteristic { - - static readonly UUID: string = '00000001-0000-1000-8000-0026BB765291'; - - constructor() { - super('Administrator Only Access', AdministratorOnlyAccess.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AdministratorOnlyAccess = AdministratorOnlyAccess; - -/** - * Characteristic "Air Particulate Density" - */ - -export class AirParticulateDensity extends Characteristic { - - static readonly UUID: string = '00000064-0000-1000-8000-0026BB765291'; - - constructor() { - super('Air Particulate Density', AirParticulateDensity.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AirParticulateDensity = AirParticulateDensity; - -/** - * Characteristic "Air Particulate Size" - */ - -export class AirParticulateSize extends Characteristic { - - // The value property of AirParticulateSize must be one of the following: - static readonly _2_5_M = 0; - static readonly _10_M = 1; - - static readonly UUID: string = '00000065-0000-1000-8000-0026BB765291'; - - constructor() { - super('Air Particulate Size', AirParticulateSize.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AirParticulateSize = AirParticulateSize; - - -/** - * Characteristic "Air Quality" - */ - -export class AirQuality extends Characteristic { - - // The value property of AirQuality must be one of the following: - static readonly UNKNOWN = 0; - static readonly EXCELLENT = 1; - static readonly GOOD = 2; - static readonly FAIR = 3; - static readonly INFERIOR = 4; - static readonly POOR = 5; - - static readonly UUID: string = '00000095-0000-1000-8000-0026BB765291'; - - constructor() { - super('Air Quality', AirQuality.UUID, { - format: Formats.UINT8, - maxValue: 5, - minValue: 0, - validValues: [0, 1, 2, 3, 4, 5], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AirQuality = AirQuality; - - -/** - * Characteristic "Audio Feedback" - */ - -export class AudioFeedback extends Characteristic { - - static readonly UUID: string = '00000005-0000-1000-8000-0026BB765291'; - - constructor() { - super('Audio Feedback', AudioFeedback.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.AudioFeedback = AudioFeedback; - -/** - * Characteristic "Battery Level" - */ - -export class BatteryLevel extends Characteristic { - - static readonly UUID: string = '00000068-0000-1000-8000-0026BB765291'; - - constructor() { - super('Battery Level', BatteryLevel.UUID, { - format: Formats.UINT8, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.BatteryLevel = BatteryLevel; - -/** - * Characteristic "Brightness" - */ - -export class Brightness extends Characteristic { - - static readonly UUID: string = '00000008-0000-1000-8000-0026BB765291'; - - constructor() { - super('Brightness', Brightness.UUID, { - format: Formats.INT, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Brightness = Brightness; - -/** - * Characteristic "Carbon Dioxide Detected" - */ - -export class CarbonDioxideDetected extends Characteristic { - - // The value property of CarbonDioxideDetected must be one of the following: - static readonly CO2_LEVELS_NORMAL = 0; - static readonly CO2_LEVELS_ABNORMAL = 1; - - static readonly UUID: string = '00000092-0000-1000-8000-0026BB765291'; - - constructor() { - super('Carbon Dioxide Detected', CarbonDioxideDetected.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CarbonDioxideDetected = CarbonDioxideDetected; - -/** - * Characteristic "Carbon Dioxide Level" - */ - -export class CarbonDioxideLevel extends Characteristic { - - static readonly UUID: string = '00000093-0000-1000-8000-0026BB765291'; - - constructor() { - super('Carbon Dioxide Level', CarbonDioxideLevel.UUID, { - format: Formats.FLOAT, - maxValue: 100000, - minValue: 0, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CarbonDioxideLevel = CarbonDioxideLevel; - -/** - * Characteristic "Carbon Dioxide Peak Level" - */ - -export class CarbonDioxidePeakLevel extends Characteristic { - - static readonly UUID: string = '00000094-0000-1000-8000-0026BB765291'; - - constructor() { - super('Carbon Dioxide Peak Level', CarbonDioxidePeakLevel.UUID, { - format: Formats.FLOAT, - maxValue: 100000, - minValue: 0, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CarbonDioxidePeakLevel = CarbonDioxidePeakLevel; - -/** - * Characteristic "Carbon Monoxide Detected" - */ - -export class CarbonMonoxideDetected extends Characteristic { - - // The value property of CarbonMonoxideDetected must be one of the following: - static readonly CO_LEVELS_NORMAL = 0; - static readonly CO_LEVELS_ABNORMAL = 1; - - static readonly UUID: string = '00000069-0000-1000-8000-0026BB765291'; - - constructor() { - super('Carbon Monoxide Detected', CarbonMonoxideDetected.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CarbonMonoxideDetected = CarbonMonoxideDetected; - -/** - * Characteristic "Carbon Monoxide Level" - */ - -export class CarbonMonoxideLevel extends Characteristic { - - static readonly UUID: string = '00000090-0000-1000-8000-0026BB765291'; - - constructor() { - super('Carbon Monoxide Level', CarbonMonoxideLevel.UUID, { - format: Formats.FLOAT, - maxValue: 100, - minValue: 0, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CarbonMonoxideLevel = CarbonMonoxideLevel; - -/** - * Characteristic "Carbon Monoxide Peak Level" - */ - -export class CarbonMonoxidePeakLevel extends Characteristic { - - static readonly UUID: string = '00000091-0000-1000-8000-0026BB765291'; - - constructor() { - super('Carbon Monoxide Peak Level', CarbonMonoxidePeakLevel.UUID, { - format: Formats.FLOAT, - maxValue: 100, - minValue: 0, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CarbonMonoxidePeakLevel = CarbonMonoxidePeakLevel; - -/** - * Characteristic "Charging State" - */ - -export class ChargingState extends Characteristic { - - // The value property of ChargingState must be one of the following: - static readonly NOT_CHARGING = 0; - static readonly CHARGING = 1; - static readonly NOT_CHARGEABLE = 2; - - static readonly UUID: string = '0000008F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Charging State', ChargingState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ChargingState = ChargingState; - -/** - * Characteristic "Color Temperature" - */ - -export class ColorTemperature extends Characteristic { - - static readonly UUID: string = '000000CE-0000-1000-8000-0026BB765291'; - - constructor() { - super('Color Temperature', ColorTemperature.UUID, { - format: Formats.UINT32, - maxValue: 500, - minValue: 140, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ColorTemperature = ColorTemperature; - -/** - * Characteristic "Contact Sensor State" - */ - -export class ContactSensorState extends Characteristic { - - // The value property of ContactSensorState must be one of the following: - static readonly CONTACT_DETECTED = 0; - static readonly CONTACT_NOT_DETECTED = 1; - - static readonly UUID: string = '0000006A-0000-1000-8000-0026BB765291'; - - constructor() { - super('Contact Sensor State', ContactSensorState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ContactSensorState = ContactSensorState; - -/** - * Characteristic "Cooling Threshold Temperature" - */ - -export class CoolingThresholdTemperature extends Characteristic { - - static readonly UUID: string = '0000000D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Cooling Threshold Temperature', CoolingThresholdTemperature.UUID, { - format: Formats.FLOAT, - unit: Units.CELSIUS, - maxValue: 35, - minValue: 10, - minStep: 0.1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CoolingThresholdTemperature = CoolingThresholdTemperature; - -/** - * Characteristic "Current Air Purifier State" - */ - -export class CurrentAirPurifierState extends Characteristic { - - // The value property of CurrentAirPurifierState must be one of the following: - static readonly INACTIVE = 0; - static readonly IDLE = 1; - static readonly PURIFYING_AIR = 2; - - static readonly UUID: string = '000000A9-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Air Purifier State', CurrentAirPurifierState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentAirPurifierState = CurrentAirPurifierState; - - -/** - * Characteristic "Current Ambient Light Level" - */ - -export class CurrentAmbientLightLevel extends Characteristic { - - static readonly UUID: string = '0000006B-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Ambient Light Level', CurrentAmbientLightLevel.UUID, { - format: Formats.FLOAT, - unit: Units.LUX, - maxValue: 100000, - minValue: 0.0001, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentAmbientLightLevel = CurrentAmbientLightLevel; - -/** - * Characteristic "Current Door State" - */ - -export class CurrentDoorState extends Characteristic { - - // The value property of CurrentDoorState must be one of the following: - static readonly OPEN = 0; - static readonly CLOSED = 1; - static readonly OPENING = 2; - static readonly CLOSING = 3; - static readonly STOPPED = 4; - - static readonly UUID: string = '0000000E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Door State', CurrentDoorState.UUID, { - format: Formats.UINT8, - maxValue: 4, - minValue: 0, - validValues: [0, 1, 2, 3, 4], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentDoorState = CurrentDoorState; - -/** - * Characteristic "Current Fan State" - */ - -export class CurrentFanState extends Characteristic { - - // The value property of CurrentFanState must be one of the following: - static readonly INACTIVE = 0; - static readonly IDLE = 1; - static readonly BLOWING_AIR = 2; - - static readonly UUID: string = '000000AF-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Fan State', CurrentFanState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentFanState = CurrentFanState; - -/** - * Characteristic "Current Heater Cooler State" - */ - -export class CurrentHeaterCoolerState extends Characteristic { - - // The value property of CurrentHeaterCoolerState must be one of the following: - static readonly INACTIVE = 0; - static readonly IDLE = 1; - static readonly HEATING = 2; - static readonly COOLING = 3; - - static readonly UUID: string = '000000B1-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Heater Cooler State', CurrentHeaterCoolerState.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0, 1, 2, 3], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentHeaterCoolerState = CurrentHeaterCoolerState; - -/** - * Characteristic "Current Heating Cooling State" - */ - -export class CurrentHeatingCoolingState extends Characteristic { - - // The value property of CurrentHeatingCoolingState must be one of the following: - static readonly OFF = 0; - static readonly HEAT = 1; - static readonly COOL = 2; - - static readonly UUID: string = '0000000F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Heating Cooling State', CurrentHeatingCoolingState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentHeatingCoolingState = CurrentHeatingCoolingState; - -/** - * Characteristic "Current Horizontal Tilt Angle" - */ - -export class CurrentHorizontalTiltAngle extends Characteristic { - - static readonly UUID: string = '0000006C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Horizontal Tilt Angle', CurrentHorizontalTiltAngle.UUID, { - format: Formats.INT, - unit: Units.ARC_DEGREE, - maxValue: 90, - minValue: -90, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentHorizontalTiltAngle = CurrentHorizontalTiltAngle; - -/** - * Characteristic "Current Humidifier Dehumidifier State" - */ - -export class CurrentHumidifierDehumidifierState extends Characteristic { - - // The value property of CurrentHumidifierDehumidifierState must be one of the following: - static readonly INACTIVE = 0; - static readonly IDLE = 1; - static readonly HUMIDIFYING = 2; - static readonly DEHUMIDIFYING = 3; - - static readonly UUID: string = '000000B3-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Humidifier Dehumidifier State', CurrentHumidifierDehumidifierState.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0, 1, 2, 3], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentHumidifierDehumidifierState = CurrentHumidifierDehumidifierState; - -/** - * Characteristic "Current Position" - */ - -export class CurrentPosition extends Characteristic { - - static readonly UUID: string = '0000006D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Position', CurrentPosition.UUID, { - format: Formats.UINT8, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentPosition = CurrentPosition; - -/** - * Characteristic "Current Relative Humidity" - */ - -export class CurrentRelativeHumidity extends Characteristic { - - static readonly UUID: string = '00000010-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Relative Humidity', CurrentRelativeHumidity.UUID, { - format: Formats.FLOAT, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentRelativeHumidity = CurrentRelativeHumidity; - -/** - * Characteristic "Current Slat State" - */ - -export class CurrentSlatState extends Characteristic { - - // The value property of CurrentSlatState must be one of the following: - static readonly FIXED = 0; - static readonly JAMMED = 1; - static readonly SWINGING = 2; - - static readonly UUID: string = '000000AA-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Slat State', CurrentSlatState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentSlatState = CurrentSlatState; - -/** - * Characteristic "Current Temperature" - */ - -export class CurrentTemperature extends Characteristic { - - static readonly UUID: string = '00000011-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Temperature', CurrentTemperature.UUID, { - format: Formats.FLOAT, - unit: Units.CELSIUS, - maxValue: 100, - minValue: 0, - minStep: 0.1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentTemperature = CurrentTemperature; - -/** - * Characteristic "Current Tilt Angle" - */ - -export class CurrentTiltAngle extends Characteristic { - - static readonly UUID: string = '000000C1-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Tilt Angle', CurrentTiltAngle.UUID, { - format: Formats.INT, - unit: Units.ARC_DEGREE, - maxValue: 90, - minValue: -90, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentTiltAngle = CurrentTiltAngle; - -/** - * Characteristic "Current Vertical Tilt Angle" - */ - -export class CurrentVerticalTiltAngle extends Characteristic { - - static readonly UUID: string = '0000006E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Current Vertical Tilt Angle', CurrentVerticalTiltAngle.UUID, { - format: Formats.INT, - unit: Units.ARC_DEGREE, - maxValue: 90, - minValue: -90, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CurrentVerticalTiltAngle = CurrentVerticalTiltAngle; - -/** - * Characteristic "Digital Zoom" - */ - -export class DigitalZoom extends Characteristic { - - static readonly UUID: string = '0000011D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Digital Zoom', DigitalZoom.UUID, { - format: Formats.FLOAT, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.DigitalZoom = DigitalZoom; - -/** - * Characteristic "Filter Change Indication" - */ - -export class FilterChangeIndication extends Characteristic { - - // The value property of FilterChangeIndication must be one of the following: - static readonly FILTER_OK = 0; - static readonly CHANGE_FILTER = 1; - - static readonly UUID: string = '000000AC-0000-1000-8000-0026BB765291'; - - constructor() { - super('Filter Change Indication', FilterChangeIndication.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.FilterChangeIndication = FilterChangeIndication; - -/** - * Characteristic "Filter Life Level" - */ - -export class FilterLifeLevel extends Characteristic { - - static readonly UUID: string = '000000AB-0000-1000-8000-0026BB765291'; - - constructor() { - super('Filter Life Level', FilterLifeLevel.UUID, { - format: Formats.FLOAT, - maxValue: 100, - minValue: 0, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.FilterLifeLevel = FilterLifeLevel; - -/** - * Characteristic "Firmware Revision" - */ - -export class FirmwareRevision extends Characteristic { - - static readonly UUID: string = '00000052-0000-1000-8000-0026BB765291'; - - constructor() { - super('Firmware Revision', FirmwareRevision.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.FirmwareRevision = FirmwareRevision; - -/** - * Characteristic "Hardware Revision" - */ - -export class HardwareRevision extends Characteristic { - - static readonly UUID: string = '00000053-0000-1000-8000-0026BB765291'; - - constructor() { - super('Hardware Revision', HardwareRevision.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.HardwareRevision = HardwareRevision; - -/** - * Characteristic "Heating Threshold Temperature" - */ - -export class HeatingThresholdTemperature extends Characteristic { - - static readonly UUID: string = '00000012-0000-1000-8000-0026BB765291'; - - constructor() { - super('Heating Threshold Temperature', HeatingThresholdTemperature.UUID, { - format: Formats.FLOAT, - unit: Units.CELSIUS, - maxValue: 25, - minValue: 0, - minStep: 0.1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.HeatingThresholdTemperature = HeatingThresholdTemperature; - -/** - * Characteristic "Hold Position" - */ - -export class HoldPosition extends Characteristic { - - static readonly UUID: string = '0000006F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Hold Position', HoldPosition.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.HoldPosition = HoldPosition; - -/** - * Characteristic "Hue" - */ - -export class Hue extends Characteristic { - - static readonly UUID: string = '00000013-0000-1000-8000-0026BB765291'; - - constructor() { - super('Hue', Hue.UUID, { - format: Formats.FLOAT, - unit: Units.ARC_DEGREE, - maxValue: 360, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Hue = Hue; - -/** - * Characteristic "Identify" - */ - -export class Identify extends Characteristic { - - static readonly UUID: string = '00000014-0000-1000-8000-0026BB765291'; - - constructor() { - super('Identify', Identify.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Identify = Identify; - -/** - * Characteristic "Image Mirroring" - */ - -export class ImageMirroring extends Characteristic { - - static readonly UUID: string = '0000011F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Image Mirroring', ImageMirroring.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ImageMirroring = ImageMirroring; - -/** - * Characteristic "Image Rotation" - */ - -export class ImageRotation extends Characteristic { - - static readonly UUID: string = '0000011E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Image Rotation', ImageRotation.UUID, { - format: Formats.FLOAT, - unit: Units.ARC_DEGREE, - maxValue: 270, - minValue: 0, - minStep: 90, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ImageRotation = ImageRotation; - -/** - * Characteristic "In Use" - */ - -export class InUse extends Characteristic { - - // The value property of InUse must be one of the following: - static readonly NOT_IN_USE = 0; - static readonly IN_USE = 1; - - static readonly UUID: string = '000000D2-0000-1000-8000-0026BB765291'; - - constructor() { - super('In Use', InUse.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.InUse = InUse; - -/** - * Characteristic "Is Configured" - */ - -export class IsConfigured extends Characteristic { - - // The value property of IsConfigured must be one of the following: - static readonly NOT_CONFIGURED = 0; - static readonly CONFIGURED = 1; - - static readonly UUID: string = '000000D6-0000-1000-8000-0026BB765291'; - - constructor() { - super('Is Configured', IsConfigured.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.IsConfigured = IsConfigured; - -/** - * Characteristic "Leak Detected" - */ - -export class LeakDetected extends Characteristic { - - // The value property of LeakDetected must be one of the following: - static readonly LEAK_NOT_DETECTED = 0; - static readonly LEAK_DETECTED = 1; - - static readonly UUID: string = '00000070-0000-1000-8000-0026BB765291'; - - constructor() { - super('Leak Detected', LeakDetected.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LeakDetected = LeakDetected; - -/** - * Characteristic "Lock Control Point" - */ - -export class LockControlPoint extends Characteristic { - - static readonly UUID: string = '00000019-0000-1000-8000-0026BB765291'; - - constructor() { - super('Lock Control Point', LockControlPoint.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LockControlPoint = LockControlPoint; - -/** - * Characteristic "Lock Current State" - */ - -export class LockCurrentState extends Characteristic { - - // The value property of LockCurrentState must be one of the following: - static readonly UNSECURED = 0; - static readonly SECURED = 1; - static readonly JAMMED = 2; - static readonly UNKNOWN = 3; - - static readonly UUID: string = '0000001D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Lock Current State', LockCurrentState.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0, 1, 2, 3], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LockCurrentState = LockCurrentState; - -/** - * Characteristic "Lock Last Known Action" - */ - -export class LockLastKnownAction extends Characteristic { - - // The value property of LockLastKnownAction must be one of the following: - static readonly SECURED_PHYSICALLY_INTERIOR = 0; - static readonly UNSECURED_PHYSICALLY_INTERIOR = 1; - static readonly SECURED_PHYSICALLY_EXTERIOR = 2; - static readonly UNSECURED_PHYSICALLY_EXTERIOR = 3; - static readonly SECURED_BY_KEYPAD = 4; - static readonly UNSECURED_BY_KEYPAD = 5; - static readonly SECURED_REMOTELY = 6; - static readonly UNSECURED_REMOTELY = 7; - static readonly SECURED_BY_AUTO_SECURE_TIMEOUT = 8; - - static readonly UUID: string = '0000001C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Lock Last Known Action', LockLastKnownAction.UUID, { - format: Formats.UINT8, - maxValue: 8, - minValue: 0, - validValues: [0, 1, 2, 3, 4, 5, 6, 7, 8], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LockLastKnownAction = LockLastKnownAction; - -/** - * Characteristic "Lock Management Auto Security Timeout" - */ - -export class LockManagementAutoSecurityTimeout extends Characteristic { - - static readonly UUID: string = '0000001A-0000-1000-8000-0026BB765291'; - - constructor() { - super('Lock Management Auto Security Timeout', LockManagementAutoSecurityTimeout.UUID, { - format: Formats.UINT32, - unit: Units.SECONDS, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LockManagementAutoSecurityTimeout = LockManagementAutoSecurityTimeout; - -/** - * Characteristic "Lock Physical Controls" - */ - -export class LockPhysicalControls extends Characteristic { - - // The value property of LockPhysicalControls must be one of the following: - static readonly CONTROL_LOCK_DISABLED = 0; - static readonly CONTROL_LOCK_ENABLED = 1; - - static readonly UUID: string = '000000A7-0000-1000-8000-0026BB765291'; - - constructor() { - super('Lock Physical Controls', LockPhysicalControls.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LockPhysicalControls = LockPhysicalControls; - -/** - * Characteristic "Lock Target State" - */ - -export class LockTargetState extends Characteristic { - - // The value property of LockTargetState must be one of the following: - static readonly UNSECURED = 0; - static readonly SECURED = 1; - - static readonly UUID: string = '0000001E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Lock Target State', LockTargetState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.LockTargetState = LockTargetState; - -/** - * Characteristic "Logs" - */ - -export class Logs extends Characteristic { - - static readonly UUID: string = '0000001F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Logs', Logs.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Logs = Logs; - -/** - * Characteristic "Manufacturer" - */ - -export class Manufacturer extends Characteristic { - - static readonly UUID: string = '00000020-0000-1000-8000-0026BB765291'; - - constructor() { - super('Manufacturer', Manufacturer.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Manufacturer = Manufacturer; - -/** - * Characteristic "Model" - */ - -export class Model extends Characteristic { - - static readonly UUID: string = '00000021-0000-1000-8000-0026BB765291'; - - constructor() { - super('Model', Model.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Model = Model; - -/** - * Characteristic "Motion Detected" - */ - -export class MotionDetected extends Characteristic { - - static readonly UUID: string = '00000022-0000-1000-8000-0026BB765291'; - - constructor() { - super('Motion Detected', MotionDetected.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.MotionDetected = MotionDetected; - -/** - * Characteristic "Mute" - */ - -export class Mute extends Characteristic { - - static readonly UUID: string = '0000011A-0000-1000-8000-0026BB765291'; - - constructor() { - super('Mute', Mute.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Mute = Mute; - -/** - * Characteristic "Name" - */ - -export class Name extends Characteristic { - - static readonly UUID: string = '00000023-0000-1000-8000-0026BB765291'; - - constructor() { - super('Name', Name.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Name = Name; - -/** - * Characteristic "Night Vision" - */ - -export class NightVision extends Characteristic { - - static readonly UUID: string = '0000011B-0000-1000-8000-0026BB765291'; - - constructor() { - super('Night Vision', NightVision.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.NightVision = NightVision; - -/** - * Characteristic "Nitrogen Dioxide Density" - */ - -export class NitrogenDioxideDensity extends Characteristic { - - static readonly UUID: string = '000000C4-0000-1000-8000-0026BB765291'; - - constructor() { - super('Nitrogen Dioxide Density', NitrogenDioxideDensity.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.NitrogenDioxideDensity = NitrogenDioxideDensity; - -/** - * Characteristic "Obstruction Detected" - */ - -export class ObstructionDetected extends Characteristic { - - static readonly UUID: string = '00000024-0000-1000-8000-0026BB765291'; - - constructor() { - super('Obstruction Detected', ObstructionDetected.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ObstructionDetected = ObstructionDetected; - -/** - * Characteristic "Occupancy Detected" - */ - -export class OccupancyDetected extends Characteristic { - - // The value property of OccupancyDetected must be one of the following: - static readonly OCCUPANCY_NOT_DETECTED = 0; - static readonly OCCUPANCY_DETECTED = 1; - - static readonly UUID: string = '00000071-0000-1000-8000-0026BB765291'; - - constructor() { - super('Occupancy Detected', OccupancyDetected.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.OccupancyDetected = OccupancyDetected; - -/** - * Characteristic "On" - */ - -export class On extends Characteristic { - - static readonly UUID: string = '00000025-0000-1000-8000-0026BB765291'; - - constructor() { - super('On', On.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.On = On; - -/** - * Characteristic "Optical Zoom" - */ - -export class OpticalZoom extends Characteristic { - - static readonly UUID: string = '0000011C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Optical Zoom', OpticalZoom.UUID, { - format: Formats.FLOAT, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.OpticalZoom = OpticalZoom; - -/** - * Characteristic "Outlet In Use" - */ - -export class OutletInUse extends Characteristic { - - static readonly UUID: string = '00000026-0000-1000-8000-0026BB765291'; - - constructor() { - super('Outlet In Use', OutletInUse.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.OutletInUse = OutletInUse; - -/** - * Characteristic "Ozone Density" - */ - -export class OzoneDensity extends Characteristic { - - static readonly UUID: string = '000000C3-0000-1000-8000-0026BB765291'; - - constructor() { - super('Ozone Density', OzoneDensity.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.OzoneDensity = OzoneDensity; - -/** - * Characteristic "Pair Setup" - */ - -export class PairSetup extends Characteristic { - - static readonly UUID: string = '0000004C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Pair Setup', PairSetup.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PairSetup = PairSetup; - -/** - * Characteristic "Pair Verify" - */ - -export class PairVerify extends Characteristic { - - static readonly UUID: string = '0000004E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Pair Verify', PairVerify.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PairVerify = PairVerify; - -/** - * Characteristic "Pairing Features" - */ - -export class PairingFeatures extends Characteristic { - - static readonly UUID: string = '0000004F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Pairing Features', PairingFeatures.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PairingFeatures = PairingFeatures; - -/** - * Characteristic "Pairing Pairings" - */ - -export class PairingPairings extends Characteristic { - - static readonly UUID: string = '00000050-0000-1000-8000-0026BB765291'; - - constructor() { - super('Pairing Pairings', PairingPairings.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PairingPairings = PairingPairings; - -/** - * Characteristic "Password Setting" - */ - -export class PasswordSetting extends Characteristic { - - static readonly UUID: string = '000000E4-0000-1000-8000-0026BB765291'; - - constructor() { - super('Password Setting', PasswordSetting.UUID, { - format: Formats.TLV8, - perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE], - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PasswordSetting = PasswordSetting; - -/** - * Characteristic "PM10 Density" - */ - -export class PM10Density extends Characteristic { - - static readonly UUID: string = '000000C7-0000-1000-8000-0026BB765291'; - - constructor() { - super('PM10 Density', PM10Density.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PM10Density = PM10Density; - -/** - * Characteristic "PM2.5 Density" - */ - -export class PM2_5Density extends Characteristic { - - static readonly UUID: string = '000000C6-0000-1000-8000-0026BB765291'; - - constructor() { - super('PM2.5 Density', PM2_5Density.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PM2_5Density = PM2_5Density; - -/** - * Characteristic "Position State" - */ - -export class PositionState extends Characteristic { - - // The value property of PositionState must be one of the following: - static readonly DECREASING = 0; - static readonly INCREASING = 1; - static readonly STOPPED = 2; - - static readonly UUID: string = '00000072-0000-1000-8000-0026BB765291'; - - constructor() { - super('Position State', PositionState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PositionState = PositionState; - -/** - * Characteristic "Program Mode" - */ - -export class ProgramMode extends Characteristic { - - // The value property of ProgramMode must be one of the following: - static readonly NO_PROGRAM_SCHEDULED = 0; - static readonly PROGRAM_SCHEDULED = 1; - static readonly PROGRAM_SCHEDULED_MANUAL_MODE_ = 2; - - static readonly UUID: string = '000000D1-0000-1000-8000-0026BB765291'; - - constructor() { - super('Program Mode', ProgramMode.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ProgramMode = ProgramMode; - -/** - * Characteristic "Programmable Switch Event" - */ - -export class ProgrammableSwitchEvent extends Characteristic { - - // The value property of ProgrammableSwitchEvent must be one of the following: - static readonly SINGLE_PRESS = 0; - static readonly DOUBLE_PRESS = 1; - static readonly LONG_PRESS = 2; - - static readonly UUID: string = '00000073-0000-1000-8000-0026BB765291'; - - constructor() { - super('Programmable Switch Event', ProgrammableSwitchEvent.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ProgrammableSwitchEvent = ProgrammableSwitchEvent; - -/** - * Characteristic "Relative Humidity Dehumidifier Threshold" - */ - -export class RelativeHumidityDehumidifierThreshold extends Characteristic { - - static readonly UUID: string = '000000C9-0000-1000-8000-0026BB765291'; - - constructor() { - super('Relative Humidity Dehumidifier Threshold', RelativeHumidityDehumidifierThreshold.UUID, { - format: Formats.FLOAT, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RelativeHumidityDehumidifierThreshold = RelativeHumidityDehumidifierThreshold; - -/** - * Characteristic "Relative Humidity Humidifier Threshold" - */ - -export class RelativeHumidityHumidifierThreshold extends Characteristic { - - static readonly UUID: string = '000000CA-0000-1000-8000-0026BB765291'; - - constructor() { - super('Relative Humidity Humidifier Threshold', RelativeHumidityHumidifierThreshold.UUID, { - format: Formats.FLOAT, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RelativeHumidityHumidifierThreshold = RelativeHumidityHumidifierThreshold; - -/** - * Characteristic "Remaining Duration" - */ - -export class RemainingDuration extends Characteristic { - - static readonly UUID: string = '000000D4-0000-1000-8000-0026BB765291'; - - constructor() { - super('Remaining Duration', RemainingDuration.UUID, { - format: Formats.UINT32, - maxValue: 3600, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RemainingDuration = RemainingDuration; - -/** - * Characteristic "Reset Filter Indication" - */ - -export class ResetFilterIndication extends Characteristic { - - static readonly UUID: string = '000000AD-0000-1000-8000-0026BB765291'; - - constructor() { - super('Reset Filter Indication', ResetFilterIndication.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 1, - minStep: 1, - perms: [Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ResetFilterIndication = ResetFilterIndication; - -/** - * Characteristic "Rotation Direction" - */ - -export class RotationDirection extends Characteristic { - - // The value property of RotationDirection must be one of the following: - static readonly CLOCKWISE = 0; - static readonly COUNTER_CLOCKWISE = 1; - - static readonly UUID: string = '00000028-0000-1000-8000-0026BB765291'; - - constructor() { - super('Rotation Direction', RotationDirection.UUID, { - format: Formats.INT, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RotationDirection = RotationDirection; - -/** - * Characteristic "Rotation Speed" - */ - -export class RotationSpeed extends Characteristic { - - static readonly UUID: string = '00000029-0000-1000-8000-0026BB765291'; - - constructor() { - super('Rotation Speed', RotationSpeed.UUID, { - format: Formats.FLOAT, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RotationSpeed = RotationSpeed; - -/** - * Characteristic "Saturation" - */ - -export class Saturation extends Characteristic { - - static readonly UUID: string = '0000002F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Saturation', Saturation.UUID, { - format: Formats.FLOAT, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Saturation = Saturation; - -/** - * Characteristic "Security System Alarm Type" - */ - -export class SecuritySystemAlarmType extends Characteristic { - - static readonly UUID: string = '0000008E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Security System Alarm Type', SecuritySystemAlarmType.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SecuritySystemAlarmType = SecuritySystemAlarmType; - -/** - * Characteristic "Security System Current State" - */ - -export class SecuritySystemCurrentState extends Characteristic { - - // The value property of SecuritySystemCurrentState must be one of the following: - static readonly STAY_ARM = 0; - static readonly AWAY_ARM = 1; - static readonly NIGHT_ARM = 2; - static readonly DISARMED = 3; - static readonly ALARM_TRIGGERED = 4; - - static readonly UUID: string = '00000066-0000-1000-8000-0026BB765291'; - - constructor() { - super('Security System Current State', SecuritySystemCurrentState.UUID, { - format: Formats.UINT8, - maxValue: 4, - minValue: 0, - validValues: [0, 1, 2, 3, 4], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SecuritySystemCurrentState = SecuritySystemCurrentState; - -/** - * Characteristic "Security System Target State" - */ - -export class SecuritySystemTargetState extends Characteristic { - - // The value property of SecuritySystemTargetState must be one of the following: - static readonly STAY_ARM = 0; - static readonly AWAY_ARM = 1; - static readonly NIGHT_ARM = 2; - static readonly DISARM = 3; - - static readonly UUID: string = '00000067-0000-1000-8000-0026BB765291'; - - constructor() { - super('Security System Target State', SecuritySystemTargetState.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0, 1, 2, 3], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SecuritySystemTargetState = SecuritySystemTargetState; - -/** - * Characteristic "Selected RTP Stream Configuration" - */ - -export class SelectedRTPStreamConfiguration extends Characteristic { - - static readonly UUID: string = '00000117-0000-1000-8000-0026BB765291'; - - constructor() { - super('Selected RTP Stream Configuration', SelectedRTPStreamConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SelectedRTPStreamConfiguration = SelectedRTPStreamConfiguration; - -/** - * Characteristic "Serial Number" - */ - -export class SerialNumber extends Characteristic { - - static readonly UUID: string = '00000030-0000-1000-8000-0026BB765291'; - - constructor() { - super('Serial Number', SerialNumber.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SerialNumber = SerialNumber; - -/** - * Characteristic "Service Label Index" - */ - -export class ServiceLabelIndex extends Characteristic { - - static readonly UUID: string = '000000CB-0000-1000-8000-0026BB765291'; - - constructor() { - super('Service Label Index', ServiceLabelIndex.UUID, { - format: Formats.UINT8, - maxValue: 255, - minValue: 1, - minStep: 1, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ServiceLabelIndex = ServiceLabelIndex; - -/** - * Characteristic "Service Label Namespace" - */ - -export class ServiceLabelNamespace extends Characteristic { - - // The value property of ServiceLabelNamespace must be one of the following: - static readonly DOTS = 0; - static readonly ARABIC_NUMERALS = 1; - - static readonly UUID: string = '000000CD-0000-1000-8000-0026BB765291'; - - constructor() { - super('Service Label Namespace', ServiceLabelNamespace.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ServiceLabelNamespace = ServiceLabelNamespace; - -/** - * Characteristic "Set Duration" - */ - -export class SetDuration extends Characteristic { - - static readonly UUID: string = '000000D3-0000-1000-8000-0026BB765291'; - - constructor() { - super('Set Duration', SetDuration.UUID, { - format: Formats.UINT32, - maxValue: 3600, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SetDuration = SetDuration; - -/** - * Characteristic "Setup Endpoints" - */ - -export class SetupEndpoints extends Characteristic { - - static readonly UUID: string = '00000118-0000-1000-8000-0026BB765291'; - - constructor() { - super('Setup Endpoints', SetupEndpoints.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SetupEndpoints = SetupEndpoints; - -/** - * Characteristic "Slat Type" - */ - -export class SlatType extends Characteristic { - - // The value property of SlatType must be one of the following: - static readonly HORIZONTAL = 0; - static readonly VERTICAL = 1; - - static readonly UUID: string = '000000C0-0000-1000-8000-0026BB765291'; - - constructor() { - super('Slat Type', SlatType.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SlatType = SlatType; - -/** - * Characteristic "Smoke Detected" - */ - -export class SmokeDetected extends Characteristic { - - // The value property of SmokeDetected must be one of the following: - static readonly SMOKE_NOT_DETECTED = 0; - static readonly SMOKE_DETECTED = 1; - - static readonly UUID: string = '00000076-0000-1000-8000-0026BB765291'; - - constructor() { - super('Smoke Detected', SmokeDetected.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SmokeDetected = SmokeDetected; - -/** - * Characteristic "Status Active" - */ - -export class StatusActive extends Characteristic { - - static readonly UUID: string = '00000075-0000-1000-8000-0026BB765291'; - - constructor() { - super('Status Active', StatusActive.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.StatusActive = StatusActive; - -/** - * Characteristic "Status Fault" - */ - -export class StatusFault extends Characteristic { - - // The value property of StatusFault must be one of the following: - static readonly NO_FAULT = 0; - static readonly GENERAL_FAULT = 1; - - static readonly UUID: string = '00000077-0000-1000-8000-0026BB765291'; - - constructor() { - super('Status Fault', StatusFault.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.StatusFault = StatusFault; - -/** - * Characteristic "Status Jammed" - */ - -export class StatusJammed extends Characteristic { - - // The value property of StatusJammed must be one of the following: - static readonly NOT_JAMMED = 0; - static readonly JAMMED = 1; - - static readonly UUID: string = '00000078-0000-1000-8000-0026BB765291'; - - constructor() { - super('Status Jammed', StatusJammed.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.StatusJammed = StatusJammed; - -/** - * Characteristic "Status Low Battery" - */ - -export class StatusLowBattery extends Characteristic { - - // The value property of StatusLowBattery must be one of the following: - static readonly BATTERY_LEVEL_NORMAL = 0; - static readonly BATTERY_LEVEL_LOW = 1; - - static readonly UUID: string = '00000079-0000-1000-8000-0026BB765291'; - - constructor() { - super('Status Low Battery', StatusLowBattery.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.StatusLowBattery = StatusLowBattery; - - -/** - * Characteristic "Status Tampered" - */ - -export class StatusTampered extends Characteristic { - - // The value property of StatusTampered must be one of the following: - static readonly NOT_TAMPERED = 0; - static readonly TAMPERED = 1; - - static readonly UUID: string = '0000007A-0000-1000-8000-0026BB765291'; - - constructor() { - super('Status Tampered', StatusTampered.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.StatusTampered = StatusTampered; - -/** - * Characteristic "Streaming Status" - */ - -export class StreamingStatus extends Characteristic { - - static readonly UUID: string = '00000120-0000-1000-8000-0026BB765291'; - - constructor() { - super('Streaming Status', StreamingStatus.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.StreamingStatus = StreamingStatus; - -/** - * Characteristic "Sulphur Dioxide Density" - */ - -export class SulphurDioxideDensity extends Characteristic { - - static readonly UUID: string = '000000C5-0000-1000-8000-0026BB765291'; - - constructor() { - super('Sulphur Dioxide Density', SulphurDioxideDensity.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SulphurDioxideDensity = SulphurDioxideDensity; - -/** - * Characteristic "Supported Audio Stream Configuration" - */ - -export class SupportedAudioStreamConfiguration extends Characteristic { - - static readonly UUID: string = '00000115-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Audio Stream Configuration', SupportedAudioStreamConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedAudioStreamConfiguration = SupportedAudioStreamConfiguration; - -/** - * Characteristic "Supported RTP Configuration" - */ - -export class SupportedRTPConfiguration extends Characteristic { - - static readonly UUID: string = '00000116-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported RTP Configuration', SupportedRTPConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedRTPConfiguration = SupportedRTPConfiguration; - -/** - * Characteristic "Supported Video Stream Configuration" - */ - -export class SupportedVideoStreamConfiguration extends Characteristic { - - static readonly UUID: string = '00000114-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Video Stream Configuration', SupportedVideoStreamConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedVideoStreamConfiguration = SupportedVideoStreamConfiguration; - -/** - * Characteristic "Swing Mode" - */ - -export class SwingMode extends Characteristic { - - // The value property of SwingMode must be one of the following: - static readonly SWING_DISABLED = 0; - static readonly SWING_ENABLED = 1; - - static readonly UUID: string = '000000B6-0000-1000-8000-0026BB765291'; - - constructor() { - super('Swing Mode', SwingMode.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SwingMode = SwingMode; - -/** - * Characteristic "Target Air Purifier State" - */ - -export class TargetAirPurifierState extends Characteristic { - - // The value property of TargetAirPurifierState must be one of the following: - static readonly MANUAL = 0; - static readonly AUTO = 1; - - static readonly UUID: string = '000000A8-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Air Purifier State', TargetAirPurifierState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetAirPurifierState = TargetAirPurifierState; - -/** - * Characteristic "Target Air Quality" - */ - -export class TargetAirQuality extends Characteristic { - - // The value property of TargetAirQuality must be one of the following: - static readonly EXCELLENT = 0; - static readonly GOOD = 1; - static readonly FAIR = 2; - - static readonly UUID: string = '000000AE-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Air Quality', TargetAirQuality.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetAirQuality = TargetAirQuality; - -/** - * Characteristic "Target Door State" - */ - -export class TargetDoorState extends Characteristic { - - // The value property of TargetDoorState must be one of the following: - static readonly OPEN = 0; - static readonly CLOSED = 1; - - static readonly UUID: string = '00000032-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Door State', TargetDoorState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetDoorState = TargetDoorState; - -/** - * Characteristic "Target Fan State" - */ - -export class TargetFanState extends Characteristic { - - // The value property of TargetFanState must be one of the following: - static readonly MANUAL = 0; - static readonly AUTO = 1; - - static readonly UUID: string = '000000BF-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Fan State', TargetFanState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetFanState = TargetFanState; - -/** - * Characteristic "Target Heater Cooler State" - */ - -export class TargetHeaterCoolerState extends Characteristic { - - // The value property of TargetHeaterCoolerState must be one of the following: - static readonly AUTO = 0; - static readonly HEAT = 1; - static readonly COOL = 2; - - static readonly UUID: string = '000000B2-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Heater Cooler State', TargetHeaterCoolerState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetHeaterCoolerState = TargetHeaterCoolerState; - -/** - * Characteristic "Target Heating Cooling State" - */ - -export class TargetHeatingCoolingState extends Characteristic { - - // The value property of TargetHeatingCoolingState must be one of the following: - static readonly OFF = 0; - static readonly HEAT = 1; - static readonly COOL = 2; - static readonly AUTO = 3; - - static readonly UUID: string = '00000033-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Heating Cooling State', TargetHeatingCoolingState.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0, 1, 2, 3], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetHeatingCoolingState = TargetHeatingCoolingState; - -/** - * Characteristic "Target Horizontal Tilt Angle" - */ - -export class TargetHorizontalTiltAngle extends Characteristic { - - static readonly UUID: string = '0000007B-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Horizontal Tilt Angle', TargetHorizontalTiltAngle.UUID, { - format: Formats.INT, - unit: Units.ARC_DEGREE, - maxValue: 90, - minValue: -90, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetHorizontalTiltAngle = TargetHorizontalTiltAngle; - -/** - * Characteristic "Target Humidifier Dehumidifier State" - */ - -export class TargetHumidifierDehumidifierState extends Characteristic { - - /** - * @deprecated Removed in iOS 11. Use HUMIDIFIER_OR_DEHUMIDIFIER instead. - */ - static readonly AUTO = 0; - - // The value property of TargetHumidifierDehumidifierState must be one of the following: - static readonly HUMIDIFIER_OR_DEHUMIDIFIER = 0; - static readonly HUMIDIFIER = 1; - static readonly DEHUMIDIFIER = 2; - - static readonly UUID: string = '000000B4-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Humidifier Dehumidifier State', TargetHumidifierDehumidifierState.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0, 1, 2], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetHumidifierDehumidifierState = TargetHumidifierDehumidifierState; - -/** - * Characteristic "Target Position" - */ - -export class TargetPosition extends Characteristic { - - static readonly UUID: string = '0000007C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Position', TargetPosition.UUID, { - format: Formats.UINT8, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetPosition = TargetPosition; - -/** - * Characteristic "Target Relative Humidity" - */ - -export class TargetRelativeHumidity extends Characteristic { - - static readonly UUID: string = '00000034-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Relative Humidity', TargetRelativeHumidity.UUID, { - format: Formats.FLOAT, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetRelativeHumidity = TargetRelativeHumidity; - -/** - * Characteristic "Target Slat State" - */ - -export class TargetSlatState extends Characteristic { - - // The value property of TargetSlatState must be one of the following: - static readonly MANUAL = 0; - static readonly AUTO = 1; - - static readonly UUID: string = '000000BE-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Slat State', TargetSlatState.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetSlatState = TargetSlatState; - -/** - * Characteristic "Target Temperature" - */ - -export class TargetTemperature extends Characteristic { - - static readonly UUID: string = '00000035-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Temperature', TargetTemperature.UUID, { - format: Formats.FLOAT, - unit: Units.CELSIUS, - maxValue: 38, - minValue: 10, - minStep: 0.1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetTemperature = TargetTemperature; - -/** - * Characteristic "Target Tilt Angle" - */ - -export class TargetTiltAngle extends Characteristic { - - static readonly UUID: string = '000000C2-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Tilt Angle', TargetTiltAngle.UUID, { - format: Formats.INT, - unit: Units.ARC_DEGREE, - maxValue: 90, - minValue: -90, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetTiltAngle = TargetTiltAngle; - -/** - * Characteristic "Target Vertical Tilt Angle" - */ - -export class TargetVerticalTiltAngle extends Characteristic { - - static readonly UUID: string = '0000007D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Target Vertical Tilt Angle', TargetVerticalTiltAngle.UUID, { - format: Formats.INT, - unit: Units.ARC_DEGREE, - maxValue: 90, - minValue: -90, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TargetVerticalTiltAngle = TargetVerticalTiltAngle; - -/** - * Characteristic "Temperature Display Units" - */ - -export class TemperatureDisplayUnits extends Characteristic { - - // The value property of TemperatureDisplayUnits must be one of the following: - static readonly CELSIUS = 0; - static readonly FAHRENHEIT = 1; - - static readonly UUID: string = '00000036-0000-1000-8000-0026BB765291'; - - constructor() { - super('Temperature Display Units', TemperatureDisplayUnits.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0, 1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.TemperatureDisplayUnits = TemperatureDisplayUnits; - -/** - * Characteristic "Valve Type" - */ - -export class ValveType extends Characteristic { - - // The value property of ValveType must be one of the following: - static readonly GENERIC_VALVE = 0; - static readonly IRRIGATION = 1; - static readonly SHOWER_HEAD = 2; - static readonly WATER_FAUCET = 3; - - static readonly UUID: string = '000000D5-0000-1000-8000-0026BB765291'; - - constructor() { - super('Valve Type', ValveType.UUID, { - format: Formats.UINT8, - maxValue: 3, - minValue: 0, - validValues: [0, 1, 2, 3], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ValveType = ValveType; - -/** - * Characteristic "Version" - */ - -export class Version extends Characteristic { - - static readonly UUID: string = '00000037-0000-1000-8000-0026BB765291'; - - constructor() { - super('Version', Version.UUID, { - format: Formats.STRING, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Version = Version; - -/** - * Characteristic "VOC Density" - */ - -export class VOCDensity extends Characteristic { - - static readonly UUID: string = '000000C8-0000-1000-8000-0026BB765291'; - - constructor() { - super('VOC Density', VOCDensity.UUID, { - format: Formats.FLOAT, - maxValue: 1000, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.VOCDensity = VOCDensity; - -/** - * Characteristic "Volume" - */ - -export class Volume extends Characteristic { - - static readonly UUID: string = '00000119-0000-1000-8000-0026BB765291'; - - constructor() { - super('Volume', Volume.UUID, { - format: Formats.UINT8, - unit: Units.PERCENTAGE, - maxValue: 100, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.Volume = Volume; - -/** - * Characteristic "Water Level" - */ - -export class WaterLevel extends Characteristic { - - static readonly UUID: string = '000000B5-0000-1000-8000-0026BB765291'; - - constructor() { - super('Water Level', WaterLevel.UUID, { - format: Formats.FLOAT, - maxValue: 100, - minValue: 0, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.WaterLevel = WaterLevel; - -/** - * Characteristic "Recording Audio Active" - */ - -export class RecordingAudioActive extends Characteristic { - - static readonly DISABLE = 0; - static readonly ENABLE = 1; - - static readonly UUID: string = '00000226-0000-1000-8000-0026BB765291'; - - constructor() { - super('Recording Audio Active', RecordingAudioActive.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RecordingAudioActive = RecordingAudioActive; - -/** - * Characteristic "Supported Camera Recording Configuration" - */ - -export class SupportedCameraRecordingConfiguration extends Characteristic { - - static readonly UUID: string = '00000205-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Camera Recording Configuration', SupportedCameraRecordingConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedCameraRecordingConfiguration = SupportedCameraRecordingConfiguration; - -/** - * Characteristic "Supported Video Recording Configuration" - */ - -export class SupportedVideoRecordingConfiguration extends Characteristic { - - static readonly UUID: string = '00000206-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Video Recording Configuration', SupportedVideoRecordingConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedVideoRecordingConfiguration = SupportedVideoRecordingConfiguration; - -/** - * Characteristic "Supported Audio Recording Configuration" - */ - -export class SupportedAudioRecordingConfiguration extends Characteristic { - - static readonly UUID: string = '00000207-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Audio Recording Configuration', SupportedAudioRecordingConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedAudioRecordingConfiguration = SupportedAudioRecordingConfiguration; - -/** - * Characteristic "Selected Camera Recording Configuration" - */ - -export class SelectedCameraRecordingConfiguration extends Characteristic { - - static readonly UUID: string = '00000209-0000-1000-8000-0026BB765291'; - - constructor() { - super('Selected Camera Recording Configuration', SelectedCameraRecordingConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SelectedCameraRecordingConfiguration = SelectedCameraRecordingConfiguration; - -/** - * Characteristic "Camera Operating Mode Indicator" - */ - -export class CameraOperatingModeIndicator extends Characteristic { - - static readonly DISABLE = 0; - static readonly ENABLE = 1; - - static readonly UUID: string = '0000021D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Camera Operating Mode Indicator', CameraOperatingModeIndicator.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.CameraOperatingModeIndicator = CameraOperatingModeIndicator; - -/** - * Characteristic "Event Snapshots Active" - */ - -export class EventSnapshotsActive extends Characteristic { - - static readonly DISABLE = 0; - static readonly ENABLE = 1; - - static readonly UUID: string = '00000223-0000-1000-8000-0026BB765291'; - - constructor() { - super('Event Snapshots Active', EventSnapshotsActive.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.EventSnapshotsActive = EventSnapshotsActive; - -/** - * Characteristic "Diagonal Field Of View" - */ - -export class DiagonalFieldOfView extends Characteristic { - - static readonly UUID: string = '00000224-0000-1000-8000-0026BB765291'; - - constructor() { - super('Diagonal Field Of View', DiagonalFieldOfView.UUID, { - format: Formats.FLOAT, - unit: Units.ARC_DEGREE, - maxValue: 360, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.DiagonalFieldOfView = DiagonalFieldOfView; - -/** - * Characteristic "HomeKit Camera Active" - */ - -export class HomeKitCameraActive extends Characteristic { - - static readonly OFF = 0; - static readonly ON = 1; - - static readonly UUID: string = '0000021B-0000-1000-8000-0026BB765291'; - - constructor() { - super('HomeKit Camera Active', HomeKitCameraActive.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.HomeKitCameraActive = HomeKitCameraActive; - -/** - * Characteristic "Manually disabled" - */ - -export class ManuallyDisabled extends Characteristic { - - static readonly ENABLED = 0; - static readonly DISABLED = 1; - - static readonly UUID: string = '00000227-0000-1000-8000-0026BB765291'; - - constructor() { - super('Manually disabled', ManuallyDisabled.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ManuallyDisabled = ManuallyDisabled; - -/** - * Characteristic "Third Party Camera Active" - */ - -export class ThirdPartyCameraActive extends Characteristic { - - static readonly OFF = 0; - static readonly ON = 1; - - static readonly UUID: string = '0000021C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Third Party Camera Active', ThirdPartyCameraActive.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ThirdPartyCameraActive = ThirdPartyCameraActive; - -/** - * Characteristic "Periodic Snapshots Active" - */ - -export class PeriodicSnapshotsActive extends Characteristic { - - static readonly DISABLE = 0; - static readonly ENABLE = 1; - - static readonly UUID: string = '00000225-0000-1000-8000-0026BB765291'; - - constructor() { - super('Periodic Snapshots Active', PeriodicSnapshotsActive.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.PeriodicSnapshotsActive = PeriodicSnapshotsActive; - -/** - * Characteristic "Network Client Profile Control" - */ - -export class NetworkClientProfileControl extends Characteristic { - - static readonly UUID: string = '0000020C-0000-1000-8000-0026BB765291'; - - constructor() { - super('Network Client Profile Control', NetworkClientProfileControl.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE, Perms.WRITE_RESPONSE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.NetworkClientProfileControl = NetworkClientProfileControl; - -/** - * Characteristic "Network Client Status Control" - */ - -export class NetworkClientStatusControl extends Characteristic { - - static readonly UUID: string = '0000020D-0000-1000-8000-0026BB765291'; - - constructor() { - super('Network Client Status Control', NetworkClientStatusControl.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.NetworkClientStatusControl = NetworkClientStatusControl; - -/** - * Characteristic "Router Status" - */ - -export class RouterStatus extends Characteristic { - - static readonly READY = 0; - static readonly NOT_READY = 1; - - static readonly UUID: string = '0000020E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Router Status', RouterStatus.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.RouterStatus = RouterStatus; - -/** - * Characteristic "Supported Router Configuration" - */ - -export class SupportedRouterConfiguration extends Characteristic { - - static readonly UUID: string = '00000210-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Router Configuration', SupportedRouterConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedRouterConfiguration = SupportedRouterConfiguration; - -/** - * Characteristic "WAN Configuration List" - */ - -export class WANConfigurationList extends Characteristic { - - static readonly UUID: string = '00000211-0000-1000-8000-0026BB765291'; - - constructor() { - super('WAN Configuration List', WANConfigurationList.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.WANConfigurationList = WANConfigurationList; - -/** - * Characteristic "WAN Status List" - */ - -export class WANStatusList extends Characteristic { - - static readonly UUID: string = '00000212-0000-1000-8000-0026BB765291'; - - constructor() { - super('WAN Status List', WANStatusList.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.WANStatusList = WANStatusList; - -/** - * Characteristic "Managed Network Enable" - */ - -export class ManagedNetworkEnable extends Characteristic { - static readonly DISABLED = 0; - static readonly ENABLED = 1; - static readonly UNKNOWN = 2; - - static readonly UUID: string = '00000215-0000-1000-8000-0026BB765291'; - - constructor() { - super('Managed Network Enable', ManagedNetworkEnable.UUID, { - format: Formats.UINT8, - maxValue: 1, - minValue: 0, - validValues: [0,1], - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.ManagedNetworkEnable = ManagedNetworkEnable; - -/** - * Characteristic "Network Access Violation Control" - */ - -export class NetworkAccessViolationControl extends Characteristic { - - static readonly UUID: string = '0000021F-0000-1000-8000-0026BB765291'; - - constructor() { - super('Network Access Violation Control', NetworkAccessViolationControl.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE, Perms.WRITE_RESPONSE] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.NetworkAccessViolationControl = NetworkAccessViolationControl; - -/** - * Characteristic "Wi-Fi Satellite Status" - */ - -export class WiFiSatelliteStatus extends Characteristic { - // The value property of WiFiSatelliteStatus must be one of the following: - static readonly UNKNOWN = 0; - static readonly CONNECTED = 1; - static readonly NOT_CONNECTED = 2; - - static readonly UUID: string = '0000021E-0000-1000-8000-0026BB765291'; - - constructor() { - super('Wi-Fi Satellite Status', WiFiSatelliteStatus.UUID, { - format: Formats.UINT8, - maxValue: 2, - minValue: 0, - validValues: [0,1,2], - perms: [Perms.PAIRED_READ, Perms.NOTIFY] - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.WiFiSatelliteStatus = WiFiSatelliteStatus; - -/** - * Characteristic "Wake Configuration" - * @since iOS 13.4 - */ - -export class WakeConfiguration extends Characteristic { - - static readonly UUID: string = '00000222-0000-1000-8000-0026BB765291'; - - constructor() { - super('Wake Configuration', WakeConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.WakeConfiguration = WakeConfiguration; - -/** - * Characteristic "Supported Transfer Transport Configuration" - * @since iOS 13.4 - */ - -export class SupportedTransferTransportConfiguration extends Characteristic { - - static readonly UUID: string = '00000202-0000-1000-8000-0026BB765291'; - - constructor() { - super('Supported Transfer Transport Configuration', SupportedTransferTransportConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SupportedTransferTransportConfiguration = SupportedTransferTransportConfiguration; - -/** - * Characteristic "Setup Transfer Transport" - * @since iOS 13.4 - */ - -export class SetupTransferTransport extends Characteristic { - - static readonly UUID: string = '00000201-0000-1000-8000-0026BB765291'; - - constructor() { - super('Setup Transfer Transport', SetupTransferTransport.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], - }); - this.value = this.getDefaultValue(); - } -} - -Characteristic.SetupTransferTransport = SetupTransferTransport; - -/** - * Characteristic "Activity Interval" - * @since iOS 14 - */ -export class ActivityInterval extends Characteristic { - - static readonly UUID: string = '0000023B-0000-1000-8000-0026BB765291'; - - constructor() { - super("Activity Interval", ActivityInterval.UUID, { - format: Formats.UINT32, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.ActivityInterval = ActivityInterval; - -/** - * Characteristic "CCA Energy Detect Threshold" - * @since iOS 14 - */ -export class CCAEnergyDetectThreshold extends Characteristic { - - static readonly UUID: string = '00000246-0000-1000-8000-0026BB765291'; - - constructor() { - super("CCA Energy Detect Threshold", CCAEnergyDetectThreshold.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.CCAEnergyDetectThreshold = CCAEnergyDetectThreshold; - -/** - * Characteristic "CCA Signal Detect Threshold" - * @since iOS 14 - */ -export class CCASignalDetectThreshold extends Characteristic { - - static readonly UUID: string = '00000245-0000-1000-8000-0026BB765291'; - - constructor() { - super("CCA Signal Detect Threshold", CCASignalDetectThreshold.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.CCASignalDetectThreshold = CCASignalDetectThreshold; - -/** - * Characteristic "Characteristic Value Transition Control" - * @since iOS 14 - */ -export class CharacteristicValueTransitionControl extends Characteristic { - - static readonly UUID: string = '00000143-0000-1000-8000-0026BB765291'; - - constructor() { - super("Characteristic Value Transition Control", CharacteristicValueTransitionControl.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.CharacteristicValueTransitionControl = CharacteristicValueTransitionControl; - -/** - * Characteristic "Supported Characteristic Value Transition Configuration" - * @since iOS 14 - */ -export class SupportedCharacteristicValueTransitionConfiguration extends Characteristic { - - static readonly UUID: string = '00000144-0000-1000-8000-0026BB765291'; - - constructor() { - super("Supported Characteristic Value Transition Configuration", SupportedCharacteristicValueTransitionConfiguration.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SupportedCharacteristicValueTransitionConfiguration = SupportedCharacteristicValueTransitionConfiguration; - -/** - * Characteristic "Characteristic Value Active Transition Count" - * @since iOS 14 - */ -export class CharacteristicValueActiveTransitionCount extends Characteristic { - - static readonly UUID: string = '0000024B-0000-1000-8000-0026BB765291'; - - constructor() { - super("Characteristic Value Active Transition Count", CharacteristicValueActiveTransitionCount.UUID, { - format: Formats.UINT8, - perms: [Perms.NOTIFY, Perms.PAIRED_READ], - }) - this.value = this.getDefaultValue(); - } - -} - -Characteristic.CharacteristicValueActiveTransitionCount = CharacteristicValueActiveTransitionCount; - -/** - * Characteristic "Current Transport" - * @since iOS 14 - */ -export class CurrentTransport extends Characteristic { - - static readonly UUID: string = '0000022B-0000-1000-8000-0026BB765291'; - - constructor() { - super("Current Transport", CurrentTransport.UUID, { - format: Formats.BOOL, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.CurrentTransport = CurrentTransport; - -/** - * Characteristic "Data Stream HAP Transport" - * @since iOS 14 - */ -export class DataStreamHAPTransport extends Characteristic { - - static readonly UUID: string = '00000138-0000-1000-8000-0026BB765291'; - - constructor() { - super("Data Stream HAP Transport", DataStreamHAPTransport.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.WRITE_RESPONSE], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.DataStreamHAPTransport = DataStreamHAPTransport; - -/** - * Characteristic "Data Stream HAP Transport Interrupt" - * @since iOS 14 - */ -export class DataStreamHAPTransportInterrupt extends Characteristic { - - static readonly UUID: string = '00000139-0000-1000-8000-0026BB765291'; - - constructor() { - super("Data Stream HAP Transport Interrupt", DataStreamHAPTransportInterrupt.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.DataStreamHAPTransportInterrupt = DataStreamHAPTransportInterrupt; - -/** - * Characteristic "Event Retransmission Maximum" - * @since iOS 14 - */ -export class EventRetransmissionMaximum extends Characteristic { - - static readonly UUID: string = '0000023D-0000-1000-8000-0026BB765291'; - - constructor() { - super("Event Retransmission Maximum", EventRetransmissionMaximum.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.EventRetransmissionMaximum = EventRetransmissionMaximum; - -/** - * Characteristic "Event Transmission Counters" - * @since iOS 14 - */ -export class EventTransmissionCounters extends Characteristic { - - static readonly UUID: string = '0000023E-0000-1000-8000-0026BB765291'; - - constructor() { - super("Event Transmission Counters", EventTransmissionCounters.UUID, { - format: Formats.UINT32, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.EventTransmissionCounters = EventTransmissionCounters; - -/** - * Characteristic "Heart Beat" - * @since iOS 14 - */ -export class HeartBeat extends Characteristic { - - static readonly UUID: string = '0000024A-0000-1000-8000-0026BB765291'; - - constructor() { - super("Heart Beat", HeartBeat.UUID, { - format: Formats.UINT32, - perms: [Perms.NOTIFY, Perms.PAIRED_READ], - }) - this.value = this.getDefaultValue(); - } - -} - -Characteristic.HeartBeat = HeartBeat; - -/** - * Characteristic "MAC Retransmission Maximum" - * @since iOS 14 - */ -export class MACRetransmissionMaximum extends Characteristic { - - static readonly UUID: string = '00000247-0000-1000-8000-0026BB765291'; - - constructor() { - super("MAC Retransmission Maximum", MACRetransmissionMaximum.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.MACRetransmissionMaximum = MACRetransmissionMaximum; - -/** - * Characteristic "MAC Transmission Counters" - * @since iOS 14 - */ -export class MACTransmissionCounters extends Characteristic { - - static readonly UUID: string = '00000248-0000-1000-8000-0026BB765291'; - - constructor() { - super("MAC Transmission Counters", MACTransmissionCounters.UUID, { - format: Formats.DATA, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.MACTransmissionCounters = MACTransmissionCounters; - -/** - * Characteristic "Operating State Response" - * @since iOS 14 - */ -export class OperatingStateResponse extends Characteristic { - - static readonly UUID: string = '00000232-0000-1000-8000-0026BB765291'; - - constructor() { - super("Operating State Response", OperatingStateResponse.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.NOTIFY], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.OperatingStateResponse = OperatingStateResponse; - -/** - * Characteristic "Ping" - * @since iOS 14 - */ -export class Ping extends Characteristic { - - static readonly UUID: string = '0000023C-0000-1000-8000-0026BB765291'; - - constructor() { - super("Ping", Ping.UUID, { - format: Formats.DATA, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.Ping = Ping; - -/** - * Characteristic "Receiver Sensitivity" - * @since iOS 14 - */ -export class ReceiverSensitivity extends Characteristic { - - static readonly UUID: string = '00000244-0000-1000-8000-0026BB765291'; - - constructor() { - super("Receiver Sensitivity", ReceiverSensitivity.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.ReceiverSensitivity = ReceiverSensitivity; - -/** - * Characteristic "Received Signal Strength Indication" - * @since iOS 14 - */ -export class ReceivedSignalStrengthIndication extends Characteristic { - - static readonly UUID: string = '0000023F-0000-1000-8000-0026BB765291'; - - constructor() { - super("Received Signal Strength Indication", ReceivedSignalStrengthIndication.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.ReceivedSignalStrengthIndication = ReceivedSignalStrengthIndication; - -/** - * Characteristic "Sleep Interval" - * @since iOS 14 - */ -export class SleepInterval extends Characteristic { - - static readonly UUID: string = '0000023A-0000-1000-8000-0026BB765291'; - - constructor() { - super("Sleep Interval", SleepInterval.UUID, { - format: Formats.UINT32, - minValue: 0, - minStep: 1, - perms: [Perms.PAIRED_READ, Perms.NOTIFY], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SleepInterval = SleepInterval; - -/** - * Characteristic "Signal-to-noise Ration" - * @since iOS 14 - */ -export class SignalToNoiseRatio extends Characteristic { - - static readonly UUID: string = '00000241-0000-1000-8000-0026BB765291'; - - constructor() { - super("Signal-to-noise Ration", SignalToNoiseRatio.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SignalToNoiseRatio = SignalToNoiseRatio; - -/** - * Characteristic "Supported Diagnostics Snapshot" - * @since iOS 14 - */ -export class SupportedDiagnosticsSnapshot extends Characteristic { - - static readonly UUID: string = '00000238-0000-1000-8000-0026BB765291'; - - constructor() { - super("Supported Diagnostics Snapshot", SupportedDiagnosticsSnapshot.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.SupportedDiagnosticsSnapshot = SupportedDiagnosticsSnapshot; - -/** - * Characteristic "Transmit Power" - * @since iOS 14 - */ -export class TransmitPower extends Characteristic { - - static readonly UUID: string = '00000242-0000-1000-8000-0026BB765291'; - - constructor() { - super("Transmit Power", TransmitPower.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.TransmitPower = TransmitPower; - -/** - * Characteristic "Transmit Power Maximum" - * @since iOS 14 - */ -export class TransmitPowerMaximum extends Characteristic { - - static readonly UUID: string = '00000243-0000-1000-8000-0026BB765291'; - - constructor() { - super("Transmit Power Maximum", TransmitPowerMaximum.UUID, { - format: Formats.INT, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.TransmitPowerMaximum = TransmitPowerMaximum; - -/** - * Characteristic "Video Analysis Active" - * @since iOS 14 - */ -export class VideoAnalysisActive extends Characteristic { - - static readonly UUID: string = '00000229-0000-1000-8000-0026BB765291'; - - constructor() { - super("Video Analysis Active", VideoAnalysisActive.UUID, { - format: Formats.UINT8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.VideoAnalysisActive = VideoAnalysisActive; - -/** - * Characteristic "Wi-Fi Capabilities" - * @since iOS 14 - */ -export class WiFiCapabilities extends Characteristic { - - static readonly UUID: string = '0000022C-0000-1000-8000-0026BB765291'; - - constructor() { - super("Wi-Fi Capabilities", WiFiCapabilities.UUID, { - format: Formats.UINT32, - perms: [Perms.PAIRED_READ], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.WiFiCapabilities = WiFiCapabilities; - -/** - * Characteristic "Wi-Fi Configuration Control" - * @since iOS 14 - */ -export class WiFiConfigurationControl extends Characteristic { - - static readonly UUID: string = '0000022D-0000-1000-8000-0026BB765291'; - - constructor() { - super("Wi-Fi Configuration Control", WiFiConfigurationControl.UUID, { - format: Formats.TLV8, - perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.NOTIFY, Perms.TIMED_WRITE, Perms.WRITE_RESPONSE], - }); - this.value = this.getDefaultValue(); - } - -} - -Characteristic.WiFiConfigurationControl = WiFiConfigurationControl; - -/** - * Service "Access Control" - */ - -export class AccessControl extends Service { - - static UUID: string = '000000DA-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, AccessControl.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.AccessControlLevel); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.PasswordSetting); - } -} - -Service.AccessControl = AccessControl; - -/** - * Service "Accessory Information" - */ - -export class AccessoryInformation extends Service { - - static UUID: string = '0000003E-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, AccessoryInformation.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Identify); - this.addCharacteristic(Characteristic.Manufacturer); - this.addCharacteristic(Characteristic.Model); - this.addCharacteristic(Characteristic.Name); - this.addCharacteristic(Characteristic.SerialNumber); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.AccessoryFlags); - this.addOptionalCharacteristic(Characteristic.AppMatchingIdentifier); - this.addOptionalCharacteristic(Characteristic.ConfiguredName); - this.addOptionalCharacteristic(Characteristic.FirmwareRevision); - this.addOptionalCharacteristic(Characteristic.HardwareRevision); - this.addOptionalCharacteristic(Characteristic.SoftwareRevision); - this.addOptionalCharacteristic(Characteristic.ProductData); - - // Firmware Revision is defined to be a optional characteristics but is actually REQUIRED - this.getCharacteristic(Characteristic.FirmwareRevision).updateValue("0.0.0"); - } -} - -Service.AccessoryInformation = AccessoryInformation; - -/** - * Service "Air Purifier" - */ - -export class AirPurifier extends Service { - - static UUID: string = '000000BB-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, AirPurifier.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.CurrentAirPurifierState); - this.addCharacteristic(Characteristic.TargetAirPurifierState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.SwingMode); - this.addOptionalCharacteristic(Characteristic.RotationSpeed); - } -} - -Service.AirPurifier = AirPurifier; - -/** - * Service "Air Quality Sensor" - */ - -export class AirQualitySensor extends Service { - - static UUID: string = '0000008D-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, AirQualitySensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.AirQuality); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.OzoneDensity); - this.addOptionalCharacteristic(Characteristic.NitrogenDioxideDensity); - this.addOptionalCharacteristic(Characteristic.SulphurDioxideDensity); - this.addOptionalCharacteristic(Characteristic.PM2_5Density); - this.addOptionalCharacteristic(Characteristic.PM10Density); - this.addOptionalCharacteristic(Characteristic.VOCDensity); - } -} - -Service.AirQualitySensor = AirQualitySensor; - -/** - * Service "Battery Service" - */ - -export class BatteryService extends Service { - - static UUID: string = '00000096-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, BatteryService.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.BatteryLevel); // this is actually optional since iOS 14 - this.addCharacteristic(Characteristic.ChargingState); // this is actually optional since iOS 14 - this.addCharacteristic(Characteristic.StatusLowBattery); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.BatteryService = BatteryService; - -/** - * Service "Camera RTP Stream Management" - */ - -export class CameraRTPStreamManagement extends Service { - - static UUID: string = '00000110-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, CameraRTPStreamManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SupportedVideoStreamConfiguration); - this.addCharacteristic(Characteristic.SupportedAudioStreamConfiguration); - this.addCharacteristic(Characteristic.SupportedRTPConfiguration); - this.addCharacteristic(Characteristic.SelectedRTPStreamConfiguration); - this.addCharacteristic(Characteristic.StreamingStatus); - this.addCharacteristic(Characteristic.SetupEndpoints); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Active); - } -} - -Service.CameraRTPStreamManagement = CameraRTPStreamManagement; - -/** - * Service "Carbon Dioxide Sensor" - */ - -export class CarbonDioxideSensor extends Service { - - static UUID: string = '00000097-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, CarbonDioxideSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CarbonDioxideDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.CarbonDioxideLevel); - this.addOptionalCharacteristic(Characteristic.CarbonDioxidePeakLevel); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.CarbonDioxideSensor = CarbonDioxideSensor; - -/** - * Service "Carbon Monoxide Sensor" - */ - -export class CarbonMonoxideSensor extends Service { - - static UUID: string = '0000007F-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, CarbonMonoxideSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CarbonMonoxideDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.CarbonMonoxideLevel); - this.addOptionalCharacteristic(Characteristic.CarbonMonoxidePeakLevel); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.CarbonMonoxideSensor = CarbonMonoxideSensor; - -/** - * Service "Contact Sensor" - */ - -export class ContactSensor extends Service { - - static UUID: string = '00000080-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, ContactSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ContactSensorState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.ContactSensor = ContactSensor; - -/** - * Service "Door" - */ - -export class Door extends Service { - - static UUID: string = '00000081-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Door.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentPosition); - this.addCharacteristic(Characteristic.PositionState); - this.addCharacteristic(Characteristic.TargetPosition); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.HoldPosition); - this.addOptionalCharacteristic(Characteristic.ObstructionDetected); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Door = Door; - -/** - * Service "Doorbell" - */ - -export class Doorbell extends Service { - - static UUID: string = '00000121-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Doorbell.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ProgrammableSwitchEvent); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Brightness); - this.addOptionalCharacteristic(Characteristic.Mute); - this.addOptionalCharacteristic(Characteristic.OperatingStateResponse); - this.addOptionalCharacteristic(Characteristic.Volume); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Doorbell = Doorbell; - -/** - * Service "Fan" - */ - -export class Fan extends Service { - - static UUID: string = '00000040-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Fan.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.On); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.RotationDirection); - this.addOptionalCharacteristic(Characteristic.RotationSpeed); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Fan = Fan; - -/** - * Service "Fan v2" - */ - -export class Fanv2 extends Service { - - static UUID: string = '000000B7-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Fanv2.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.CurrentFanState); - this.addOptionalCharacteristic(Characteristic.TargetFanState); - this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.RotationDirection); - this.addOptionalCharacteristic(Characteristic.RotationSpeed); - this.addOptionalCharacteristic(Characteristic.SwingMode); - } -} - -Service.Fanv2 = Fanv2; - -/** - * Service "Filter Maintenance" - */ - -export class FilterMaintenance extends Service { - - static UUID: string = '000000BA-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, FilterMaintenance.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.FilterChangeIndication); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.FilterLifeLevel); - this.addOptionalCharacteristic(Characteristic.ResetFilterIndication); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.FilterMaintenance = FilterMaintenance; - -/** - * Service "Faucet" - */ - -export class Faucet extends Service { - - static UUID: string = '000000D7-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Faucet.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.StatusFault); - } -} - -Service.Faucet = Faucet; - -/** - * Service "Garage Door Opener" - */ - -export class GarageDoorOpener extends Service { - - static UUID: string = '00000041-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, GarageDoorOpener.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentDoorState); - this.addCharacteristic(Characteristic.TargetDoorState); - this.addCharacteristic(Characteristic.ObstructionDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.LockCurrentState); - this.addOptionalCharacteristic(Characteristic.LockTargetState); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.GarageDoorOpener = GarageDoorOpener; - -/** - * Service "Heater Cooler" - */ - -export class HeaterCooler extends Service { - - static UUID: string = '000000BC-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, HeaterCooler.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.CurrentHeaterCoolerState); - this.addCharacteristic(Characteristic.TargetHeaterCoolerState); - this.addCharacteristic(Characteristic.CurrentTemperature); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.SwingMode); - this.addOptionalCharacteristic(Characteristic.CoolingThresholdTemperature); - this.addOptionalCharacteristic(Characteristic.HeatingThresholdTemperature); - this.addOptionalCharacteristic(Characteristic.TemperatureDisplayUnits); - this.addOptionalCharacteristic(Characteristic.RotationSpeed); - } -} - -Service.HeaterCooler = HeaterCooler; - -/** - * Service "Humidifier Dehumidifier" - */ - -export class HumidifierDehumidifier extends Service { - - static UUID: string = '000000BD-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, HumidifierDehumidifier.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentRelativeHumidity); - this.addCharacteristic(Characteristic.CurrentHumidifierDehumidifierState); - this.addCharacteristic(Characteristic.TargetHumidifierDehumidifierState); - this.addCharacteristic(Characteristic.Active); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.SwingMode); - this.addOptionalCharacteristic(Characteristic.WaterLevel); - this.addOptionalCharacteristic(Characteristic.RelativeHumidityDehumidifierThreshold); - this.addOptionalCharacteristic(Characteristic.RelativeHumidityHumidifierThreshold); - this.addOptionalCharacteristic(Characteristic.RotationSpeed); - } -} - -Service.HumidifierDehumidifier = HumidifierDehumidifier; - -/** - * Service "Humidity Sensor" - */ - -export class HumiditySensor extends Service { - - static UUID: string = '00000082-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, HumiditySensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentRelativeHumidity); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.HumiditySensor = HumiditySensor; - -/** - * Service "Irrigation System" - */ - -export class IrrigationSystem extends Service { - - static UUID: string = '000000CF-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, IrrigationSystem.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.ProgramMode); - this.addCharacteristic(Characteristic.InUse); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.RemainingDuration); - this.addOptionalCharacteristic(Characteristic.StatusFault); - } -} - -Service.IrrigationSystem = IrrigationSystem; - -/** - * Service "Leak Sensor" - */ - -export class LeakSensor extends Service { - - static UUID: string = '00000083-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, LeakSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.LeakDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.LeakSensor = LeakSensor; - -/** - * Service "Light Sensor" - */ - -export class LightSensor extends Service { - - static UUID: string = '00000084-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, LightSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentAmbientLightLevel); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.LightSensor = LightSensor; - -/** - * Service "Lightbulb" - */ - -export class Lightbulb extends Service { - - static UUID: string = '00000043-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Lightbulb.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.On); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Brightness); - this.addOptionalCharacteristic(Characteristic.Hue); - this.addOptionalCharacteristic(Characteristic.Saturation); - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.ColorTemperature); - this.addOptionalCharacteristic(Characteristic.CharacteristicValueActiveTransitionCount); // Ambient Lightning - this.addOptionalCharacteristic(Characteristic.CharacteristicValueTransitionControl); // Ambient Lightning - this.addOptionalCharacteristic(Characteristic.SupportedCharacteristicValueTransitionConfiguration); // Ambient Lightning - } -} - -Service.Lightbulb = Lightbulb; - -/** - * Service "Lock Management" - */ - -export class LockManagement extends Service { - - static UUID: string = '00000044-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, LockManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.LockControlPoint); - this.addCharacteristic(Characteristic.Version); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Logs); - this.addOptionalCharacteristic(Characteristic.AudioFeedback); - this.addOptionalCharacteristic(Characteristic.LockManagementAutoSecurityTimeout); - this.addOptionalCharacteristic(Characteristic.AdministratorOnlyAccess); - this.addOptionalCharacteristic(Characteristic.LockLastKnownAction); - this.addOptionalCharacteristic(Characteristic.CurrentDoorState); - this.addOptionalCharacteristic(Characteristic.MotionDetected); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.LockManagement = LockManagement; - -/** - * Service "Lock Mechanism" - */ - -export class LockMechanism extends Service { - - static UUID: string = '00000045-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, LockMechanism.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.LockCurrentState); - this.addCharacteristic(Characteristic.LockTargetState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.LockMechanism = LockMechanism; - -/** - * Service "Microphone" - */ - -export class Microphone extends Service { - - static UUID: string = '00000112-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Microphone.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Mute); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Volume); - } -} - -Service.Microphone = Microphone; - -/** - * Service "Motion Sensor" - */ - -export class MotionSensor extends Service { - - static UUID: string = '00000085-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, MotionSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.MotionDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.MotionSensor = MotionSensor; - -/** - * Service "Occupancy Sensor" - */ - -export class OccupancySensor extends Service { - - static UUID: string = '00000086-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, OccupancySensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.OccupancyDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.OccupancySensor = OccupancySensor; - -/** - * Service "Outlet" - */ - -export class Outlet extends Service { - - static UUID: string = '00000047-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Outlet.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.On); - this.addCharacteristic(Characteristic.OutletInUse); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Outlet = Outlet; - -/** - * Service "Security System" - */ - -export class SecuritySystem extends Service { - - static UUID: string = '0000007E-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, SecuritySystem.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SecuritySystemCurrentState); - this.addCharacteristic(Characteristic.SecuritySystemTargetState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.SecuritySystemAlarmType); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.SecuritySystem = SecuritySystem; - -/** - * Service "Service Label" - */ - -export class ServiceLabel extends Service { - - static UUID: string = '000000CC-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, ServiceLabel.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ServiceLabelNamespace); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.ServiceLabel = ServiceLabel; - -/** - * Service "Slat" - */ - -export class Slat extends Service { - - static UUID: string = '000000B9-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Slat.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SlatType); - this.addCharacteristic(Characteristic.CurrentSlatState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.CurrentTiltAngle); - this.addOptionalCharacteristic(Characteristic.TargetTiltAngle); - this.addOptionalCharacteristic(Characteristic.SwingMode); - } -} - -Service.Slat = Slat; - -/** - * Service "Smoke Sensor" - */ - -export class SmokeSensor extends Service { - - static UUID: string = '00000087-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, SmokeSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SmokeDetected); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.SmokeSensor = SmokeSensor; - -/** - * Service "Smart Speaker" - * @since iOS 13.4 - */ - -export class SmartSpeaker extends Service { - - static UUID: string = '00000228-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, SmartSpeaker.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentMediaState); - this.addCharacteristic(Characteristic.TargetMediaState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.ConfiguredName); - this.addOptionalCharacteristic(Characteristic.Volume); - this.addOptionalCharacteristic(Characteristic.Mute); - } -} - -Service.SmartSpeaker = SmartSpeaker; - -/** - * Service "Speaker" - * - * {@see TelevisionSpeaker} for the same Service defined with {@link VolumeControlType}, - * {@link VolumeSelector} and {@link Active} characteristics. - */ - -export class Speaker extends Service { - - static UUID: string = '00000113-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Speaker.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Mute); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Volume); - } -} - -Service.Speaker = Speaker; - -/** - * Service "Stateless Programmable Switch" - */ - -export class StatelessProgrammableSwitch extends Service { - - static UUID: string = '00000089-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, StatelessProgrammableSwitch.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ProgrammableSwitchEvent); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - this.addOptionalCharacteristic(Characteristic.ServiceLabelIndex); - } -} - -Service.StatelessProgrammableSwitch = StatelessProgrammableSwitch; - -/** - * Service "Switch" - */ - -export class Switch extends Service { - - static UUID: string = '00000049-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Switch.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.On); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Switch = Switch; - -/** - * Service "Temperature Sensor" - */ - -export class TemperatureSensor extends Service { - - static UUID: string = '0000008A-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, TemperatureSensor.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentTemperature); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.StatusActive); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.StatusLowBattery); - this.addOptionalCharacteristic(Characteristic.StatusTampered); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.TemperatureSensor = TemperatureSensor; - -/** - * Service "Thermostat" - */ - -export class Thermostat extends Service { - - static UUID: string = '0000004A-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Thermostat.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentHeatingCoolingState); - this.addCharacteristic(Characteristic.TargetHeatingCoolingState); - this.addCharacteristic(Characteristic.CurrentTemperature); - this.addCharacteristic(Characteristic.TargetTemperature); - this.addCharacteristic(Characteristic.TemperatureDisplayUnits); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.CurrentRelativeHumidity); - this.addOptionalCharacteristic(Characteristic.TargetRelativeHumidity); - this.addOptionalCharacteristic(Characteristic.CoolingThresholdTemperature); - this.addOptionalCharacteristic(Characteristic.HeatingThresholdTemperature); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Thermostat = Thermostat; - -/** - * Service "Valve" - */ - -export class Valve extends Service { - - static UUID: string = '000000D0-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Valve.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.InUse); - this.addCharacteristic(Characteristic.ValveType); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.SetDuration); - this.addOptionalCharacteristic(Characteristic.RemainingDuration); - this.addOptionalCharacteristic(Characteristic.IsConfigured); - this.addOptionalCharacteristic(Characteristic.ServiceLabelIndex); - this.addOptionalCharacteristic(Characteristic.StatusFault); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Valve = Valve; - -/** - * Service "Window" - */ - -export class Window extends Service { - - static UUID: string = '0000008B-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Window.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentPosition); - this.addCharacteristic(Characteristic.TargetPosition); - this.addCharacteristic(Characteristic.PositionState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.HoldPosition); - this.addOptionalCharacteristic(Characteristic.ObstructionDetected); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.Window = Window; - -/** - * Service "Window Covering" - */ - -export class WindowCovering extends Service { - - static UUID: string = '0000008C-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, WindowCovering.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.CurrentPosition); - this.addCharacteristic(Characteristic.TargetPosition); - this.addCharacteristic(Characteristic.PositionState); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.HoldPosition); - this.addOptionalCharacteristic(Characteristic.TargetHorizontalTiltAngle); - this.addOptionalCharacteristic(Characteristic.TargetVerticalTiltAngle); - this.addOptionalCharacteristic(Characteristic.CurrentHorizontalTiltAngle); - this.addOptionalCharacteristic(Characteristic.CurrentVerticalTiltAngle); - this.addOptionalCharacteristic(Characteristic.ObstructionDetected); - this.addOptionalCharacteristic(Characteristic.Name); - } -} - -Service.WindowCovering = WindowCovering; - -/** - * Service "Camera Operating Mode" - */ - -export class CameraOperatingMode extends Service { - - static UUID: string = '0000021A-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, CameraOperatingMode.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.EventSnapshotsActive); - this.addCharacteristic(Characteristic.HomeKitCameraActive); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.ManuallyDisabled); - this.addOptionalCharacteristic(Characteristic.NightVision); - this.addOptionalCharacteristic(Characteristic.ThirdPartyCameraActive); - this.addOptionalCharacteristic(Characteristic.CameraOperatingModeIndicator); - this.addOptionalCharacteristic(Characteristic.PeriodicSnapshotsActive); - } -} - -Service.CameraOperatingMode = CameraOperatingMode; - -/** - * Service "Camera Event Recording Management" - */ - -export class CameraEventRecordingManagement extends Service { - - static UUID: string = '00000204-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, CameraEventRecordingManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.Active); - this.addCharacteristic(Characteristic.SupportedCameraRecordingConfiguration); - this.addCharacteristic(Characteristic.SupportedVideoRecordingConfiguration); - this.addCharacteristic(Characteristic.SupportedAudioRecordingConfiguration); - this.addCharacteristic(Characteristic.SelectedCameraRecordingConfiguration); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.RecordingAudioActive); - } -} - -Service.CameraEventRecordingManagement = CameraEventRecordingManagement; - -/** - * Service "Wi-Fi Router" - */ - -export class WiFiRouter extends Service { - - static UUID: string = '0000020A-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, WiFiRouter.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.ConfiguredName); - this.addCharacteristic(Characteristic.ManagedNetworkEnable); - this.addCharacteristic(Characteristic.NetworkAccessViolationControl); - this.addCharacteristic(Characteristic.NetworkClientProfileControl); - this.addCharacteristic(Characteristic.NetworkClientStatusControl); - this.addCharacteristic(Characteristic.RouterStatus); - this.addCharacteristic(Characteristic.SupportedRouterConfiguration); - this.addCharacteristic(Characteristic.WANConfigurationList); - this.addCharacteristic(Characteristic.WANStatusList); - - } -} - -Service.WiFiRouter = WiFiRouter; - -/** - * Service "Wi-Fi Satellite" - */ - -export class WiFiSatellite extends Service { - - static readonly UUID: string = '0000020F-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, WiFiSatellite.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.WiFiSatelliteStatus); - } -} - -Service.WiFiSatellite = WiFiSatellite; - -/** - * Service "Power Management" - * @since iOS 13.4 - */ - -export class PowerManagement extends Service { - - static readonly UUID: string = '00000221-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, PowerManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.WakeConfiguration); - } -} - -Service.PowerManagement = PowerManagement; - -/** - * Service "Transfer Transport Management" - * @since iOS 13.4 - */ - -export class TransferTransportManagement extends Service { - - static readonly UUID: string = '00000203-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, TransferTransportManagement.UUID, subtype); - - // Required Characteristics - this.addCharacteristic(Characteristic.SupportedTransferTransportConfiguration); - this.addCharacteristic(Characteristic.SetupTransferTransport); - } -} - -Service.TransferTransportManagement = TransferTransportManagement; - -/** - * Service "Accessory Runtime Information" - * @since iOS 14 - */ -export class AccessoryRuntimeInformation extends Service { - - static readonly UUID: string = '00000239-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, AccessoryRuntimeInformation.UUID, subtype); - - // Require Characteristics - this.addCharacteristic(Characteristic.Ping); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.ActivityInterval); - this.addOptionalCharacteristic(Characteristic.HeartBeat); - this.addOptionalCharacteristic(Characteristic.SleepInterval); - } - -} - -Service.AccessoryRuntimeInformation = AccessoryRuntimeInformation; - -/** - * Service "Diagnostics" - * @since iOS 14 - */ -export class Diagnostics extends Service { - - static readonly UUID: string = '00000237-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, Diagnostics.UUID, subtype); - - // Require Characteristics - this.addCharacteristic(Characteristic.SupportedDiagnosticsSnapshot); - } - -} - -Service.Diagnostics = Diagnostics; - -/** - * Service "Wi-Fi Transport" - * @since iOS 14 - */ -export class WiFiTransport extends Service { - - static readonly UUID: string = '0000022A-0000-1000-8000-0026BB765291'; - - constructor(displayName?: string, subtype?: string) { - super(displayName, WiFiTransport.UUID, subtype); - - // Require Characteristics - this.addCharacteristic(Characteristic.CurrentTransport); - this.addCharacteristic(Characteristic.WiFiCapabilities); - - // Optional Characteristics - this.addOptionalCharacteristic(Characteristic.WiFiConfigurationControl); - } - -} - -Service.WiFiTransport = WiFiTransport; diff --git a/src/lib/gen/import.js b/src/lib/gen/import.js deleted file mode 100644 index a1b25b398..000000000 --- a/src/lib/gen/import.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict'; - -var path = require('path'); -var fs = require('fs'); -var plist = require('simple-plist'); -var Characteristic = require('../Characteristic').Characteristic; - -/** - * This module is intended to be run from the command line. It is a script that extracts Apple's Service - * and Characteristic UUIDs and structures from Apple's own HomeKit Accessory Simulator app. - */ - -// assumed location of the plist we need (might want to make this a command-line argument at some point) -var plistPath = '/Applications/HomeKit Accessory Simulator.app/Contents/Frameworks/HAPAccessoryKit.framework/Versions/A/Resources/default.metadata.plist'; -var metadata = plist.readFileSync(plistPath); - -// begin writing the output file -var outputPath = path.join(__dirname, 'HomeKitTypes.js'); -var output = fs.createWriteStream(outputPath); - -output.write("// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY\n"); -output.write("\n"); -output.write("var inherits = require('util').inherits;\n"); -output.write("var Characteristic = require('../Characteristic').Characteristic;\n"); -output.write("var Service = require('../Service').Service;\n"); -output.write("\n"); - -/** - * Characteristics - */ - -// index Characteristics for quick access while building Services -var characteristics = {}; // characteristics[UUID] = classyName - -for (var index in metadata.Characteristics) { - var characteristic = metadata.Characteristics[index]; - var classyName = characteristic.Name.replace(/[\s\-]/g, ""); // "Target Door State" -> "TargetDoorState" - classyName = classyName.replace(/[.]/g, "_"); // "PM2.5" -> "PM2_5" - - // index classyName for when we want to declare these in Services below - characteristics[characteristic.UUID] = classyName; - - output.write("/**\n * Characteristic \"" + characteristic.Name + "\"\n */\n\n"); - output.write("Characteristic." + classyName + " = function() {\n"); - output.write(" Characteristic.call(this, '" + characteristic.Name + "', '" + characteristic.UUID + "');\n"); - - // apply Characteristic properties - output.write(" this.setProps({\n"); - output.write(" format: Characteristic.Formats." + getCharacteristicFormatsKey(characteristic.Format)); - - // special unit type? - if (characteristic.Unit) - output.write(",\n unit: Characteristic.Units." + getCharacteristicUnitsKey(characteristic.Unit)); - - // apply any basic constraints if present - if (characteristic.Constraints && typeof characteristic.Constraints.MaximumValue !== 'undefined') - output.write(",\n maxValue: " + characteristic.Constraints.MaximumValue); - - if (characteristic.Constraints && typeof characteristic.Constraints.MinimumValue !== 'undefined') - output.write(",\n minValue: " + characteristic.Constraints.MinimumValue); - - if (characteristic.Constraints && typeof characteristic.Constraints.StepValue !== 'undefined') - output.write(",\n minStep: " + characteristic.Constraints.StepValue); - - output.write(",\n perms: ["); - var sep = "" - for (var i in characteristic.Properties) { - var perms = getCharacteristicPermsKey(characteristic.Properties[i]); - if (perms) { - output.write(sep + "Characteristic.Perms." + getCharacteristicPermsKey(characteristic.Properties[i])); - sep = ", " - } - } - output.write("]"); - - output.write("\n });\n"); - - // set default value - output.write(" this.value = this.getDefaultValue();\n"); - - output.write("};\n\n"); - output.write("inherits(Characteristic." + classyName + ", Characteristic);\n\n"); - output.write("Characteristic." + classyName + ".UUID = '" + characteristic.UUID + "';\n\n"); - - if (characteristic.Constraints && characteristic.Constraints.ValidValues) { - // this characteristic can only have one of a defined set of values (like an enum). Define the values - // as static members of our subclass. - output.write("// The value property of " + classyName + " must be one of the following:\n"); - - for (var value in characteristic.Constraints.ValidValues) { - var name = characteristic.Constraints.ValidValues[value]; - - var constName = name.toUpperCase().replace(/[^\w]+/g, '_'); - if ((/^[1-9]/).test(constName)) constName = "_" + constName; // variables can't start with a number - output.write("Characteristic." + classyName + "." + constName + " = " + value + ";\n"); - } - - output.write("\n"); - } -} - - -/** - * Services - */ - -for (var index in metadata.Services) { - var service = metadata.Services[index]; - var classyName = service.Name.replace(/[\s\-]/g, ""); // "Smoke Sensor" -> "SmokeSensor" - - output.write("/**\n * Service \"" + service.Name + "\"\n */\n\n"); - output.write("Service." + classyName + " = function(displayName, subtype) {\n"); - // call superclass constructor - output.write(" Service.call(this, displayName, '" + service.UUID + "', subtype);\n"); - - // add Characteristics for this Service - if (service.RequiredCharacteristics) { - output.write("\n // Required Characteristics\n"); - - for (var index in service.RequiredCharacteristics) { - var characteristicUUID = service.RequiredCharacteristics[index]; - - // look up the classyName from the hash we built above - var characteristicClassyName = characteristics[characteristicUUID]; - - output.write(" this.addCharacteristic(Characteristic." + characteristicClassyName + ");\n"); - } - } - - // add "Optional" Characteristics for this Service - if (service.OptionalCharacteristics) { - output.write("\n // Optional Characteristics\n"); - - for (var index in service.OptionalCharacteristics) { - var characteristicUUID = service.OptionalCharacteristics[index]; - - // look up the classyName from the hash we built above - var characteristicClassyName = characteristics[characteristicUUID]; - - output.write(" this.addOptionalCharacteristic(Characteristic." + characteristicClassyName + ");\n"); - } - } - - output.write("};\n\n"); - output.write("inherits(Service." + classyName + ", Service);\n\n"); - output.write("Service." + classyName + ".UUID = '" + service.UUID + "';\n\n"); -} - -output.write("var HomeKitTypesBridge = require('./HomeKitTypes-Bridge');\n\n"); - -/** - * Done! - */ - -output.end(); - -/** - * Useful functions - */ - -function getCharacteristicFormatsKey(format) { - // coerce 'int32' to 'int' - if (format == 'int32') format = 'int'; - - // look up the key in our known-formats dict - for (var key in Characteristic.Formats) - if (Characteristic.Formats[key] == format) - return key; - - throw new Error("Unknown characteristic format '" + format + "'"); -} - -function getCharacteristicUnitsKey(units) { - // look up the key in our known-units dict - for (var key in Characteristic.Units) - if (Characteristic.Units[key] == units) - return key; - - throw new Error("Unknown characteristic units '" + units + "'"); -} - -function getCharacteristicPermsKey(perm) { - switch (perm) { - case "read": return "READ"; - case "write": return "WRITE"; - case "cnotify": return "NOTIFY"; - case "uncnotify": return undefined; - default: throw new Error("Unknown characteristic permission '" + perm + "'"); - } -} diff --git a/src/lib/gen/importAsClasses.ts b/src/lib/gen/importAsClasses.ts deleted file mode 100644 index c5dcd50dc..000000000 --- a/src/lib/gen/importAsClasses.ts +++ /dev/null @@ -1,210 +0,0 @@ -/// -import fs from 'fs'; -import path from 'path'; -import plist from 'simple-plist'; -import { Formats, Units } from "../Characteristic"; - -/** - * This module is intended to be run from the command line. It is a script that extracts Apple's Service - * and Characteristic UUIDs and structures from Apple's own HomeKit Accessory Simulator app. - */ -const plistPath = '/Applications/HomeKit Accessory Simulator.app/Contents/Frameworks/HAPAccessoryKit.framework/Versions/A/Resources/default.metadata.plist'; -const metadata = plist.readFileSync(plistPath); - -// begin writing the output file -const outputPath = path.join(__dirname, '..', '..', '..', 'src', 'lib', 'gen', 'HomeKitTypes.generated.ts'); -const output = fs.createWriteStream(outputPath); - -output.write("// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY\n"); -output.write("\n"); -// output.write("var inherits = require('util').inherits;\n"); -output.write("import {\n"); -output.write(" Characteristic,\n"); -output.write(" CharacteristicProps,\n"); -output.write(" Formats,\n"); -output.write(" Perms,\n"); -output.write(" Units,\n"); -output.write("} from '../Characteristic';\n"); -output.write("import { Service } from '../Service';\n"); -output.write("\n"); - -/** - * Characteristics - */ - -// index Characteristics for quick access while building Services -const characteristics: Record = {}; // characteristics[UUID] = classyName - -for (let index in metadata.Characteristics) { - const characteristic = metadata.Characteristics[index]; - let classyName = characteristic.Name.replace(/[\s\-]/g, ""); // "Target Door State" -> "TargetDoorState" - classyName = classyName.replace(/[.]/g, "_"); // "PM2.5" -> "PM2_5" - - // index classyName for when we want to declare these in Services below - characteristics[characteristic.UUID] = classyName; - - output.write(`/**\n * Characteristic "${characteristic.Name}"\n */\n\n`); - output.write(`export class ${classyName} extends Characteristic {\n\n`); - output.write(` static readonly UUID: string = "${characteristic.UUID}";\n\n`); - - if (characteristic.Constraints && characteristic.Constraints.ValidValues) { - // this characteristic can only have one of a defined set of values (like an enum). Define the values - // as static members of our subclass. - output.write(" // The value property of " + classyName + " must be one of the following:\n"); - - for (let value in characteristic.Constraints.ValidValues) { - const name = characteristic.Constraints.ValidValues[value]; - - let constName = name.toUpperCase().replace(/[^\w]+/g, '_'); - if ((/^[1-9]/).test(constName)) constName = "_" + constName; // variables can't start with a number - output.write(` static readonly ${constName} = ${value};\n`); - } - output.write('\n'); - } - - // constructor - output.write(" constructor(\n"); - output.write(" displayName = \"\",\n"); - output.write(" props?: CharacteristicProps,\n"); - output.write(" ) {\n"); - output.write(" props = props || {\n"); - - // apply Characteristic properties - // output.write(" this.setProps({\n"); - output.write(" format: Formats." + getCharacteristicFormatsKey(characteristic.Format)); - - // special unit type? - if (characteristic.Unit) - output.write(",\n unit: Units." + getCharacteristicUnitsKey(characteristic.Unit)); - - // apply any basic constraints if present - if (characteristic.Constraints && typeof characteristic.Constraints.MaximumValue !== 'undefined') - output.write(",\n maxValue: " + characteristic.Constraints.MaximumValue); - - if (characteristic.Constraints && typeof characteristic.Constraints.MinimumValue !== 'undefined') - output.write(",\n minValue: " + characteristic.Constraints.MinimumValue); - - if (characteristic.Constraints && typeof characteristic.Constraints.StepValue !== 'undefined') - output.write(",\n minStep: " + characteristic.Constraints.StepValue); - - output.write(",\n perms: ["); - let sep = ""; - for (let i in characteristic.Properties) { - const perms = getCharacteristicPermsKey(characteristic.Properties[i]); - if (perms) { - output.write(sep + "Perms." + getCharacteristicPermsKey(characteristic.Properties[i])); - sep = ", " - } - } - output.write("]"); - - output.write("\n };\n"); - output.write(` super(displayName, ${classyName}.UUID, props);\n\n`); - output.write(" this.value = this.getDefaultValue();\n"); - output.write(` }\n`); - - // set default value - - output.write("};\n\n"); - // output.write("inherits(Characteristic." + classyName + ", Characteristic);\n\n"); - // output.write("Characteristic." + classyName + ".UUID = '" + characteristic.UUID + "';\n\n"); -} - -/** - * Services - */ - -for (let index in metadata.Services) { - const service = metadata.Services[index]; - const classyName = service.Name.replace(/[\s\-]/g, ""); // "Smoke Sensor" -> "SmokeSensor" - - output.write(`/**\n * Service "${service.Name}"\n */\n\n`); - output.write(`export class ${classyName} extends Service {\n\n`); - output.write(` static readonly UUID = '${service.UUID}';\n\n`); - - // constructor - output.write(" constructor(displayName: string, subtype: string) {\n"); - output.write(" super(displayName, ${classyName}.UUID, subtype);\n\n"); - - // add Characteristics for this Service - if (service.RequiredCharacteristics) { - output.write("\n // Required Characteristics\n"); - - for (let index in service.RequiredCharacteristics) { - let characteristicUUID = service.RequiredCharacteristics[index]; - - // look up the classyName from the hash we built above - let characteristicClassyName = characteristics[characteristicUUID]; - - output.write(" this.addCharacteristic(Characteristic." + characteristicClassyName + ");\n"); - } - } - - // add "Optional" Characteristics for this Service - if (service.OptionalCharacteristics) { - output.write("\n // Optional Characteristics\n"); - - for (let index in service.OptionalCharacteristics) { - let characteristicUUID = service.OptionalCharacteristics[index]; - - // look up the classyName from the hash we built above - let characteristicClassyName = characteristics[characteristicUUID]; - - output.write(" this.addOptionalCharacteristic(Characteristic." + characteristicClassyName + ");\n"); - } - } - - output.write(" }\n"); - output.write("}\n\n"); -} - -output.write("var HomeKitTypesBridge = require('./HomeKitTypes-Bridge');\n\n"); - -/** - * Done! - */ - -output.end(); - -/** - * Useful functions - */ - -function getCharacteristicFormatsKey(format: string) { - // coerce 'int32' to 'int' - if (format == 'int32') format = 'int'; - - // look up the key in our known-formats dict - // @ts-ignore - for (let key in Formats) { - // @ts-ignore - if (Formats[key as keyof typeof Formats] == format) { - return key; - } - } - - throw new Error("Unknown characteristic format '" + format + "'"); -} - -function getCharacteristicUnitsKey(units: string) { - // look up the key in our known-units dict - // @ts-ignore - for (let key in Units) { - // @ts-ignore - if (Units[key as keyof typeof Units] == units) { - return key; - } - } - - throw new Error("Unknown characteristic units '" + units + "'"); -} - -function getCharacteristicPermsKey(perm: string) { - switch (perm) { - case "read": return "READ"; - case "write": return "WRITE"; - case "cnotify": return "NOTIFY"; - case "uncnotify": return undefined; - default: throw new Error("Unknown characteristic permission '" + perm + "'"); - } -} diff --git a/src/lib/gen/index.ts b/src/lib/gen/index.ts deleted file mode 100644 index 1dea3a5c3..000000000 --- a/src/lib/gen/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as gen from './HomeKit'; -import * as bridged from './HomeKit-Bridge'; -import * as tv from './HomeKit-TV'; -import * as remote from './HomeKit-Remote'; -import * as dataStream from './HomeKit-DataStream'; - -export const BASE_UUID = '-0000-1000-8000-0026BB765291'; - -export const Generated = gen; -export const Bridged = bridged; -export const TV = tv; -export const Remote = remote; -export const DataStream = dataStream; diff --git a/src/lib/tv/AccessControlManagement.ts b/src/lib/tv/AccessControlManagement.ts index f18402cb6..349c28eb2 100644 --- a/src/lib/tv/AccessControlManagement.ts +++ b/src/lib/tv/AccessControlManagement.ts @@ -1,13 +1,13 @@ import { EventEmitter } from "events"; -import { AccessControl } from "../gen/HomeKit"; -import { Service } from "../Service"; +import { CharacteristicValue } from "../../types"; import { Characteristic, CharacteristicEventTypes, CharacteristicGetCallback, CharacteristicSetCallback } from "../Characteristic"; -import { CharacteristicValue } from "../../types"; +import type { AccessControl } from '../definitions'; +import { Service } from "../Service"; import * as tlv from "../util/tlv"; const enum AccessControlTypes { diff --git a/src/lib/util/uuid.ts b/src/lib/util/uuid.ts index af52b6fc4..c27387d88 100644 --- a/src/lib/util/uuid.ts +++ b/src/lib/util/uuid.ts @@ -3,6 +3,8 @@ import crypto from 'crypto'; type Binary = Buffer | NodeJS.TypedArray | DataView; export type BinaryLike = string | Binary; +export const BASE_UUID = '-0000-1000-8000-0026BB765291'; + // http://stackoverflow.com/a/25951500/66673 export function generate(data: BinaryLike) { const sha1sum = crypto.createHash('sha1'); @@ -68,7 +70,7 @@ export function write(uuid: string, buf: Buffer = Buffer.alloc(16), offset: numb const SHORT_FORM_REGEX = /^0*([0-9a-f]{1,8})-([0-9a-f]{4}-){3}[0-9a-f]{12}$/i; -export function toShortForm(uuid: string, base?: string) { +export function toShortForm(uuid: string, base: string = BASE_UUID) { if (!isValid(uuid)) throw new TypeError('uuid was not a valid UUID or short form UUID'); if (base && !isValid('00000000' + base)) throw new TypeError('base was not a valid base UUID'); if (base && !uuid.endsWith(base)) return uuid.toUpperCase(); @@ -78,7 +80,7 @@ export function toShortForm(uuid: string, base?: string) { const VALID_SHORT_REGEX = /^[0-9a-f]{1,8}$/i; -export function toLongForm(uuid: string, base: string) { +export function toLongForm(uuid: string, base: string = BASE_UUID) { if (isValid(uuid)) return uuid.toUpperCase(); if (!VALID_SHORT_REGEX.test(uuid)) throw new TypeError('uuid was not a valid UUID or short form UUID'); if (!isValid('00000000' + base)) throw new TypeError('base was not a valid base UUID'); diff --git a/src/types/simple-plist.d.ts b/src/types/simple-plist.d.ts new file mode 100644 index 000000000..818af4c88 --- /dev/null +++ b/src/types/simple-plist.d.ts @@ -0,0 +1,23 @@ +declare module "simple-plist" { + + import { WriteFileOptions } from "fs"; + + export function parse(content: Buffer | string, path: string): any; + + export function readFileSync(path: string): any; + + export function readFile(path: string, callback: (err: Error | null, result: any) => void): void; + + export function writeFileSync(path: string, object: any, options?: WriteFileOptions): void + + export function writeFile(path: string, object: any, callback: (err: NodeJS.ErrnoException | null) => void): void; + + export function writeFile(path: string, object: any, options: WriteFileOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + + export function writeBinaryFileSync(path: string, object: any, options?: WriteFileOptions): void + + export function writeBinaryFile(path: string, object: any, callback: (err: NodeJS.ErrnoException | null) => void): void; + + export function writeBinaryFile(path: string, object: any, options: WriteFileOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + +}