-
Notifications
You must be signed in to change notification settings - Fork 3k
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 tuya.ts #7756
Update tuya.ts #7756
Conversation
Added new device: '_TZE204_dapwryy7' ('5.8 GHz human presence sensor')
correcting lint fail.
next try to comply with lint :)
last try
], | ||
meta: { | ||
tuyaDatapoints: [ | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also return a presence
here (a boolean) and add e.presence()
to exposes
? Example:
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and tested :)
Now I have to figure out how to get it in here haha. Let's try this
[ | |
[ | |
1, | |
null, | |
{ | |
from: (v) => { | |
const lookup = {none: tuya.enum(0), presence: tuya.enum(1), peaceful: tuya.enum(2), 'small movement': tuya.enum(3), 'large movement': tuya.enum(4)}; | |
const presenceState = Object.entries(lookup).find((i) => i[1].valueOf() === v)[0]; | |
return { | |
presence: presenceState != 'none', | |
presence_state: presenceState, | |
}; | |
}, | |
}, | |
], |
Could you also submit a picture for the docs? This can be done by:
Make sure that:
|
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions implemented-
], | ||
meta: { | ||
tuyaDatapoints: [ | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and tested :)
Now I have to figure out how to get it in here haha. Let's try this
[ | |
[ | |
1, | |
null, | |
{ | |
from: (v) => { | |
const lookup = {none: tuya.enum(0), presence: tuya.enum(1), peaceful: tuya.enum(2), 'small movement': tuya.enum(3), 'large movement': tuya.enum(4)}; | |
const presenceState = Object.entries(lookup).find((i) => i[1].valueOf() === v)[0]; | |
return { | |
presence: presenceState != 'none', | |
presence_state: presenceState, | |
}; | |
}, | |
}, | |
], |
toZigbee: [tuya.tz.datapoints], | ||
onEvent: tuya.onEventSetTime, | ||
exposes: [ | ||
e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e | |
e.presence(), | |
e |
src/devices/tuya.ts
Outdated
1, | ||
'presence_state', | ||
tuya.valueConverterBasic.lookup({ | ||
'none': tuya.enum(0), | ||
'presence': tuya.enum(1), | ||
'peaceful': tuya.enum(2), | ||
'small movement': tuya.enum(3), | ||
'large movement': tuya.enum(4), | ||
}), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1, | |
'presence_state', | |
tuya.valueConverterBasic.lookup({ | |
'none': tuya.enum(0), | |
'presence': tuya.enum(1), | |
'peaceful': tuya.enum(2), | |
'small movement': tuya.enum(3), | |
'large movement': tuya.enum(4), | |
}), | |
], |
Could you update your code with these changes? |
added - a boolean presence return value and - e.presence() to exposes
Done ... I think. I've lost track of things a bit. |
The model name was changed because there was already a picture with the previous model name.
thanks! |
Added new device:
'_TZE204_dapwryy7'
('5.8 GHz human presence sensor')