Fix tuya custom attributes types. #1260
Merged
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per their documentation, those are u8, not u16: https://developer.tuya.com/en/docs/connect-subdevices-to-gateways/tuya-zigbee-lighting-access-standard?id=K9ik6zvod83fi#title-7-Color%20Control%20cluster
I have a TS0505B and:
tuyaRgbMode
UNSUPPORTED_ATTRIBUTE
fromtuyaBrightness
.Not sure if the PR matches the symptoms but at least it should respect the doc now.
I'm not sure how I can get ember to log frames so that I can check that the data type matches what we get from the protocol when reading the attribute. (Spec, section 2.5.2.1.5.
I'll let you decide if you're confident enough that this should be merged anyway.
Side note: it would be nice if from the dev console we could read attributes from their IDs, manually specifying cluster ID, attribute id, and output type, bypassing the hardcoded values. This is especially relevant when trying to read non-standard attributes (whose type may differ from one manufacturer to the other), or when trying to set attributes with directly the manufacturer's datasheet at hand.
Same for commands. Is there a tool that already allows doing that?
Context: With my Tuya light when I ask it to turn on with a specific RGB value it first sends a command to turn on, which brings back the state before turn off, then transitions to new color (in 0.1 seconds at best). That is an issue for night lights, that will first turn on to day-color light before transitioning to red. I'm trying to debug this, hopefully by casting a command that will do both. Scene restoration instantly puts it in the correct mode so I assume there's a way to do that, maybe by registering a scene then instantly applying it, maybe by something like this. However direct scene insertion currently seems to only create scenes with
{"currentHue":253,"currentSaturation":254}
although it respects brightness, so it may be broken as well to some extent, since Tuya scene data is suposed to be able to store HSV.Side note 2: I can see that Tuya isn't necessary the best at respecting the standard and not having such weird quirks. Who is? Thanks! 🙏😊