Skip to content

Commit

Permalink
fix: only send brightness and rgb if changed
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed Dec 20, 2023
1 parent 37394c7 commit 4a5abf7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions reactive_home/src/composeables/useNewLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function useNewLight(state: FullfilledUseState, debug = false) {
// `call(${state.value.entity_id}): updateHASSState (via value change)`
// );
// }
updateHASSState(newValue, localValues.brightness, localValues.rgbColor);
updateHASSState(newValue);
},
});

Expand All @@ -127,7 +127,7 @@ export function useNewLight(state: FullfilledUseState, debug = false) {
// `call(${state.value.entity_id}): updateHASSState (via brightness change)`
// );
// }
updateHASSState(localValues.value, newValue, localValues.rgbColor);
updateHASSState(localValues.value, newValue);
},
});

Expand All @@ -148,11 +148,7 @@ export function useNewLight(state: FullfilledUseState, debug = false) {
localValues.rgbColor = newValue;
localValues.lastChanged = new Date();

updateHASSState(
localValues.value,
localValues.brightness,
localValues.rgbColor
);
updateHASSState(localValues.value, undefined, localValues.rgbColor);
},
});

Expand Down

0 comments on commit 4a5abf7

Please sign in to comment.