platypush/plugins/pihole/__init__.py
def disable(self, server: Optional[str] = None, password: Optional[str] = None, api_key: Optional[str] = None,
                seconds: Optional[int] = None, ssl: bool = None):
        """
        Disable a Pi-hole server.

        :param seconds: How long the server will be disabled in seconds (default: None, indefinitely).
        :param server: Server IP address (default: default configured ``server`` value).
        :param password: Server password (default: default configured ``password`` value).
        :param api_key: Server API key (default: default configured ``api_key`` value).
        :param ssl: Set to True if the server uses SSL (default: False).
        """
        if seconds:
            response = requests.get(self._get_url('', server=server, password=password, api_key=api_key,
                                                  ssl=ssl, disable=seconds), verify=self.verify_ssl)
        else:
            response = requests.get(self._get_url('disable', server=server, password=password, api_key=api_key,
                                                  ssl=ssl), verify=self.verify_ssl)

        try:
            status = (response.json() or {}).get('status')
            assert status == 'disabled', 'Wrong credentials'
        except Exception as e:
            raise AssertionError('Could not disable the server: {}'.format(response.text or str(e)))

        return response.json()

        Disable a Pi-hole server.

        :param seconds: How long the server will be disabled in seconds (default: None, indefinitely).
        :param server: Server IP address (default: default configured ``server`` value).
        :param password: Server password (default: default configured ``password`` value).
        :param api_key: Server API key (default: default configured ``api_key`` value).
        :param ssl: Set to True if the server uses SSL (default: False).
        
Disable a Pi-hole server.
Disable a Pi - hole server .
def disable(self, server: Optional[str] = None, password: Optional[str] = None, api_key: Optional[str] = None,
                seconds: Optional[int] = None, ssl: bool = None):
        if seconds:
            response = requests.get(self._get_url('', server=server, password=password, api_key=api_key,
                                                  ssl=ssl, disable=seconds), verify=self.verify_ssl)
        else:
            response = requests.get(self._get_url('disable', server=server, password=password, api_key=api_key,
                                                  ssl=ssl), verify=self.verify_ssl)
        try:
            status = (response.json() or {}).get('status')
            assert status == 'disabled', 'Wrong credentials'
        except Exception as e:
            raise AssertionError('Could not disable the server: {}'.format(response.text or str(e)))
        return response.json()
def disable ( self , server : Optional [ str ] = None , password : Optional [ str ] = None , api_key : Optional [ str ] = None , seconds : Optional [ int ] = None , ssl : bool = None ) : if seconds : response = requests . get ( self . _get_url ( '' , server = server , password = password , api_key = api_key , ssl = ssl , disable = seconds ) , verify = self . verify_ssl ) else : response = requests . get ( self . _get_url ( 'disable' , server = server , password = password , api_key = api_key , ssl = ssl ) , verify = self . verify_ssl ) try : status = ( response . json ( ) or { } ) . get ( 'status' ) assert status == 'disabled' , 'Wrong credentials' except Exception as e : raise AssertionError ( 'Could not disable the server: {}' . format ( response . text or str ( e ) ) ) return response . json ( )
Disable a Pi-hole server.
Disable a Pi - hole server .
"""
        Disable a Pi-hole server.

        :param seconds: How long the server will be disabled in seconds (default: None, indefinitely).
        :param server: Server IP address (default: default configured ``server`` value).
        :param password: Server password (default: default configured ``password`` value).
        :param api_key: Server API key (default: default configured ``api_key`` value).
        :param ssl: Set to True if the server uses SSL (default: False).
        """
self
server
Optional[str]
Server IP address (default: default configured ``server`` value).
Server IP address ( default : default configured ` ` server ` ` value ) .
password
Optional[str]
Server password (default: default configured ``password`` value).
Server password ( default : default configured ` ` password ` ` value ) .
api_key
Optional[str]
Server API key (default: default configured ``api_key`` value).
Server API key ( default : default configured ` ` api_key ` ` value ) .
seconds
Optional[int]
None
ssl
bool
Set to True if the server uses SSL (default: False).
Set to True if the server uses SSL ( default : False ) .