Skip to content

Commit 7e726ad

Browse files
authored
Merge pull request #67 from chazzu/v2.1.1
v2.1.1 fix inversion if ignore_off settings
2 parents ad34b75 + eb70a58 commit 7e726ad

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 2.1.1
6+
7+
### Fixed
8+
9+
- ignore_off logic was inverted
10+
511
## 2.1.0
612

713
### Fixed

custom_components/animated_scenes/animations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def add_light(self, entity_id: str) -> None:
391391
if state is None:
392392
_LOGGER.warning("Entity %s not found, skipping", entity_id)
393393
return
394-
if entity_id not in self._active_lights and (state.state != "off" or not self._ignore_off):
394+
if entity_id not in self._active_lights and (state.state != "off" or self._ignore_off):
395395
self._active_lights.append(entity_id)
396396

397397
def add_lights(self, ids: list) -> None:
@@ -790,7 +790,7 @@ def pick_lights(self, change_amount: int) -> list[str]:
790790
If `ignore_off` is enabled the method filters out lights that are
791791
currently off when selecting a random subset.
792792
"""
793-
if self._ignore_off:
793+
if not self._ignore_off:
794794
to_change: list = []
795795
randomized_list: list = sample(self._active_lights, k=change_amount)
796796
for light in randomized_list:

0 commit comments

Comments
 (0)