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
Conditions state_filter support #11539
Conversation
I believe this is possible already, albeit in a slightly different syntax:
- or -
|
From my testings, the above syntax for checking multiple states do not work. |
if (!c.entity) return false; | ||
if (c.state && typeof c.state !== "string") return false; | ||
if (c.state_not && typeof c.state_not !== "string") return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't not merge all if states into a huge if a and b or c and d or e and f. Since that would make it unreadable.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Had forgotten about this one. Will resolve reviews. |
@elupus friendly ping :) (would've helped me out today 😬 ) |
So pitty this is not delivered 🥲 |
Is this PR reviewed already? |
Yes though, i have not tested it much after i resolved comments. |
This one seems to be stuck? |
We discussed this, and think this is not the way to go.
- condition: state
entity_id: sensor.weather_precip
state: "rain"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20 We agree Therefor I am going to close this PR, thanks for willing to contribute and if you want to continue based on the above, feel free to open a new PR! |
Proposed change
Support state_filter for conditional cards. This behaves the same as entity-filter.
I think eventually state and state_not should probably be removed, but that would be an ugly breaking change.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: