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

def update(self):

    self.data.update()
    self._product = self.data.products[self._product_id]
    if (self._sensortype == 'time'):
        time_estimate = self._product.get('time_estimate_seconds', 0)
        self._state = int((time_estimate / 60))
    elif (self._sensortype == 'price'):
        price_details = self._product.get('price_details')
        if (price_details is not None):
            min_price = price_details.get('minimum')
            self._state = int(price_details.get('low_estimate', min_price))
        else:
            self._state = 0
