synology/api.py
def home_mode_set_state(self, state, **kwargs):
        """Set the state of Home Mode"""

        # It appears that surveillance station needs lowercase text
        # true/false for the on switch
        if state not in (HOME_MODE_ON, HOME_MODE_OFF):
            raise ValueError('Invalid home mode state')

        api = self._api_info['home_mode']
        payload = dict({
            'api': api['name'],
            'method': 'Switch',
            'version': api['version'],
            'on': state,
            '_sid': self._sid,
        }, **kwargs)
        response = self._get_json_with_retry(api['url'], payload)

        if response['success']:
            return True

        return False
def home_mode_set_state(self, state, **kwargs):
        """Set the state of Home Mode"""

        # It appears that surveillance station needs lowercase text
        # true/false for the on switch
        if state not in (HOME_MODE_ON, HOME_MODE_OFF):
            raise ValueError('Invalid home mode state')

        api = self._api_info['home_mode']
        payload = dict({
            'api': api['name'],
            'method': 'Switch',
            'version': api['version'],
            'on': state,
            '_sid': self._sid,
        }, **kwargs)
        response = self._get_json_with_retry(api['url'], payload)

        if response['success']:
            return True

        return False
Set the state of Home Mode