Skip to content
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

[FIX] Proper typing for dingzStates type #133

Open
johannrichard opened this issue Nov 23, 2020 · 0 comments
Open

[FIX] Proper typing for dingzStates type #133

johannrichard opened this issue Nov 23, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@johannrichard
Copy link
Owner

johannrichard commented Nov 23, 2020

The internal dingzStates representation is currently typeless. On the other hand, we have a DingzState interface that covers most of this representation. We should therefore bring these to definitions together and fold the dingzStates private property into the DingzState type.

// Outputs
Dimmers: [] as DimmerState[],
WindowCovers: [] as WindowCoveringStates[],
LED: {
on: false,
hsv: '0;0;100',
rgb: 'FFFFFF',
mode: 'hsv',
} as DingzLEDState,
// Inputs
Buttons: {
'1': { event: ButtonAction.SINGLE_PRESS, state: ButtonState.OFF },
'2': { event: ButtonAction.SINGLE_PRESS, state: ButtonState.OFF },
'3': { event: ButtonAction.SINGLE_PRESS, state: ButtonState.OFF },
'4': { event: ButtonAction.SINGLE_PRESS, state: ButtonState.OFF },
},
// Sensors
Temperature: 0 as number,
Motion: false as boolean,
Brightness: 0 as number,
};
private motionTimer?: NodeJS.Timer;

@johannrichard johannrichard changed the title Proper typing for dingzStates type [FIX] Proper typing for dingzStates type Nov 23, 2020
@johannrichard johannrichard self-assigned this Nov 23, 2020
@johannrichard johannrichard added the enhancement New feature or request label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

1 participant