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

[BUG] Fix updateDimmerState() for dimmers in startup mode #120

Closed
johannrichard opened this issue Nov 18, 2020 · 0 comments
Closed

[BUG] Fix updateDimmerState() for dimmers in startup mode #120

johannrichard opened this issue Nov 18, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@johannrichard
Copy link
Owner

johannrichard commented Nov 18, 2020

Describe the bug
The following piece of code is triggered when updateDimmerState is called for dimmers when "starting up". In that case, state is null/undefined. The current if/else is a workaround that should be fixed by properly checking whether we want to update a dimmer that's in fact configured as a blind motor.

if (state) {
if (output && output !== 'non_dimmable') {
newService
.getCharacteristic(this.platform.Characteristic.Brightness)
.updateValue(state.value);
}
newService
.getCharacteristic(this.platform.Characteristic.On)
.updateValue(state.on);
} else {
this.platform.log.warn(
'We have an issue here: state should be non-empty but is undefined.',
'Continue here, not killing myself anymore.',
`For the records, device: ${this.device.address} - id: ${id}, index: ${index} and output is: `,
JSON.stringify(this.dingzStates),
);
}

To Reproduce

  • Use two dimmers as a blind
  • Observe the log

Expected behavior

  • No error / plugin-killig
@johannrichard johannrichard added the bug Something isn't working label Nov 18, 2020
@johannrichard johannrichard self-assigned this Nov 18, 2020
@johannrichard johannrichard changed the title [BUG] Fix updateDimmerState() for dimmers in "blind" mode [BUG] Fix updateDimmerState() for dimmers in startup mode Nov 19, 2020
johannrichard added a commit that referenced this issue Dec 12, 2020
- remove reference to #103, #116, #120, #123 (all implemented by now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant