-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Add device_tracker home enter/leave triggers #158083
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
base: dev
Are you sure you want to change the base?
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
| # The trigger should never fire if the previous state was not the from state | ||
| if not to_state or not self.is_from_state(from_state, to_state): | ||
| # The trigger should never fire if the new state is not the to state | ||
| if not to_state or not self.is_to_state(to_state): |
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.
just moved the is_to_state up to keep the not to_state check on the same line.
it was weird to see not to_state on a line that is checking the "from_state"
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.
The design of this whole part feels a little confusing at this point to me.
Maybe you could try to experiment with something similar to what I suggested here: #156959 (comment)
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.
Yeah, I fully agree.
I was also discussing that with Erik when I opened this PR (I wasn't aware of the discussion you linked). I'll open a separate PR updating the names, and keep this one as draft for now.
Proposed change
SSIA.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: