'Retrieve data from Swisscom and return parsed result.'

def get_swisscom_data(self):

    url = 'http://{}/ws'.format(self.host)
    headers = {'Content-Type': 'application/x-sah-ws-4-call+json'}
    data = '\n                                {"service":"Devices",    "method":"get",\n                                "parameters":{"expression":"lan    and    not    self"}}'
    request = requests.post(url, headers=headers, data=data, timeout=10)
    devices = {}
    for device in request.json()['status']:
        try:
            devices[device['Key']] = {'ip': device['IPAddress'], 'mac': device['PhysAddress'], 'host': device['Name'], 'status': device['Active']}
        except (KeyError, requests.exceptions.RequestException):
            pass
    return devices
