'Get the latest data from the Lyft API and update the states.'

def update(self):

    self.data.update()
    try:
        self._product = self.data.products[self._product_id]
    except KeyError:
        return
    self._state = None
    if (self._sensortype == 'time'):
        eta = self._product['eta']
        if ((eta is not None) and eta.get('is_valid_estimate')):
            time_estimate = eta.get('eta_seconds')
            if (time_estimate is None):
                return
            self._state = int((time_estimate / 60))
    elif (self._sensortype == 'price'):
        estimate = self._product['estimate']
        if ((estimate is not None) and estimate.get('is_valid_estimate')):
            self._state = (int(((estimate.get('estimated_cost_cents_min', 0) + estimate.get('estimated_cost_cents_max', 0)) / 2)) / 100)
