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

Update ustellar_ut99911_rgb.yaml #2732

Merged
merged 7 commits into from
Jan 7, 2025
Merged

Conversation

neilmartin83
Copy link
Contributor

Change incorrectly named ID for DP 21 color_mode ID to work_mode. This stops the following log entry:

2025-01-04 16:30:55.116 WARNING (MainThread) [homeassistant.components.light] light.liam_s_monitor_light_bar_rear_rgb_led (<class 'custom_components.tuya_local.light.TuyaLocalLight'>) set to unsupported color mode white, expected one of {<ColorMode.HS: 'hs'>}, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/make-all/tuya-local/issues

DP 21 is a string that changes when you select a different tab in the Smart Life app for the light. With this change it now shows as an attribute properly (screenshot below) and updates when I page through the different tabs in the app:

{\"abilityId\":21,\"accessMode\":\"rw\",\"code\":\"work_mode\",\"description\":\"调色场景、动态模式、场景模式、音乐场景,白光模式\",\"extensions\":{\"iconName\":\"icon-dp_mode\"},\"name\":\"模式\",\"typeSpec\":{\"range\":[\"color\",\"dynamic_mod\",\"scene_mod\",\"music\",\"white\"],\"type\":\"enum\",\"typeDefaultValue\":\"color\"}},
image

@neilmartin83
Copy link
Contributor Author

Thinking about it - I'll move the entity to its own text sensor rather than it being an attribute of one of the light entities (as this has 2). Will have a play and submit another commit shortly.

@neilmartin83
Copy link
Contributor Author

Moved it to a select entity in the configuration section. It can be set in HA and does change device behaviour. The Smart Life app also changes the selected tab automatically too.

image

Add descriptive values for DP 103 - it denotes the RGB order for the LED strip on the back.

The value can be changed, so this could be a select entity. However I don't see the point of this as it's configured in the factory for the LED strip on the device so users should never change it from the original setting. It will just mess up the colour representation on the LED strip. But it is useful to know the string value to better understand the spec of the LED strip on one of these light bars.
@neilmartin83
Copy link
Contributor Author

Also made a change to the attribute represented by DP 103 so it's more descriptive/useful:

image

Copy link
Owner

@make-all make-all left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the light supports white, then white should be added to colour modes. Otherwise, what is the behaviour of the light when white is selected?

If white is not supported. then color_mode is not really necessary, as it is always hs, but in that case renaming to effect keeps it within the light, and "color" in that case should map to "off" (for no effect selected), and if "white" basically does nothing, then map that to "off" as well and mark it hidden as there is no reason to select it from HA, it is just there because of a bug when controlled by the app.

@neilmartin83
Copy link
Contributor Author

DP 21 doesn't look to relates with HA's color_mode. It's related to the page/tab you have open in the Smart Life app and if you're using a Dynamic Mode or Scene. From more experimentation we can remove it entirely as it's not useful to change it from HA and doesn't offer any more functionality for the light bar beyond the provided entities. Updating other entities in HA also change values of this one.

Out of curiosity, I observed the following:

Changing this to white selects the White page in the Smart Life app if it's open:

86CA7BA3-DFD7-495C-A30F-08645F107E93_1_102_o

Light behaviour does not change.

Changing this to color selects this page in the Smart Life app:

8648A482-F4CD-4043-9B21-C6406C650536_1_102_o

No change to the light.

dynamic_mod and scene_mod both select this page in the Smart Life app but with different functionality being available. The light also changes behaviour to switch between a mode or scene respectively.

dynamic_mod:

You can change the sliders and select one of the modes in the blue circle at the top. The modes correspond to the Modes select entity in HA so if you change that, this also changes to dynamic_mod.

6E32A00B-5DE5-491C-9C38-5FED124AB103_1_102_o

scene_mod:

You can select one of the scenes at the bottom (Party etc). Sliders are greyed out/not selectable. The scenes correspond to the Scene select entity in HA so if you change that, this DP also changes to scene_mod.

A42D6D83-E4C1-4E13-86A1-B30AE374D462_1_102_o

@make-all
Copy link
Owner

make-all commented Jan 5, 2025

Maybe it is best then to rename the attribute to app_mode to clearly show it is linked to the app. But leave it as an attribute, not as a separate select. Just make sure it is possible to switch between scene, dynamic and plain color modes without that dp (ie adjusting other dps will automatically switch in all cases).

@neilmartin83
Copy link
Contributor Author

neilmartin83 commented Jan 5, 2025

Yeah - have added it back as an attribute with the name app_mode but with values mapped to their corresponding tabs in the app.

The attribute is changing value as expected when I adjust other DPs.

Thank you for the guidance!

neilmartin83 and others added 2 commits January 5, 2025 13:17
- don't bother to map values for app_mode, as the original values are enough to identify the meaning, and the attribute is not important enough to add the extra complexity.

- revert dp 103 type to string, it seems the review comment was misinterpreted.

PR make-all#2732
@neilmartin83
Copy link
Contributor Author

👍😊

@make-all make-all merged commit 7d8ce77 into make-all:main Jan 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants