typescriptifying

This commit is contained in:
Wolfgang Hottgenroth
2018-01-09 16:36:14 +01:00
parent 9e39d74084
commit 8d85314fc9
21 changed files with 372 additions and 182 deletions

17
src/AHomematicItem.ts Normal file
View File

@ -0,0 +1,17 @@
import { AItem } from './AItem'
export abstract class AHomematicItem extends AItem {
protected deviceTopicPre: string;
protected actionTopicPre: string;
protected homegearTopicPre: string;
protected hmId: number;
constructor(floor: string, room: string, item: string, hmId: number) {
super(floor, room, item);
this.hmId = hmId;
this.homegearTopicPre = 'homegear/instance1';
this.actionTopicPre = `${this.homegearTopicPre}/set/${this.hmId}`;
this.deviceTopicPre = `${this.homegearTopicPre}/plain/${this.hmId}`;
}
}