dimmer
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
import { AItem } from './AItem'
|
||||
import { AItem, HasInTopic } from './AItem'
|
||||
import * as logger from './log'
|
||||
import { mqttHandler } from './MqttDispatcher'
|
||||
|
||||
|
||||
export class DimmerAdaptor extends AItem {
|
||||
export class DimmerAdaptor extends AItem implements HasInTopic {
|
||||
private brightDirection: number
|
||||
private bright: number
|
||||
private state: string
|
||||
@ -22,6 +21,11 @@ export class DimmerAdaptor extends AItem {
|
||||
this.brightDirection = -1
|
||||
}
|
||||
|
||||
getInTopic() : string {
|
||||
return this.inTopic
|
||||
}
|
||||
|
||||
|
||||
processMessage(topic: string, payload: string) : void {
|
||||
switch (topic) {
|
||||
case this.inTopic:
|
||||
|
@ -150,8 +150,12 @@ let bedRoomWolfgangBedLight = new HueColorBulbItem('1st', 'BedRoom', 'WolfgangBe
|
||||
bedRoomWolfgangBedLight.start()
|
||||
allLabeledItems.push(bedRoomWolfgangBedLight)
|
||||
|
||||
let bedRoomWolfgangBedLightDimmerAdaptor = new DimmerAdaptor('1st', 'BedRoom', 'WolfgangBedLight')
|
||||
bedRoomWolfgangBedLightDimmerAdaptor.start()
|
||||
|
||||
let touchSwitchMultiButtonThing = new TouchSwitchMultiButtonThing('1st', 'Bedroom', 'Wolfgang',
|
||||
[ new TouchSwitchButtonSingleItem(bedRoomWolfgangBedLight.getStateTopic())])
|
||||
[ new TouchSwitchButtonSingleItem(bedRoomWolfgangBedLightDimmerAdaptor.getInTopic())])
|
||||
touchSwitchMultiButtonThing.start()
|
||||
|
||||
// Schlafzimmer Pattys Seite 13980756 24 1 13980753 24 1
|
||||
let bedRoomPattysSide = new M433SwitchItem('1st', 'BedRoom', 'PattysSide', 'Pattys Seite Schlafzimmer', '13980756 24 1', '13980753 24 1')
|
||||
|
Reference in New Issue
Block a user