Skip to content

Commit

Permalink
Update doco
Browse files Browse the repository at this point in the history
  • Loading branch information
ollief87 committed Dec 11, 2024
1 parent 86e5215 commit 8e285ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions SUPPORTED_DEVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Most category code is pinyin abbreviation of Chinese name.
| Dimmer | 调光器 | tgq | Lightbulb || [Documentation](https://developer.tuya.com/en/docs/iot/tgq?id=Kaof8ke9il4k4) |
| Remote Control | 遥控器 | ykq | | | [Documentation](https://developer.tuya.com/en/docs/iot/ykq?id=Kaof8ljn81aov) |
| Spotlight | 射灯 | sxd | Lightbulb || [Documentation](https://developer.tuya.com/en/docs/iot/sxd?id=Kb7jayalltstu) |
| White Noise Light | 白噪音灯 | bzyd | Lightbulb<br> Switch || Documentation |


## Electrical Products
Expand Down
10 changes: 5 additions & 5 deletions src/accessory/WhiteNoiseLightAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@ import { configureOn } from "./characteristic/On";
import { configureLight } from "./characteristic/Light";

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Strings must use singlequote

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (13.x)

Strings must use singlequote

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use singlequote

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (15.x)

Strings must use singlequote

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (12.x)

Strings must use singlequote

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (19.x)

Strings must use singlequote

Check warning on line 3 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Strings must use singlequote

const SCHEMA_CODE = {
MUSIC_ON: ["switch_music"],
LIGHT_ON: ["switch_led"],

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Strings must use singlequote

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (13.x)

Strings must use singlequote

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use singlequote

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (15.x)

Strings must use singlequote

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (12.x)

Strings must use singlequote

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (19.x)

Strings must use singlequote

Check warning on line 6 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Strings must use singlequote
LIGHT_COLOR: ["colour_data"],

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Strings must use singlequote

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (13.x)

Strings must use singlequote

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use singlequote

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (15.x)

Strings must use singlequote

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (12.x)

Strings must use singlequote

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (19.x)

Strings must use singlequote

Check warning on line 7 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Strings must use singlequote
MUSIC_ON: ["switch_music"],

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Strings must use singlequote

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (13.x)

Strings must use singlequote

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use singlequote

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (15.x)

Strings must use singlequote

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (12.x)

Strings must use singlequote

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (19.x)

Strings must use singlequote

Check warning on line 8 in src/accessory/WhiteNoiseLightAccessory.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Strings must use singlequote
};

export default class WhiteNoiseLightAccessory extends BaseAccessory {
requiredSchema() {
return [SCHEMA_CODE.MUSIC_ON, SCHEMA_CODE.LIGHT_ON];
return [SCHEMA_CODE.LIGHT_ON, SCHEMA_CODE.MUSIC_ON];
}

configureServices() {
// White Noise
configureOn(this, undefined, this.getSchema(...SCHEMA_CODE.MUSIC_ON));

// Light
if (this.lightServiceType() === this.Service.Lightbulb) {
configureLight(
Expand All @@ -33,6 +30,9 @@ export default class WhiteNoiseLightAccessory extends BaseAccessory {
const unusedService = this.accessory.getService(this.Service.Lightbulb);
unusedService && this.accessory.removeService(unusedService);
}

// White Noise
configureOn(this, undefined, this.getSchema(...SCHEMA_CODE.MUSIC_ON));
}

lightColorSchema() {
Expand Down

0 comments on commit 8e285ec

Please sign in to comment.