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
feat: Add rotation data to Philips Hue Tap Dial #6321
Conversation
src/lib/philips.ts
Outdated
const adjustedTime = direction === 'right' ? time : 256 - time; | ||
const dialType = 'rotate'; | ||
const speed = adjustedTime <= 25 ? 'step' : adjustedTime <= 75 ? 'slow' : 'fast'; | ||
payload.action = `${button}_${dialType}_${direction}_${speed}`; | ||
payload.time = adjustedTime; | ||
payload.direction = direction; | ||
payload.type = 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.
Please prefix these with action
, e.g. action_direction
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.
✔️
src/lib/exposes.ts
Outdated
@@ -615,6 +615,9 @@ export const presets = { | |||
// Specific | |||
ac_frequency: () => new Numeric('ac_frequency', access.STATE).withLabel('AC frequency').withUnit('Hz').withDescription('Measured electrical AC frequency'), | |||
action: (values: string[]) => new Enum('action', access.STATE, values).withDescription('Triggered action (e.g. a button click)'), | |||
action_type: (values: string[]) => new Enum('action_type', access.STATE, values).withDescription('Type of the rotation, value in the first message is `step` and in the next messages value is `rotate`'), |
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.
It is not needed to put them here as these are not generic, so in the definition exposes
use e.g.
e.enum('action_type', access.STATE, ['step', 'rotate']).withDescription('Type of the rotation, value in the first message is `step` and in the next messages value is `rotate`')
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.
Taken care of
Thanks! |
Philips Hue Tap Dial
switch. This enables more precise automation controls as it exposes the data about the rotation.time
,direction
,type