How to use the somecomfort.client.Location.from_api_response function in somecomfort

To help you get started, we’ve selected a few somecomfort examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kk7ds / somecomfort / somecomfort / client.py View on Github external
def _discover(self):
        raw_locations = self._get_locations()
        for raw_location in raw_locations:
            try:
                location = Location.from_api_response(self, raw_location)
            except KeyError as ex:
                _LOG.error(('Failed to process location `%s`: '
                            'missing %s element'),
                           raw_location.get('LocationID', 'unknown'),
                           ex.args[0])
            self._locations[location.locationid] = location