Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add "bzyd" White Noise Night Light #510

Merged
merged 8 commits into from
Dec 15, 2024

Conversation

ollief87
Copy link

Added support for the Tuya White Noise Night Light.

Note: the device has an RGB light with H/S/V values, but the "colour_data" property in the schema comes through as an empty object, so it required setting some defaults.

@ollief87
Copy link
Author

ollief87 commented Dec 12, 2024

This is the device schema - note the empty object for "colour_data":

"schema": [
      {
        "code": "colour_data",
        "mode": "rw",
        "type": "String",
        "property": {}
      },
      {
        "code": "countdown",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "unit": "min",
          "min": 0,
          "max": 1440,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "status",
        "mode": "ro",
        "type": "Enum",
        "property": {
          "range": [
            "manual",
            "wake_up_1",
            "wake_up_2",
            "wake_up_3",
            "wake_up_4",
            "sleep_1",
            "sleep_2",
            "sleep_3",
            "sleep_4"
          ]
        }
      },
      {
        "code": "stop",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch_led",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch_music",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "volume_set",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "unit": "",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "work_mode",
        "mode": "rw",
        "type": "Enum",
        "property": {
          "range": [
            "scene",
            "customize_scene",
            "colour"
          ]
        }
      }
    ]

The values reported for "stop", "switch" & "work_mode" never change no matter what I do with the device's physical buttons, or using the native Tuya mobile app. Here are example values from my device:

"status": [
      {
        "code": "colour_data",
        "value": "{\"h\":45,\"s\":1000,\"v\":270}"
      },
      {
        "code": "countdown",
        "value": 0
      },
      {
        "code": "status",
        "value": "manual"
      },
      {
        "code": "stop",
        "value": false
      },
      {
        "code": "switch",
        "value": false
      },
      {
        "code": "switch_led",
        "value": true
      },
      {
        "code": "switch_music",
        "value": true
      },
      {
        "code": "volume_set",
        "value": 33
      },
      {
        "code": "work_mode",
        "value": "scene"
      }
    ]

@0x5e 0x5e merged commit b07a6c0 into 0x5e:develop_1.7.0 Dec 15, 2024
8 checks passed
@0x5e
Copy link
Owner

0x5e commented Dec 15, 2024

Thanks @ollief87 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants