@pmouli/isy-matter-server
Version:
Service to expose an ISY device as a Matter Border router
18 lines • 913 B
JavaScript
import { DimmableLightRequirements } from '@matter/node/devices';
import { Devices } from 'isy-nodejs/ISY';
import { BehaviorRegistry } from '../BehaviorRegistry.js';
import { ISYClusterBehavior } from '../ISYClusterBehavior.js';
export class DimmerLevelControlBehavior extends ISYClusterBehavior(DimmableLightRequirements.LevelControlServer, Devices.ZigBee.ExtendedColorLight) {
async initialize(_options) {
await super.initialize(_options);
this.state.minLevel = 1;
this.state.maxLevel = 254;
this.state.currentLevel = this.state.onLevel ?? 254;
}
async moveToLevelLogic(level, transitionTime, withOnOff, options) {
await this.device.onOff.on(level, transitionTime);
await super.moveToLevelLogic(level, transitionTime, withOnOff, options);
}
}
BehaviorRegistry.register(DimmerLevelControlBehavior);
//# sourceMappingURL=LevelControlBehavior.js.map