

def __init__(self, api_url, username=None, password=None):
    'Initialize NZBGet API and set headers needed later.'
    self.api_url = api_url
    self.status = None
    self.headers = {
        'content-type': 'application/json',
    }
    if ((username is not None) and (password is not None)):
        self.auth = (username, password)
    else:
        self.auth = None
    self.update()

dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/sensor/nzbget.py NZBGetAPI.__init__/original