'Update device state.'

def update(self):

    if self._command_state:
        payload = str(self._query_state())
        if self._value_template:
            payload = self._value_template.render_with_possible_json_value(payload)
        self._state = (payload.lower() == 'true')
