Skip to content

Commit

Permalink
W3C compliance - Use forms instead of links in Properties, Actions, a…
Browse files Browse the repository at this point in the history
…nd Events (#100)
  • Loading branch information
relu91 authored May 13, 2021
1 parent 2895f8d commit e2ec5de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion schema
Submodule schema updated 1 files
+203 −6 messages/definitions.json
18 changes: 9 additions & 9 deletions src/property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import { Device } from './device';

import { Any, Link, Property as PropertySchema, PropertyValueType } from './schema';
import { Any, PropertyForm, Property as PropertySchema, PropertyValueType } from './schema';

import assert from 'assert';

Expand Down Expand Up @@ -45,7 +45,7 @@ export class Property<T extends Any> {

private multipleOf?: number;

private links: Link[];
private forms: PropertyForm[];

private fireAndForget = false;

Expand Down Expand Up @@ -78,7 +78,7 @@ export class Property<T extends Any> {
this.enum = propertyDescr.enum;
this.readOnly = propertyDescr.readOnly;
this.multipleOf = propertyDescr.multipleOf;
this.links = propertyDescr.links ?? [];
this.forms = propertyDescr.forms ?? [];
}

/**
Expand All @@ -99,7 +99,7 @@ export class Property<T extends Any> {
enum: this.enum,
readOnly: this.readOnly,
multipleOf: this.multipleOf,
links: this.links,
forms: this.forms,
};
}

Expand All @@ -119,7 +119,7 @@ export class Property<T extends Any> {
enum: this.enum,
readOnly: this.readOnly,
multipleOf: this.multipleOf,
links: this.links,
forms: this.forms,
};
}

Expand Down Expand Up @@ -321,11 +321,11 @@ export class Property<T extends Any> {
this.multipleOf = value;
}

getLinks(): Link[] {
return this.links;
getForms(): PropertyForm[] {
return this.forms;
}

setLinks(value: Link[]): void {
this.links = value;
setForms(value: PropertyForm[]): void {
this.forms = value;
}
}

0 comments on commit e2ec5de

Please sign in to comment.