Skip to content

Commit

Permalink
Removed notify perms from Version characteristic again.
Browse files Browse the repository at this point in the history
Additional Authorization should not be added by default.
  • Loading branch information
Supereg committed Oct 19, 2020
1 parent 581298f commit 0a45bbf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/definitions/CharacteristicDefinitions.ts
Expand Up @@ -1698,7 +1698,7 @@ export class LockTargetState extends Characteristic {
constructor() {
super("Lock Target State", LockTargetState.UUID, {
format: Formats.UINT8,
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.ADDITIONAL_AUTHORIZATION],
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE],
minValue: 0,
maxValue: 1,
minStep: 1,
Expand Down Expand Up @@ -3576,7 +3576,7 @@ export class TargetDoorState extends Characteristic {
constructor() {
super("Target Door State", TargetDoorState.UUID, {
format: Formats.UINT8,
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE, Perms.ADDITIONAL_AUTHORIZATION],
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE],
minValue: 0,
maxValue: 1,
minStep: 1,
Expand Down Expand Up @@ -4098,7 +4098,7 @@ export class Version extends Characteristic {
constructor() {
super("Version", Version.UUID, {
format: Formats.STRING,
perms: [Perms.NOTIFY, Perms.PAIRED_READ],
perms: [Perms.PAIRED_READ],
maxLen: 64,
});
this.value = this.getDefaultValue();
Expand Down
4 changes: 4 additions & 0 deletions src/lib/definitions/generate-definitions.ts
Expand Up @@ -598,6 +598,10 @@ function generatePermsString(propertiesBitMap: number): string {
const perms: string [] = [];

for (const [bitMap, name] of properties) {
if (name === "ADDITIONAL_AUTHORIZATION") {
// aa set by homed just signals that aa may be supported. Setting up aa will always require a custom made app though
continue;
}
if ((propertiesBitMap | bitMap) === propertiesBitMap) { // if it stays the same the bit is set
perms.push("Perms." + name);
}
Expand Down
10 changes: 10 additions & 0 deletions src/lib/definitions/generator-configuration.ts
Expand Up @@ -73,6 +73,16 @@ export const CharacteristicManualAdditions: Map<string, GeneratedCharacteristic>
minValue: 0,
maxValue: 360,
}],
["version", { // don't know why, but version has notify permission even if it shouldn't have one
id: "version",
UUID: "00000037-0000-1000-8000-0026BB765291",
name: "Version",
className: "Version",

format: "string",
properties: 2, // paired read
maxLength: 64,
}]
]);

export const ServiceNameOverrides: Map<string, string> = new Map([
Expand Down

0 comments on commit 0a45bbf

Please sign in to comment.