From 342ddbfe8ccc6679205c9c7805c1c38b6be04871 Mon Sep 17 00:00:00 2001 From: Victor Vostrikov <1998617+gorynychzmey@users.noreply.github.com> Date: Thu, 28 Feb 2019 13:05:39 +0100 Subject: [PATCH] Updated variable name for readability (#21528) --- homeassistant/components/person/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/person/__init__.py b/homeassistant/components/person/__init__.py index 622ca0608ac..e6f83b80ba4 100644 --- a/homeassistant/components/person/__init__.py +++ b/homeassistant/components/person/__init__.py @@ -381,7 +381,7 @@ class Person(RestoreEntity): @callback def _update_state(self): """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, []): state = self.hass.states.get(entity_id) @@ -391,12 +391,12 @@ class Person(RestoreEntity): if state.attributes.get(ATTR_SOURCE_TYPE) == SOURCE_TYPE_GPS: latest_gps = _get_latest(latest_gps, state) 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: latest_not_home = _get_latest(latest_not_home, state) - if latest_home: - latest = latest_home + if latest_non_gps_home: + latest = latest_non_gps_home elif latest_gps: latest = latest_gps else: