feat: add option to ignore unavailable entities #136
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to the
stateful_scenes
custom component, allowing it to ignore entities that are in an unavailable state. Additionally, it includes some code refactoring and improvements to the handling of scene states. The most important changes are:New Feature: Ignore Unavailable Entities
ignore_unavailable
configuration option to theStatefulScenes
component, allowing users to specify whether entities in an unavailable state should be ignored. (custom_components/stateful_scenes/StatefulScenes.py
,custom_components/stateful_scenes/config_flow.py
,custom_components/stateful_scenes/const.py
,custom_components/stateful_scenes/switch.py
,custom_components/stateful_scenes/translations/en.json
,custom_components/stateful_scenes/translations/nl.json
,custom_components/stateful_scenes/translations/sk.json
) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]Code Refactoring
StatefulScenes.py
to improve readability. (custom_components/stateful_scenes/StatefulScenes.py
)Scene State Handling
check_all_states
method to correctly handle unavailable entities, ensuring that the scene is considered off if all entities are unavailable. (custom_components/stateful_scenes/StatefulScenes.py
)Switch Entity Enhancements
IgnoreUnavailable
switch entity to manage the newignore_unavailable
feature. (custom_components/stateful_scenes/switch.py
)These changes enhance the flexibility and robustness of the
stateful_scenes
component, making it more resilient to entities that may become unavailable.