Adds the given IP address to the specified set.

        If timeout is specified, the IP will stay in the set for the given
        duration. Else it will stay in the set during the set default timeout.

        timeout must be given in seconds.

        The resulting command looks like this:

        ``nft add element inet firewall ellis_blacklist4 { 192.0.2.10 timeout 30s }``

async def add(self, setname, ip, timeout):
        """
        Adds the given IP address to the specified set.

        If timeout is specified, the IP will stay in the set for the given
        duration. Else it will stay in the set during the set default timeout.

        timeout must be given in seconds.

        The resulting command looks like this:

        ``nft add element inet firewall ellis_blacklist4 { 192.0.2.10 timeout 30s }``

        """
        # We have to double-quote the '{' '}' at both ends for `format` to work.
        if timeout > 0:
            to_ban = "{{ {0} timeout {1}s }}".format(ip, timeout)
        else:
            to_ban = "{{ {0} }}".format(ip)

        args = ['add', 'element', self.table_family, self.table_name, setname, to_ban]

        return await self.start(__class__.CMD, *args)