Skip to content

Commit

Permalink
fix: disabled reset
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed Mar 5, 2023
1 parent cb7481d commit b1f72c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions reactive_home/src/composeables/useLightMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export function useLightMapping({
localEntity.brightness = newEntityState.brightness;
localEntity.lastChanged = newEntityState.lastChanged;

if (newEntityState.value !== unref(expectedValue) && isDisabled) {
if (
newEntityState.value !== unref(expectedValue) &&
isDisabled &&
!isDisabled.value
) {
if (debug) {
console.log(`automation_toggle(${entity.entity_id}): value`);
}
Expand Down Expand Up @@ -71,7 +75,8 @@ export function useLightMapping({
(newEntityState.brightness > expectedBrightnessValue + 1 ||
newEntityState.brightness < expectedBrightnessValue - 1) &&
/** Skip initial value, because it might be different. Let it sync first */
oldEntityState.value
oldEntityState.value &&
!isDisabledBrightness.value
) {
if (debug) {
console.log(`automation_toggle(${entity.entity_id}): brightness`);
Expand Down

0 comments on commit b1f72c7

Please sign in to comment.