-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add two private attributes for SR-ZG9040A/ZG9041A-D. #8210
Conversation
maginawin
commented
Oct 28, 2024
- External Switch Type
- Minimum PWM
1. External Switch Type 2. Minimum PWM
src/devices/sunricher.ts
Outdated
]; | ||
|
||
const onEvent: OnEvent = async (type, data, device) => { | ||
await readAttributeIfOnline(type, data, device, attribute); |
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.
I think these only need to be read one time after the device has joined? If yes, put them in a configure
.
src/devices/sunricher.ts
Outdated
|
||
const toZigbee: Tz.Converter[] = [ | ||
{ | ||
key: ['minimumPWM'], |
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.
key: ['minimumPWM'], | |
key: ['minimum_pwm'], |
src/devices/sunricher.ts
Outdated
|
||
const exposes: Expose[] = [ | ||
e | ||
.numeric('minimumPWM', ea.ALL) |
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.
.numeric('minimumPWM', ea.ALL) | |
.numeric('minimum_pwm', ea.ALL) |
src/devices/sunricher.ts
Outdated
const attribute = 0x8803; | ||
const dataType = 0x20; | ||
const valueMap: {[key: number]: string} = { | ||
0: 'Push button', |
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.
Please make all snake_case
, also valueLookup
below
src/devices/sunricher.ts
Outdated
} satisfies Tz.Converter, | ||
]; | ||
|
||
const exposes: Expose[] = [e.enum('externalSwitchType', ea.ALL, ['Push button', 'Normal on/off', 'Three way']).withLabel('External Switch Type')]; |
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.
const exposes: Expose[] = [e.enum('externalSwitchType', ea.ALL, ['Push button', 'Normal on/off', 'Three way']).withLabel('External Switch Type')]; | |
const exposes: Expose[] = [e.enum('external_switch_type', ea.ALL, ['push_button', 'normal_on_off', 'three_way']).withLabel('External switch type')]; |
1. External Switch Type 2. Minimum PWM
Hi @Koenkk , thank you for your detailed suggestions, I've modified them. |
Thanks! |
@maginawin Hi, this change seems aimed at SR-ZG9040A/ZG9041A-D but it also affects https://www.zigbee2mqtt.io/devices/ZG9101SAC-HP-Switch.html. |