def set_sleep_timer(self, sleep_time_seconds):
        """Sets the sleep timer.

        Args:
            sleep_time_seconds (int or NoneType): How long to wait before
                turning off speaker in seconds, None to cancel a sleep timer.
                Maximum value of 86399

        Raises:
            SoCoException: Upon errors interacting with Sonos controller
            ValueError: Argument/Syntax errors

        """
        # Note: A value of None for sleep_time_seconds is valid, and needs to
        # be preserved distinctly separate from 0. 0 means go to sleep now,
        # which will immediately start the sound tappering, and could be a
        # useful feature, while None means cancel the current timer
        try:
            if sleep_time_seconds is None:
                sleep_time = ''
            else:
                sleep_time = format(
                    datetime.timedelta(seconds=int(sleep_time_seconds))
                )
            self.avTransport.ConfigureSleepTimer([
                ('InstanceID', 0),
                ('NewSleepTimerDuration', sleep_time),
            ])
        except SoCoUPnPException as err:
            if 'Error 402 received' in str(err):
                raise ValueError('invalid sleep_time_seconds, must be integer \
                    value between 0 and 86399 inclusive or None')
            raise
        except ValueError:
            raise ValueError('invalid sleep_time_seconds, must be integer \
                value between 0 and 86399 inclusive or None')
Sets the sleep timer.

        Args:
            sleep_time_seconds (int or NoneType): How long to wait before
                turning off speaker in seconds, None to cancel a sleep timer.
                Maximum value of 86399

        Raises:
            SoCoException: Upon errors interacting with Sonos controller
            ValueError: Argument/Syntax errors