Skip to content

Commit 8eea58f

Browse files
committed
update hap characteristics and services
1 parent 0065ffe commit 8eea58f

File tree

7 files changed

+114
-2
lines changed

7 files changed

+114
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to `hap-nodejs` will be documented in this file. This projec
99
- update readme badges (use `shields.io`) (#1104)
1010
- update publish workflows for npm oidc auth (#1105)
1111
- dependency updates
12+
- update hap characteristics and services
1213

1314
## v2.0.2 (2025-09-17)
1415

src/lib/Characteristic.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import type {
3939
ColorTemperature,
4040
ConfigurationState,
4141
ConfiguredName,
42+
ConnectionHealthMonitor,
4243
ContactSensorState,
4344
CoolingThresholdTemperature,
4445
CryptoHash,
@@ -105,6 +106,7 @@ import type {
105106
MatterFirmwareRevisionNumber,
106107
MatterFirmwareUpdateStatus,
107108
MaximumTransmitPower,
109+
MediaAccessControlLevel,
108110
MetricsBufferFullState,
109111
Model,
110112
MotionDetected,
@@ -812,6 +814,10 @@ export class Characteristic extends EventEmitter {
812814
* @group Characteristic Definitions
813815
*/
814816
public static ConfiguredName: typeof ConfiguredName;
817+
/**
818+
* @group Characteristic Definitions
819+
*/
820+
public static ConnectionHealthMonitor: typeof ConnectionHealthMonitor;
815821
/**
816822
* @group Characteristic Definitions
817823
*/
@@ -1076,6 +1082,10 @@ export class Characteristic extends EventEmitter {
10761082
* @group Characteristic Definitions
10771083
*/
10781084
public static MaximumTransmitPower: typeof MaximumTransmitPower;
1085+
/**
1086+
* @group Characteristic Definitions
1087+
*/
1088+
public static MediaAccessControlLevel: typeof MediaAccessControlLevel;
10791089
/**
10801090
* @group Characteristic Definitions
10811091
*/
@@ -1493,6 +1503,7 @@ export class Characteristic extends EventEmitter {
14931503
public static SwingMode: typeof SwingMode;
14941504
/**
14951505
* @group Characteristic Definitions
1506+
* @deprecated Removed
14961507
*/
14971508
public static TapType: typeof TapType;
14981509
/**
@@ -1585,6 +1596,7 @@ export class Characteristic extends EventEmitter {
15851596
public static ThreadStatus: typeof ThreadStatus;
15861597
/**
15871598
* @group Characteristic Definitions
1599+
* @deprecated Removed
15881600
*/
15891601
public static Token: typeof Token;
15901602
/**

src/lib/Service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ export class Service extends EventEmitter {
399399
public static Switch: typeof Switch;
400400
/**
401401
* @group Service Definitions
402+
* @deprecated Removed
402403
*/
403404
public static TapManagement: typeof TapManagement;
404405
/**

src/lib/definitions/CharacteristicDefinitions.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ describe("CharacteristicDefinitions", () => {
214214
});
215215
});
216216

217+
describe("ConnectionHealthMonitor", () => {
218+
it("should be able to construct", () => {
219+
new Characteristic.ConnectionHealthMonitor();
220+
});
221+
});
222+
217223
describe("ContactSensorState", () => {
218224
it("should be able to construct", () => {
219225
new Characteristic.ContactSensorState();
@@ -610,6 +616,12 @@ describe("CharacteristicDefinitions", () => {
610616
});
611617
});
612618

619+
describe("MediaAccessControlLevel", () => {
620+
it("should be able to construct", () => {
621+
new Characteristic.MediaAccessControlLevel();
622+
});
623+
});
624+
613625
describe("MetricsBufferFullState", () => {
614626
it("should be able to construct", () => {
615627
new Characteristic.MetricsBufferFullState();

src/lib/definitions/CharacteristicDefinitions.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY
2-
// V=886
2+
// V=887
33

44
import { Access, Characteristic, Formats, Perms, Units } from "../Characteristic";
55

@@ -699,6 +699,23 @@ export class ConfiguredName extends Characteristic {
699699
}
700700
Characteristic.ConfiguredName = ConfiguredName;
701701

702+
/**
703+
* Characteristic "Connection Health Monitor"
704+
*/
705+
export class ConnectionHealthMonitor extends Characteristic {
706+
707+
public static readonly UUID: string = "00000273-0000-1000-8000-0026BB765291";
708+
709+
constructor() {
710+
super("Connection Health Monitor", ConnectionHealthMonitor.UUID, {
711+
format: Formats.TLV8,
712+
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE],
713+
});
714+
this.value = this.getDefaultValue();
715+
}
716+
}
717+
Characteristic.ConnectionHealthMonitor = ConnectionHealthMonitor;
718+
702719
/**
703720
* Characteristic "Contact Sensor State"
704721
*/
@@ -746,6 +763,7 @@ Characteristic.CoolingThresholdTemperature = CoolingThresholdTemperature;
746763

747764
/**
748765
* Characteristic "Crypto Hash"
766+
* @since iOS 14.0
749767
*/
750768
export class CryptoHash extends Characteristic {
751769

@@ -2083,6 +2101,26 @@ export class MaximumTransmitPower extends Characteristic {
20832101
}
20842102
Characteristic.MaximumTransmitPower = MaximumTransmitPower;
20852103

2104+
/**
2105+
* Characteristic "Media Access Control Level"
2106+
*/
2107+
export class MediaAccessControlLevel extends Characteristic {
2108+
2109+
public static readonly UUID: string = "000000EE-0000-1000-8000-0026BB765291";
2110+
2111+
constructor() {
2112+
super("Media Access Control Level", MediaAccessControlLevel.UUID, {
2113+
format: Formats.UINT8,
2114+
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE],
2115+
minValue: 0,
2116+
maxValue: 2,
2117+
minStep: 1,
2118+
});
2119+
this.value = this.getDefaultValue();
2120+
}
2121+
}
2122+
Characteristic.MediaAccessControlLevel = MediaAccessControlLevel;
2123+
20862124
/**
20872125
* Characteristic "Metrics Buffer Full State"
20882126
*/
@@ -4105,6 +4143,7 @@ Characteristic.SwingMode = SwingMode;
41054143

41064144
/**
41074145
* Characteristic "Tap Type"
4146+
* @deprecated Removed
41084147
*/
41094148
export class TapType extends Characteristic {
41104149

@@ -4118,6 +4157,7 @@ export class TapType extends Characteristic {
41184157
this.value = this.getDefaultValue();
41194158
}
41204159
}
4160+
// noinspection JSDeprecatedSymbols
41214161
Characteristic.TapType = TapType;
41224162

41234163
/**
@@ -4599,6 +4639,7 @@ Characteristic.ThreadStatus = ThreadStatus;
45994639

46004640
/**
46014641
* Characteristic "Token"
4642+
* @deprecated Removed
46024643
*/
46034644
export class Token extends Characteristic {
46044645

@@ -4612,6 +4653,7 @@ export class Token extends Characteristic {
46124653
this.value = this.getDefaultValue();
46134654
}
46144655
}
4656+
// noinspection JSDeprecatedSymbols
46154657
Characteristic.Token = Token;
46164658

46174659
/**

src/lib/definitions/ServiceDefinitions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// THIS FILE IS AUTO-GENERATED - DO NOT MODIFY
2-
// V=886
2+
// V=887
33

44
import { Characteristic } from "../Characteristic";
55
import { Service } from "../Service";
@@ -37,6 +37,7 @@ export class AccessControl extends Service {
3737
this.addCharacteristic(Characteristic.AccessControlLevel);
3838

3939
// Optional Characteristics
40+
this.addOptionalCharacteristic(Characteristic.MediaAccessControlLevel);
4041
this.addOptionalCharacteristic(Characteristic.PasswordSetting);
4142
}
4243
}
@@ -108,6 +109,7 @@ export class AccessoryRuntimeInformation extends Service {
108109

109110
// Optional Characteristics
110111
this.addOptionalCharacteristic(Characteristic.ActivityInterval);
112+
this.addOptionalCharacteristic(Characteristic.ConnectionHealthMonitor);
111113
this.addOptionalCharacteristic(Characteristic.HeartBeat);
112114
this.addOptionalCharacteristic(Characteristic.SleepInterval);
113115
}
@@ -1267,6 +1269,7 @@ Service.Switch = Switch;
12671269

12681270
/**
12691271
* Service "Tap Management"
1272+
* @deprecated Removed
12701273
*/
12711274
export class TapManagement extends Service {
12721275

@@ -1282,6 +1285,7 @@ export class TapManagement extends Service {
12821285
this.addCharacteristic(Characteristic.Token);
12831286
}
12841287
}
1288+
// noinspection JSDeprecatedSymbols
12851289
Service.TapManagement = TapManagement;
12861290

12871291
/**

src/lib/definitions/generator-configuration.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ export const CharacteristicManualAdditions: Map<string, GeneratedCharacteristic>
212212
properties: 2, // paired read
213213
maxLength: 64,
214214
}],
215+
["crypto-hash", {
216+
id: "crypto-hash",
217+
UUID: "00000250-0000-1000-8000-0026BB765291",
218+
name: "Crypto Hash",
219+
className: "CryptoHash",
220+
since: "14.0",
221+
format: "tlv8",
222+
properties: 132, // write (4) + write_response (128)
223+
}],
215224
["relay-control-point", {
216225
id: "relay-control-point",
217226
UUID: "0000005E-0000-1000-8000-0026BB765291",
@@ -242,6 +251,24 @@ export const CharacteristicManualAdditions: Map<string, GeneratedCharacteristic>
242251
minValue: 0,
243252
maxValue: 5,
244253
}],
254+
["tap-type", {
255+
id: "tap-type",
256+
UUID: "0000022F-0000-1000-8000-0026BB765291",
257+
name: "Tap Type",
258+
className: "TapType",
259+
deprecatedNotice: "Removed",
260+
format: "uint16",
261+
properties: 2, // read
262+
}],
263+
["token", {
264+
id: "token",
265+
UUID: "00000231-0000-1000-8000-0026BB765291",
266+
name: "Token",
267+
className: "Token",
268+
deprecatedNotice: "Removed",
269+
format: "data",
270+
properties: 4, // write
271+
}],
245272
["tunnel-connection-timeout", {
246273
id: "tunnel-connection-timeout",
247274
UUID: "00000061-0000-1000-8000-0026BB765291",
@@ -326,6 +353,19 @@ export const ServiceManualAdditions: Map<string, GeneratedService> = new Map([
326353
"relay-enabled",
327354
],
328355
}],
356+
["tap-management", {
357+
id: "tap-management",
358+
UUID: "0000022E-0000-1000-8000-0026BB765291",
359+
name: "Tap Management",
360+
className: "TapManagement",
361+
deprecatedNotice: "Removed",
362+
requiredCharacteristics: [
363+
"active",
364+
"crypto-hash",
365+
"tap-type",
366+
"token",
367+
],
368+
}],
329369
["tunnel", {
330370
id: "tunnel",
331371
UUID: "00000056-0000-1000-8000-0026BB765291",

0 commit comments

Comments
 (0)