'Get the latest data and updates the state.'

def update(self):

    self._data.update()
    if (self._data.data is None):
        return
    elem = next((elem for elem in self._data.data if (get_id(self._sensorid, elem['tag'], elem['name'], elem['id'], elem['userid']) == self._identifier)), None)
    if (elem is None):
        return
    self._elem = elem
    if (self._value_template is not None):
        self._state = self._value_template.render_with_possible_json_value(elem['value'], STATE_UNKNOWN)
    else:
        self._state = round(float(elem['value']), DECIMALS)
