diff --git a/SUPPORTED_DEVICES.md b/SUPPORTED_DEVICES.md index 430db98..67a0b7f 100644 --- a/SUPPORTED_DEVICES.md +++ b/SUPPORTED_DEVICES.md @@ -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
Switch | ✅ | Documentation | ## Electrical Products diff --git a/src/accessory/WhiteNoiseLightAccessory.ts b/src/accessory/WhiteNoiseLightAccessory.ts index b4ad0ce..63ef5ca 100644 --- a/src/accessory/WhiteNoiseLightAccessory.ts +++ b/src/accessory/WhiteNoiseLightAccessory.ts @@ -3,20 +3,17 @@ import { configureOn } from "./characteristic/On"; import { configureLight } from "./characteristic/Light"; const SCHEMA_CODE = { - MUSIC_ON: ["switch_music"], LIGHT_ON: ["switch_led"], LIGHT_COLOR: ["colour_data"], + MUSIC_ON: ["switch_music"], }; 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( @@ -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() {