'Get the latest data and updates the state.'

def update(self):

    self.data.update()
    value = self.data.value
    if (self._value_template is not None):
        value = self._value_template.render_with_possible_json_value(value, False)
    if (value == self._payload_on):
        self._state = True
    elif (value == self._payload_off):
        self._state = False
