def update(self):
        if not self.last_seen:
            return
        elif self.location_name:
            self._state = self.location_name
        elif self.gps is not None:
            zone_state = zone.active_zone(self.hass, self.gps[0], self.gps[1],
                                          self.gps_accuracy)
            if zone_state is None:
                self._state = STATE_NOT_HOME
            elif zone_state.entity_id == zone.ENTITY_ID_HOME:
                self._state = STATE_HOME
            else:
                self._state = zone_state.name

        elif self.stale():
            self._state = STATE_NOT_HOME
            self.last_update_home = False
        else:
            self._state = STATE_HOME
            self.last_update_home = True
MySQL put index routine
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/device_tracker/__init__.py/Device.update--crossover with--dataset/ETHPy150Open neurodata/ndstore/ocpca/askvio.py/AerospikeKVIO.putIndex