Skip to content

Commit 6b49bff

Browse files
authored
Add adaptive lighting support. (#272)
1 parent ed2b157 commit 6b49bff

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Add Smart Lock support (`ms`, `jtmspro`). (#120) Thanks @pfgimutao for the contribution
2323
- Add Alarm Host support (`mal`). (#246) Thanks @bFollon for the contribution
2424
- Add Vibration Sensor support (`zd`).
25+
- Add adaptive lighting support.
2526

2627

2728
### Fixed

src/accessory/BaseAccessory.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class BaseAccessory {
3333
public log = new PrefixLogger(this.platform.log, this.device.name.length > 0 ? this.device.name : this.device.id);
3434
public intialized = false;
3535

36+
public adaptiveLightingController?;
37+
3638
constructor(
3739
public readonly platform: TuyaPlatform,
3840
public readonly accessory: PlatformAccessory,

src/accessory/characteristic/Light.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,13 @@ export function configureLight(
322322
configureSaturation(accessory, service, lightType, colorSchema!, modeSchema);
323323
break;
324324
}
325+
326+
// Adaptive Lighting
327+
if (brightSchema && tempSchema) {
328+
const { AdaptiveLightingController } = accessory.platform.api.hap;
329+
const controller = new AdaptiveLightingController(service);
330+
accessory.accessory.configureController(controller);
331+
accessory.adaptiveLightingController = controller;
332+
}
333+
325334
}

0 commit comments

Comments
 (0)