add support for tuya devices#2102
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
Test Results 67 files 432 suites 0s ⏱️ Results for commit 5b9c034. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 5b9c034 |
ba8b84d to
f822692
Compare
| supported_capabilities = { | ||
| capabilities.button | ||
| }, |
There was a problem hiding this comment.
this field doesn't do anything in sub-drivers
f822692 to
7b0383c
Compare
80f6709 to
41fd4b1
Compare
|
@inasail revise finished |
| -- limitations under the License. | ||
|
|
||
| local capabilities = require "st.capabilities" | ||
| local OnOff = (require "st.zigbee.zcl.clusters").OnOff |
There was a problem hiding this comment.
is there any meaning about brackets?
I think below way is more common that is used better in other drivers.
local clusters = require "st.zigbee.zcl.clusters"
local OnOff = clusters.OnOff
There was a problem hiding this comment.
Thank you for your comment, we will change it
| -- reverse direction | ||
| if reverseCurtainDirectionPrefValue == true then | ||
| tuya_utils.send_tuya_command(device, '\x05', tuya_utils.DP_TYPE_ENUM, '\x01', packet_id) | ||
| packet_id = (packet_id + 1) % 65536 |
There was a problem hiding this comment.
why don't you make a function like below?
function increase_packet_id()
packet_id = (packet_id + 1) % 65536
end
| local function tuya_cluster_handler(driver, device, zb_rx) | ||
| local window_shade_level_event, window_shade_val_event | ||
| local raw = zb_rx.body.zcl_body.body_bytes | ||
| local dp = raw:byte(3) |
There was a problem hiding this comment.
what means dp? data point? can you explain the variable name?
There was a problem hiding this comment.
Yes, that means data ponit, it is a Tuya data payload, we will explain it in our code.
| device:send(device_management.build_bind_request(device, Basic.ID, driver.environment_info.hub_zigbee_eui)) | ||
| end | ||
|
|
||
| local function tuya_cluster_handler(driver, device, zb_rx) |
There was a problem hiding this comment.
if possible, why don't you move all tuay_cluster_handler()s to tuya_utils.lua?
There was a problem hiding this comment.
After investigating about Tuya devices, each Tuya device has its specific tuay_cluster_handler() logic, so it is hard for us to move all tuay_cluster_handler()s to tuya_utils.lua
2484a39 to
d653ba0
Compare
d653ba0 to
5b9c034
Compare
Check all that apply
Type of Change
Checklist
Description of Change
add support for tuya devices
Summary of Completed Tests