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

Sync lamp info #95

Merged
merged 9 commits into from
Aug 20, 2024
Merged
Prev Previous commit
Next Next commit
Add condition to avoid a crash
  • Loading branch information
BinaryBrain committed Aug 18, 2024
commit 6ff04296c06c2b12fe61735c365e3381a7d9e826
6 changes: 4 additions & 2 deletions server/lamp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ export function initLamp() {
// We set the default value to the current one to sync clients
if (currentCharacteristics[animationName]) {
for (let i = 0; i < options.length; i++) {
options[i].currentCharacteristicValue =
currentCharacteristics[animationName][i].value;
if (typeof currentCharacteristics[animationName][i]?.value !== "undefined") {
options[i].currentCharacteristicValue =
currentCharacteristics[animationName][i].value;
}
}
} else {
options.forEach((option) => {
Expand Down
Loading