home-assistant / core Public
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
Track number of persons in a Zone #68473
Conversation
This reverts commit 5289935.
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( |
for person in persons: | ||
state = self.hass.states.get(person) | ||
if ( | ||
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.
This is guaranteed because it is returned by hass.states.async_entity_ids()
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.
sure, but typing requires us to check it, as get()
can return None
.
Proposed change
This reverts the revert #65344
Implements state of a Zone, based on the state of persons. Instead of the previous approach (that used object IDs and coordinates), this approach only relies on the actual state of person (and thus the device tracker) entity.
home
for the zone. This makes device_trackers like ping work when tied to a person (without providing a coordinate)not_home
, we ignore the state of the person. We don't know where they are.Type of change
Additional information
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: