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