{"id":19858455,"url":"https://github.com/tuya/tuya-lighting-android-sdk","last_synced_at":"2025-05-02T02:31:00.476Z","repository":{"id":103228649,"uuid":"347821307","full_name":"tuya/tuya-lighting-android-sdk","owner":"tuya","description":"The Tuya Smart Lighting Android SDK is an interface package that extends the TuyaSmartDevice with access to lighting device related features to speed up the development process.","archived":false,"fork":false,"pushed_at":"2021-03-27T01:36:05.000Z","size":194,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-06T21:24:22.900Z","etag":null,"topics":["tuya"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-15T03:12:47.000Z","updated_at":"2024-08-14T21:05:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"c10306be-f777-47f0-b4e1-91a1a0a92c5e","html_url":"https://github.com/tuya/tuya-lighting-android-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-lighting-android-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-lighting-android-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-lighting-android-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuya%2Ftuya-lighting-android-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuya","download_url":"https://codeload.github.com/tuya/tuya-lighting-android-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251972459,"owners_count":21673610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tuya"],"created_at":"2024-11-12T14:23:31.442Z","updated_at":"2025-05-02T02:31:00.469Z","avatar_url":"https://github.com/tuya.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tuya-lighting-android-sdk\n\n### **[English](README.md) | [中文版](README_cn.md)**\n\nThe lighting equipment is more complicated, and there are both v1 and v2 new and old firmware. Even if standard commands are used, two sets of control logic need to be developed.\n\nTherefore, the functions of the lighting equipment are encapsulated, and the switches, working mode switching, brightness control, cooling and heating control, color light control and the control of the four scene modes of the lighting equipment are encapsulated.\n\n#### Functional Overview\n\nTuya Smart Lighting Android SDK is based on Tuya SmartDevice, which expands the interface package for accessing lighting equipment related functions to speed up the development process. Mainly includes the following functions:\n\n* Get the current device is a few street lights\n* Get the value of all function points of the lamp\n* Turn the lights on or off\n* Switch working mode\n* Control the brightness of the light\n* Control the color temperature of the lamp\n* Switch scene mode\n* Set the color of the lantern\n\n#### Quick integration\n\n# Dependency description\n\n```\nimplementation 'com.tuya.smart:tuyasmart:3.22.0'\n// Control SDK dependencies\nimplementation 'com.tuya.smart:tuyasmart-centralcontrol:1.0.3'\n```\n\nIt should be noted that tuyasmart-centralcontrol uses kotlin to compile, and the kotlin library needs to be imported to ensure its normal use.\n\n\u003e If Kotlin has been introduced in the project, the following configuration can be ignored.\n\n**kotlin**\n\n```\nbuildscript {\n    ext.kotlin_version = '1.3.72'\n    dependencies {\n    \t...\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n```\n\nIntroduce the kotlin plugin and kotlin package in the app's build.gradle:\n\n```\napply plugin: 'kotlin-android'\ndependencies {\n\timplementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n}\n```\n\n### Device initialization\n\nFirst, create an ITuyaLightDevice object, and the lamp-related methods are encapsulated in this method.\n\n```\nITuyaLightDevice lightDevice = new TuyaLightDevice(String devId);\n```\n\n**Parameter Description**\n\n| parameter | Description |\n| --------- | :---------- |\n| devId     | Device id   |\n\n**Sample code**\n\n```java\n// init lightDevice\nITuyaLightDevice lightDevice = new TuyaLightDevice(\"vdevo159793004250542\");\n```\n\nThis object encapsulates all dp points of the lamp, including the issuance and reporting of control commands.\n\n### Device agent monitoring\n\n**Method description**\n\n```java\n/**\n * register Listener\n */\nvoid registerLightListener(ILightListener listener);\n```\n\nAmong them, the ILightListener callback is as follows:\n\n```java\npublic interface ILightListener {\n    /**\n     * Monitor dp point changes of lighting equipment\n     *\n     * @param dataPoint The state of all dp points of the fixture\n     */\n    void onDpUpdate(LightDataPoint dataPoint);\n\n    /**\n     * remove device\n     */\n    void onRemoved();\n\n    /**\n     * device ststus\n     */\n    void onStatusChanged(boolean online);\n\n    /**\n     * network status\n     */\n    void onNetworkStatusChanged(boolean status);\n\n    /**\n     * Device information update such as name and the like\n     */\n    void onDevInfoUpdate();\n}\n```\n\n**Sample code**\n\n```java\n// create lightDevice\nITuyaLightDevice lightDevice = new TuyaLightDevice(\"vdevo159793004250542\");\n\n// register listener\nlightDevice.registerLightListener(new ILightListener() {\n    @Override\n    public void onDpUpdate(LightDataPoint dataPoint) { // return LightDataPoint，Contains the values of all function points of the lamp\n        Log.i(\"test_light\", \"onDpUpdate:\" + dataPoint);\n    }\n\n    @Override\n    public void onRemoved() {\n        Log.i(\"test_light\", \"onRemoved\");\n    }\n\n    @Override\n    public void onStatusChanged(boolean status) {\n        Log.i(\"test_light\", \"onDpUpdate:\" + status);\n    }\n\n    @Override\n    public void onNetworkStatusChanged(boolean status) {\n        Log.i(\"test_light\", \"onDpUpdate:\" + status);\n    }\n\n    @Override\n    public void onDevInfoUpdate() {\n        Log.i(\"test_light\", \"onDevInfoUpdate:\");\n    }\n});\n```\n\n**`TuyaSmartLightDataPointModel` Data model**\n\n| Field            | Types           | description                                                  |\n| ---------------- | --------------- | ------------------------------------------------------------ |\n| powerSwitch      | boolea          | Whether the switch is on, YES means on, NO means off         |\n| workMode         | LightMode       | Working mode, MODE_WHITE is white light mode; MODE_COLOUR is color light mode; MODE_SCENE is scene mode; |\n| brightness       | int             | Brightness percentage，从1-100                               |\n| colorTemperature | int             | Color temperature percentage，从0-100                        |\n| colourHSV        | LightColourData | Color value, HSV color space; H is hue, value range is 0-360; S is saturation, value range is 0-100; V is lightness, value range is 1-100 |\n| scene            | LightScene      | Lantern scene, * SCENE_GOODNIGHT is good night scene; SCENE_WORK is work scene; SCENE_READ is reading scene; SCENE_CASUAL is leisure scene; |\n\n**Parameter Description**\n\nIt is worth noting that the `LightDataPoint` object, which encapsulates all the function points of the current device. When the function point changes, it will be called back. Each callback will be a complete object.\n\nThe following is the specific meaning of the object parameters:\n\n```java\npublic class LightDataPoint {\n    /**\n     * switch\n     */\n    public boolean powerSwitch;\n    /**\n     * Operating mode。\n     * \u003cp\u003e\n     * MODE_WHITE  White light mode；\n     * MODE_COLOUR  color light mode；\n     * MODE_SCENE Scene mode；\n     */\n    public LightMode workMode;\n\n    /**\n     * Brightness percentage，0~100\n     */\n    public int brightness;\n\n    /**\n     * Color temperature percentage，0~100\n     */\n    public int colorTemperature;\n\n    /**\n     * Color value, HSV color space.\n     * \u003cp\u003e\n     * H，0-360；\n     * S，0-100；\n     * V，0-100；\n     */\n    public LightColourData colorHSV;\n    /**\n     * Lantern scene\n     *\n     * SCENE_GOODNIGHT Good night scene；\n     * SCENE_WORK Work situation；\n     * SCENE_READ Reading situation；\n     * SCENE_CASUAL Casual scene；\n     */\n    public LightScene scene;\n}\n```\n\n**Sample Code**\n\n```\n// Turn on the lights\nlightDevice.powerSwitch(true, new IResultCallback() {\n    @Override\n    public void onError(String code, String error) {\n        Log.i(\"test_light\", \"powerSwitch onError:\" + code + error);\n    }\n\n    @Override\n    public void onSuccess() {\n        Log.i(\"test_light\", \"powerSwitch onSuccess:\");\n    }\n});\n// Good night scene\nlightDevice.scene(LightScene.SCENE_GOODNIGHT, new IResultCallback() {\n    @Override\n    public void onError(String code, String error) {\n        Log.i(\"test_light\", \"scene onError:\" + code + error);\n    }\n\n    @Override\n    public void onSuccess() {\n        Log.i(\"test_light\", \"scene onSuccess:\");\n    }\n});\n// Set color\nlightDevice.colorHSV(100, 100, 100, new IResultCallback() {\n    @Override\n    public void onError(String code, String error) {\n        Log.i(\"test_light\", \"colorHSV onError:\" + code + error);\n    }\n    @Override\n    public void onSuccess() {\n        Log.i(\"test_light\", \"colorHSV onSuccess:\");\n    }\n});\n```\n\n### Get the current lamp type\n\nThe lights are divided into one road light (only white light), two road lights (white light + cooling and heating control), three road lights (only color light mode), four road lights (white light + color light), five lights (white light + color light + cold and warm) .\n\nThese 5 kinds of lamps are different in function definition, and they are different in the development of corresponding UI and control.\n\nThis method can get the current lamp type.\n\n**Interface Description**\n\n```java\n/**\n * Get the current number of lights\n *\n * @return {@link LightType}\n */\nLightType lightType();\n```\n\nAmong them, the types defined in LightType are：\n\n```java\n/**\n * White light，dpCode：bright_value\n */\nTYPE_C,\n/**\n * White light + cold and warm，dpCode：bright_value + temp_value\n */\nTYPE_CW,\n/**\n * RGB，dpCode：colour_data\n */\nTYPE_RGB,\n/**\n * White light+RGB，dpCode：bright_value + colour_data\n */\nTYPE_RGBC,\n/**\n * White light+cold and warm+RGB，dpCode：bright_value + temp_value + colour_data\n */\nTYPE_RGBCW\n```\n\n### Get the values of all functions of the current device\n\nWhen opening a device panel, you need to get all the function point values to display. The LightDataPoint object mentioned above can be obtained through this interface.\n\n```java\n/**\n * Get the value of all function points of the lamp\n */\nLightDataPoint getLightDataPoint();\n```\n\n### switch\n\nControl the light switch\n\n**Interface Description**\n\n```java\n/**\n * Light on or off\n *\n * @param status         true or false\n * @param resultCallback callback\n */\nvoid powerSwitch(boolean status, IResultCallback resultCallback);\n```\n\n**Parameter Description**\n\n| Field          | meaning                                                      |\n| -------------- | ------------------------------------------------------------ |\n| status         | true is on                                                   |\n| resultCallback | It only means that the sending command is successful or failed. The real control success needs to identify the dp change in ILightListener |\n\n### Switch working mode\n\nControl the switching of working modes\n\n**Interface Description**\n\n```java\n/**\n * Switch working mode\n *\n * @param mode           Operating mode\n * @param resultCallback callback\n */\nvoid workMode(LightMode mode, IResultCallback resultCallback);\n```\n\n**Parameter Description**\n\n| Field          | meaning                                                      |\n| -------------- | ------------------------------------------------------------ |\n| mode           | Working mode, its values are MODE_WHITE (white light), MODE_COLOUR (color light), MODE_SCENE (scene mode) |\n| resultCallback | It only means that the sending command is successful or failed. The real control success needs to identify the dp change in ILightListener |\n\n**Call example**\n\nIf switch to IPL mode:\n\n```java\nlightDevice.workMode(LightMode.MODE_COLOUR, new IResultCallback() {\n    @Override\n    public void onError(String code, String error) {\n        Log.i(\"test_light\", \"workMode onError:\" + code + error);\n    }\n\n    @Override\n    public void onSuccess() {\n        Log.i(\"test_light\", \"workMode onSuccess\");\n    }\n});\n```\n\nNote: Some lamps and lanterns must be switched to the corresponding working mode before they can be controlled.\n\n### Control the brightness of the light\n\nControl brightness\n\n**Interface Description**\n\n```java\n/**\n * Brightness control.\n *\n * @param status         Percentage of brightness, value range 0-100\n * @param resultCallback callback\n */\nvoid brightness(int status, IResultCallback resultCallback);\n```\n\n**Parameter Description**\n\n| Field          | meaning                                                      |\n| -------------- | ------------------------------------------------------------ |\n| status         | Percentage of brightness                                     |\n| resultCallback | It only means that the sending command is successful or failed. The real control success needs to identify the dp change in ILightListener |\n\n### Control the color temperature of the light (warm and cold)\n\nControl the heating and cooling value of the lamp\n\n**Interface Description**\n\n```java\n/**\n * Color temperature control\n *\n * @param status         Percentage of color temperature, value range 0-100\n * @param resultCallback callback\n */\nvoid colorTemperature(int status, IResultCallback resultCallback);\n```\n\n**Parameter Description**\n\n| Field          | meaning                                                      |\n| -------------- | ------------------------------------------------------------ |\n| status         | Percentage of color temperature                              |\n| resultCallback | It only means that the sending command is successful or failed. The real control success needs to identify the dp change in ILightListener |\n\n\n### Set the color of the IPL\n\nControl the color of colored lights\n\n**Interface Description**\n\n```java\n/**\n * Set the color of the lantern\n *\n * @param hue            tone （0-360）\n * @param saturation     saturation（0-100）\n * @param value          Lightness（0-100）\n * @param resultCallback callback\n */\nvoid colorHSV(int hue, int saturation, int value, IResultCallback resultCallback);\n```\n\n### Switch scene mode\n\nSwitch the scene mode of the colorful lights. There are currently four modes:\n\n```java\nLightScene.SCENE_GOODNIGHT Good night scene；\nLightScene.SCENE_WORK Work situation；\nLightScene.SCENE_READ Reading situation；\nLightScene.SCENE_CASUAL Casual scene；\n```\n\n**Interface Description**\n\n```java\n/**\n * @param lightScene     {@link LightScene}\n * @param resultCallback callback\n */\nvoid scene(LightScene lightScene, IResultCallback resultCallback);\n```\n\n### Appendix: All standard function points of lamps\n\n| code               | Name                                 | Data type | Value description                                            | Description |\n| ------------------ | ------------------------------------ | --------- | ------------------------------------------------------------ | ----------- |\n| switch_led         | switch                               | Boolean   | {}                                                           |             |\n| work_mode          | mode                                 | Enum      | {\"range\":[\"white\",\"colour\",\"scene\",\"music\",\"scene_1\",\"scene_2\",\"scene_3\",\"scene_4\"]} |             |\n| bright_value       | brightness                           | Integer   | {\"min\":25,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}            |             |\n| bright_value_v2    | brightness                           | Integer   | {\"min\":10,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}           |             |\n| temp_value         | Warm and cold                        | Integer   | {\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}             |             |\n| temp_value_v2      | Warm and cold                        | Integer   | {\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}            |             |\n| colour_data        | Number of IPL Modes                  | Json      | {}                                                           |             |\n| colour_data_v2     | Number of IPL Modes                  | Json      | {}                                                           |             |\n| scene_data         | Number of scene modes                | Json      | {}                                                           |             |\n| scene_data_v2      | Number of scene modes                | Json      | {}                                                           |             |\n| flash_scene_1      | Soft light mode                      | Json      | {}                                                           |             |\n| flash_scene_2      | Fun mode                             | Json      | {}                                                           |             |\n| flash_scene_3      | Colorful mode                        | Json      | {}                                                           |             |\n| flash_scene_4      | Gorgeous mode                        | Json      | {}                                                           |             |\n| music_data         | Music light mode control             | Json      | {}                                                           |             |\n| control_data       | Adjust dp control                    | Json      | {}                                                           |             |\n| countdown_1        | Countdown                            | Integer   | {\"unit\":\"\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}           |             |\n| scene_select       | Scene selection                      | Enum      | {\"range\":[\"1\",\"2\",\"3\",\"4\",\"5\"]}                              | old version |\n| switch_health_read | Healthy reading switch               | Boolean   | {}                                                           | old version |\n| read_time          | Healthy reading-reading time setting | Integer   | {\"unit\":\"minute\",\"min\":1,\"max\":60,\"scale\":0,\"step\":1}        | old version |\n| rest_time          | Healthy reading-rest time setting    | Integer   | {\"unit\":\"minute\",\"min\":1,\"max\":60,\"scale\":0,\"step\":1}        | old version |\n\n### Lamp v1 standard instruction set description\n\n| Features          | code            | Types   | standard value                                               | Example                                                      | Remarks                                                      |\n| ----------------- | --------------- | ------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| switch            | switch_led      | Boolean | true/false   （on/off）                                      | {\"switch_led\":true}                                          |                                                              |\n| mode              | work_mode       | Enum    | \"white\"/\"colour\"/\"scene\"/\"scene_1\"/\"scene_2\"/\"scene_3\"/\"scene_4\" | {\"work_mode\":\"scene\"}                                        |                                                              |\n| brightness        | bright_value_v1 | Integer | 25-255                                                       | {\"bright_value_v1\":100}                                      | Brightness value 25-255, corresponding to actual brightness 10%-100%, the lowest brightness display is 10% |\n| Color temperature | temp_value_v1   | Integer | 0-255                                                        | {\"temp_value_v1\":100\"}                                       | The color temperature range is 0-100, corresponding to the actual color temperature 0%-100%, corresponding to the warmest and coldest ranges respectively. The actual color temperature value depends on the hardware specifications, such as 2700K-6500K |\n| colour            | colour_data_v1  | String  | Value: ”00112233334455”（A string of length 14）\u003cbr\u003e00: R\u003cbr\u003e11: G\u003cbr\u003e22: B\u003cbr\u003e3333: H(Hue)\u003cbr\u003e44: S(Saturation)\u003cbr\u003e55: V(Value)** | {\"colour_data_v2\":\"2700000000ff27\"}                          | The color is transmitted according to the HSV system, or it can be converted to the RGB color system through an algorithm.\u003cbr/\u003eRefer to the URL [https://www.rapidtables.com/convert/color/index.html](https://www.rapidtables.com/ convert/color/index.html)\u003cbr/\u003eYou can get RGB (R,G,B): (HEX)(32,64,C8),(DEC)(50,100,200) |\n| scene             | scene_data      | String  | Value: \"00112233334455\"（A string of length 14）\u003cbr\u003e00: R\u003cbr\u003e11: G\u003cbr\u003e22: B\u003cbr\u003e3333: H(Hue)\u003cbr\u003e44: S(Saturation)\u003cbr\u003e55: V(Value) | {\"work_mode\":\"scene\",\"scene_data\":\"fffcf70168ffff\"}          |                                                              |\n| Soft light scene  | flash_scene_1   | String  | Value :\"00112233445566\"（A string of length 14）\u003cbr\u003e00: brightness(brightness)\u003cbr\u003e11: Color temperature(color Temperature)\u003cbr\u003e22: Frequency of change(frequency)\u003cbr\u003e33：Change the number of groups(01)\u003cbr\u003e445566：R G B | {\"work_mode\":\"scene_1\",\"flash_scene_1\":\"ffff320100ff00\"}     |                                                              |\n| Colorful scene    | flash_scene_3   | String  | Same as above                                                | {\"work_mode\":\"scene_3\",\"flash_scene_3\":\"ffff320100ff00\"}     |                                                              |\n| Colorful scene    | flash_scene_2   | String  | Value:\"00112233445566....445566\"（A string with a length of 14~44）\u003cbr\u003e00: brightness(brightness)\u003cbr\u003e11: Color temperature(color Temperature)\u003cbr\u003e22: Frequency of change(frequency)\u003cbr\u003e33：Change the number of groups(01~06)\u003cbr\u003e445566：R G B\u003cbr\u003eNote: as many groups as there are changes, there are as many as 445566, and the maximum number of groups is 6 groups | {\"work_mode\":\"scene_2\",\"flash_scene_2\":\"ffff5003ff000000ff000000ff\"} |                                                              |\n| Colorful scene    | flash_scene_4   | String  | Same as above                                                | {\"work_mode\":\"scene_4\",\"flash_scene_4\":\"ffff0505ff000000ff00ffff00ff00ff0000ff\"} |                                                              |\n\n### Lamp v2 standard instruction set description\n\n| Features           | code            | Type    | standard value                                               | Example                                                      | Remarks                                                      |\n| ------------------ | --------------- | ------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| switch             | switch_led      | Boolean | true/false   （on/off）                                      | {\"switch_led\":true}                                          |                                                              |\n| mode               | work_mode       | Enum    | \"white\"/\"colour\"/\"scene\"/\"music\"                             | {\"work_mode\":\"scene\"}                                        | The TAB column of white light, color light, scene and music light is determined by DP point: \u003cbr/\u003e\u003cbr/\u003e\"White light\" menu bar: mode and brightness DP are jointly determined\u003cbr/\u003e\"Color light\" menu bar: mode and color DP Joint decision\u003cbr/\u003e\"Scene\" menu bar: Mode and context DP jointly decided\u003cbr/\u003e\"Music light\" menu bar: Mode and music light DP jointly decided\u003cbr/\u003e\"Countdown\": Decided by countdown DP point\u003cbr/\u003e\" Timing\": Determined by cloud function and cloud timing |\n| brightness         | bright_value_v2 | Integer | 10 – 1000                                                    | {\"bright_value_v2\":670}                                      | Brightness value 10-1000, corresponding to actual brightness 1%-100%, the lowest brightness display is 1% |\n| Color temperature  | temp_value_v2   | Integer | 0-1000                                                       | {\"temp_value_v2\":797\"}                                       | The color temperature range is 0-1000, corresponding to the actual color temperature 0%-100%, corresponding to the warmest and coldest range values respectively. The actual color temperature value depends on the hardware specifications, such as 2700K-6500K |\n| colour             | colour_data_v2  | String  | 000011112222\u003cbr\u003e\u003cbr\u003eValue description：\u003cbr\u003e\u003cbr\u003e0000：H（Chroma：0-360，0X0000-0X0168）\u003cbr\u003e\u003cbr\u003e1111：S (saturation：0-1000, 0X0000-0X03E8)\u003cbr\u003e\u003cbr\u003e2222：V (Lightness：0-1000，0X0000-0X03E8)\u003cbr\u003e\u003cbr\u003eHSV (H,S,V): (HEX)(00DC, 004B,004E),Convert to(DEC):(220,75%,78%) | {\"colour_data_v2\":\"00DC004B004E\"}\u003cbr\u003e\u003cbr\u003e                    | The color is transmitted according to the HSV system, and can also be converted to the RGB color system through an algorithm.\u003cbr/\u003e\u003cbr/\u003eReference URL [https://www.rapidtables.com/convert/color/index.html](https://www.rapidtables .com/convert/color/index.html)\u003cbr/\u003e\u003cbr/\u003eYou can get RGB (R,G,B): (HEX)(32,64,C8),(DEC)(50,100,200) |\n| scene              | scene_data_v2   | String  | 0011223344445555666677778888\u003cbr\u003e\u003cbr\u003e00：Scene number\u003cbr\u003e\u003cbr\u003e11：Unit switching interval time（0-100）\u003cbr\u003e\u003cbr\u003e22：Unit change time（0-100）\u003cbr\u003e\u003cbr\u003e33：Unit change mode (0 static 1 jump 2 gradual change)\u003cbr\u003e\u003cbr\u003e4444：H（Chroma：0-360，0X0000-0X0168）\u003cbr\u003e\u003cbr\u003e5555：S (saturation：0-1000, 0X0000-0X03E8)\u003cbr\u003e\u003cbr\u003e6666：V (Lightness：0-1000，0X0000-0X03E8)\u003cbr\u003e\u003cbr\u003e7777：White light brightness（0-1000）\u003cbr\u003e\u003cbr\u003e8888：Color temperature（0-1000）\u003cbr\u003e\u003cbr\u003eNote: The numbers 1-8 correspond to as many groups as there are units | {\"25\":\"010b0a02000003e803e8000000000b0a02007603e803e8000000000b0a0200e703e803e800000000\"} | 01: Scene number 01\u003cbr/\u003e\u003cbr/\u003e0b: Unit switching interval time (0)\u003cbr/\u003e\u003cbr/\u003e0a: Unit change time (10)\u003cbr/\u003e\u003cbr/\u003e02: Unit change mode: Gradual\u003cbr/\u003e \u003cbr/\u003e0000: H (Chroma: 0X0000)\u003cbr/\u003e\u003cbr/\u003e03e8: S (Saturation: 0-1000, 0X0000-0X03E8)\u003cbr/\u003e\u003cbr/\u003e03e8: V (Lightness: 0-1000, 0X0000- 0X03E8)\u003cbr/\u003e\u003cbr/\u003e0000: White light brightness (0-1000)\u003cbr/\u003e\u003cbr/\u003e0000: Color temperature value (0-1000) |\n| Countdown          | countdown_1     | Integer | **0-86400**\u003cbr\u003e**Description：**\u003cbr\u003eThe data unit is second, which corresponds to a value of 60 for one minute, and the maximum setting is 86400=23 hours and 59 minutes.\u003cbr/\u003e0 means off | **{ \"**countdown_1**\":\"120\" }**                              |                                                              |\n| music              | music_data      | String  | 011112222333344445555\u003cbr\u003eDescription：\u003cbr\u003e0：   Change mode, 0 means direct output, 1 means gradual change\u003cbr\u003e\u003cbr\u003e1111：H（Chroma：0-360，0X0000-0X0168）\u003cbr\u003e\u003cbr\u003e2222：S (saturation：0-1000, 0X0000-0X03E8)\u003cbr\u003e\u003cbr\u003e3333：V (Lightness：0-1000，0X0000-0X03E8)\u003cbr\u003e\u003cbr\u003e4444：White light brightness（0-1000）\u003cbr\u003e\u003cbr\u003e5555：Color temperature（0-1000） | {\"music_data\":\"1007603e803e800120025\"}\u003cbr\u003e\u003cbr\u003e0：   Change mode, 0 means direct output, 1 means gradual change\u003cbr\u003e\u003cbr\u003eExample description：\u003cbr\u003e\u003cbr\u003e1：   Change mode, 1 means gradual change\u003cbr\u003e\u003cbr\u003e0076：H（Chroma： 0X0076）\u003cbr\u003e\u003cbr\u003e03e8：S (saturation：0X03e8)\u003cbr\u003e\u003cbr\u003e03e8：：V (Lightness： 0X03e8)\u003cbr\u003e\u003cbr\u003e0012：brightness（18%）\u003cbr\u003e\u003cbr\u003e0025：Color temperature（37%） | This function point and the mode function point together determine whether to display the music light |\n| Adjust DP control  | control_data    | String  | 0：  Change mode, 0 means direct output, 1 means gradual change\u003cbr\u003e1111：H（Chroma：0-360，0 X0000-0X0168 ）\u003cbr\u003e2222： S  ( saturation：0 -1000,  0X0000-0X03E8)\u003cbr\u003e3333： V  (Lightness：0-1000，0 X0000-0X03E8)\u003cbr\u003e4444：White light brightness（0-1000）\u003cbr\u003e5555：Color temperature（0-1000）\u003cbr\u003e | **{** **\"**control_data**\":\"** **10076** **03e803e800120025\"** **}**\u003cbr\u003e1：   Change mode, 1 means gradual change\u003cbr\u003e0076 ：H（Chroma： 0 X0076 ）\u003cbr\u003e03e8 ： S  ( saturation： 0X03e8)\u003cbr\u003e03e8 ：： V  ( Lightness： 0 X03e8)\u003cbr\u003e0012 ：brightness（ 18 %）\u003cbr\u003e0025 ：Color temperature（ 37 %） | This DP is used for real-time data delivery during panel adjustment |\n| Situational change | scene_data_v2   | String  | The specific format of the scenario is as follows: \u003cbr/\u003e00 11 22 33 444455556666 77778888\u003cbr/\u003e\u003cbr/\u003eTab time speed mode color(hsv) white(bright,temper)\u003cbr/\u003e\u003cbr/\u003eExcept for Tab, the rest of the composition is basic At present, the maximum number of scene units can be set to 8\u003cbr/\u003e\u003cbr/\u003ethat is 00 + (11223344445555666677778888)* 8\u003cbr/\u003e\u003cbr/\u003eThe relationship between Time and speed: \u003cbr/\u003e\u003cbr/\u003eThe gradual change and unit switching are currently performed simultaneously , Can reach three change states (only two distributions are carried out)\u003cbr/\u003e\u003cbr/\u003eA: Synchronization is completed: \u003cbr/\u003e\u003cbr/\u003eTo switch to the next unit immediately after the gradual change is completed, send time = speed\u003cbr \u003e\u003cbr/\u003eB:Stopping and waiting after gradual change\u003cbr/\u003e\u003cbr/\u003eFor example, it will achieve 1s to complete the gradual change, and stagnate for 1s to continue the gradual change. Send time = 2, speed = 1\u003cbr/\u003e\u003cbr/\u003eC: Switch in advance\u003cbr/\u003e\u003cbr/\u003eWhen the gradual change time is less than the switching time, it will switch to the next target state to start gradual change during the change, achieving one A relatively random effect of change. Send time\u003cspeed\u003cbr/\u003e\u003cbr/\u003eTime (switching time between each scene unit) 0-100 (unit: 100ms)\u003cbr/\u003e\u003cbr/\u003eThe switching interval of 100ms-10s can be realized, when it is 0, it means to switch directly to the next One unit, but transition from the state of this unit\u003cbr/\u003e\u003cbr/\u003eThe specific figure is as follows:\u003cbr/\u003e\u003cbr/\u003eThe above figure is an example, when the time of unit B is 0, it can be equivalent to the process of changing from A to C , But at the intermediate node X, the light state switches to B and continues to change\u003cbr/\u003e\u003cbr/\u003eSpeed (the gradual speed of the scene unit switching from the last state to the target state) 0-100 (unit HZ)\u003cbr/\u003e\u003cbr/\u003eNote : The current implementation is still using time as a unit, so the fastest is 1 (10khz), and the slowest is 100 (100hz), no need to modify the follow-up negotiation. \u003cbr/\u003e\u003cbr/\u003eThe gradual step of the new version of the light is 1000, so speed = time change time/1000\u003cbr/\u003e\u003cbr/\u003eSet the change time to t\u003cbr/\u003e\u003cbr/\u003eFor example, when speed is issued 1, s = 0.1s/1000 = 10Khz\u003cbr/\u003e\u003cbr/\u003eWhen speed = 0, the change of the current unit will be stagnant, until the unit switching time T is reached, switching to the next target scenario unit will start to change from the stagnant unit to the new unit \u003cbr/\u003e\u003cbr/\u003eMode is the change mode from the current scene unit to the next target scene unit. There are three ways: 0, 1, 2\u003cbr/\u003e\u003cbr/\u003eMode = 0: static scene, when the target scene mode is At 0 o'clock, when the change is completed, the scene change will stop and become a static scene. The speed of change is currently fixed to the breathing time of normal white light and colored light（500ms）。\u003cbr\u003e\u003cbr\u003eMode = 1：Jump mode, when the unit switching time comes, directly switch to the new scenario unit\u003cbr/\u003e\u003cbr/\u003eMode = 2: Gradual mode, when the thread reads the data in the current scenario unit, it changes from the previous scenario unit to the new one Scenes\u003cbr/\u003e\u003cbr/\u003eThe scenes of the new version of the lights can only light up the colored lights, and now it supports the function of white light and colored lights at the same time. |                                                              |                                                              |\n\n\n\n### \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuya%2Ftuya-lighting-android-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuya%2Ftuya-lighting-android-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuya%2Ftuya-lighting-android-sdk/lists"}