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

        :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).
        """
        response = requests.get(self._get_url('enable', server=server, password=password, api_key=api_key, ssl=ssl),
                                verify=self.verify_ssl)

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

        return response.json()

        Enable a Pi-hole server.

        :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).
        
Enable a Pi-hole server.
Enable a Pi - hole server .
def enable(self, server: Optional[str] = None, password: Optional[str] = None, api_key: Optional[str] = None,
               ssl: bool = None):
        response = requests.get(self._get_url('enable', server=server, password=password, api_key=api_key, ssl=ssl),
                                verify=self.verify_ssl)
        try:
            status = (response.json() or {}).get('status')
            assert status == 'enabled', 'Wrong credentials'
        except Exception as e:
            raise AssertionError('Could not enable the server: {}'.format(response.text or str(e)))
        return response.json()
def enable ( self , server : Optional [ str ] = None , password : Optional [ str ] = None , api_key : Optional [ str ] = None , ssl : bool = None ) : response = requests . get ( self . _get_url ( 'enable' , server = server , password = password , api_key = api_key , ssl = ssl ) , verify = self . verify_ssl ) try : status = ( response . json ( ) or { } ) . get ( 'status' ) assert status == 'enabled' , 'Wrong credentials' except Exception as e : raise AssertionError ( 'Could not enable the server: {}' . format ( response . text or str ( e ) ) ) return response . json ( )
Enable a Pi-hole server.
Enable a Pi - hole server .
"""
        Enable a Pi-hole server.

        :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 ) .
ssl
bool
Set to True if the server uses SSL (default: False).
Set to True if the server uses SSL ( default : False ) .