'Get the latest data and updates the state.'

def update(self):

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