'Update the states of Neato switches.'

def update(self):

    _LOGGER.debug('Running    switch    update')
    self.neato.update_robots()
    try:
        self._state = self.robot.state
    except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError) as ex:
        _LOGGER.warning('Neato    connection    error:    %s', ex)
        self._state = None
        return
    _LOGGER.debug('self._state=%s', self._state)
    if (self.type == SWITCH_TYPE_CLEAN):
        if ((self.robot.state['action'] == 1) or (self.robot.state['action'] == 2) or ((self.robot.state['action'] == 3) and (self.robot.state['state'] == 2))):
            self._clean_state = STATE_ON
        else:
            self._clean_state = STATE_OFF
        _LOGGER.debug('Clean    state:    %s', self._clean_state)
    if (self.type == SWITCH_TYPE_SCHEDULE):
        _LOGGER.debug('State:    %s', self._state)
        if self.robot.schedule_enabled:
            self._schedule_state = STATE_ON
        else:
            self._schedule_state = STATE_OFF
        _LOGGER.debug('Shedule    state:    %s', self._schedule_state)
