mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Updated variable name for readability (#21528)
This commit is contained in:
parent
bfc6f51b25
commit
342ddbfe8c
@ -381,7 +381,7 @@ class Person(RestoreEntity):
|
|||||||
@callback
|
@callback
|
||||||
def _update_state(self):
|
def _update_state(self):
|
||||||
"""Update the state."""
|
"""Update the state."""
|
||||||
latest_home = latest_not_home = latest_gps = latest = None
|
latest_non_gps_home = latest_not_home = latest_gps = latest = None
|
||||||
for entity_id in self._config.get(CONF_DEVICE_TRACKERS, []):
|
for entity_id in self._config.get(CONF_DEVICE_TRACKERS, []):
|
||||||
state = self.hass.states.get(entity_id)
|
state = self.hass.states.get(entity_id)
|
||||||
|
|
||||||
@ -391,12 +391,12 @@ class Person(RestoreEntity):
|
|||||||
if state.attributes.get(ATTR_SOURCE_TYPE) == SOURCE_TYPE_GPS:
|
if state.attributes.get(ATTR_SOURCE_TYPE) == SOURCE_TYPE_GPS:
|
||||||
latest_gps = _get_latest(latest_gps, state)
|
latest_gps = _get_latest(latest_gps, state)
|
||||||
elif state.state == STATE_HOME:
|
elif state.state == STATE_HOME:
|
||||||
latest_home = _get_latest(latest_home, state)
|
latest_non_gps_home = _get_latest(latest_non_gps_home, state)
|
||||||
elif state.state == STATE_NOT_HOME:
|
elif state.state == STATE_NOT_HOME:
|
||||||
latest_not_home = _get_latest(latest_not_home, state)
|
latest_not_home = _get_latest(latest_not_home, state)
|
||||||
|
|
||||||
if latest_home:
|
if latest_non_gps_home:
|
||||||
latest = latest_home
|
latest = latest_non_gps_home
|
||||||
elif latest_gps:
|
elif latest_gps:
|
||||||
latest = latest_gps
|
latest = latest_gps
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user