'Get the latest data from Influxdb and updates the states.'

def update(self):

    self.data.update()
    value = self.data.value
    if (value is None):
        value = STATE_UNKNOWN
    if (self._value_template is not None):
        value = self._value_template.render_with_possible_json_value(str(value), STATE_UNKNOWN)
    self._state = value
