How to use the pyicloud.exceptions.PyiCloudNoDevicesException function in pyicloud

To help you get started, we’ve selected a few pyicloud 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 dale3h / homeassistant-config / custom_components / device_tracker / icloud.py View on Github external
self.determine_interval(
                        devicename, location['latitude'],
                        location['longitude'], battery)
                    interval = self._intervals.get(devicename, 1)
                    attrs[ATTR_INTERVAL] = interval
                    accuracy = location['horizontalAccuracy']
                    kwargs['dev_id'] = dev_id
                    kwargs['host_name'] = status['name']
                    kwargs['gps'] = (location['latitude'],
                                     location['longitude'])
                    kwargs['battery'] = battery
                    kwargs['gps_accuracy'] = accuracy
                    kwargs[ATTR_ATTRIBUTES] = attrs
                    self.see(**kwargs)
                    self.seen_devices[devicename] = True
        except PyiCloudNoDevicesException:
            _LOGGER.error('No iCloud Devices found!')
github home-assistant / home-assistant / homeassistant / components / icloud / device_tracker.py View on Github external
location["latitude"],
                            location["longitude"],
                            battery,
                        )
                        interval = self._intervals.get(devicename, 1)
                        attrs[ATTR_INTERVAL] = interval
                        accuracy = location["horizontalAccuracy"]
                        kwargs["dev_id"] = dev_id
                        kwargs["host_name"] = status["name"]
                        kwargs["gps"] = (location["latitude"], location["longitude"])
                        kwargs["battery"] = battery
                        kwargs["gps_accuracy"] = accuracy
                        kwargs[ATTR_ATTRIBUTES] = attrs
                        self.see(**kwargs)
                        self.seen_devices[devicename] = True
        except PyiCloudNoDevicesException:
            _LOGGER.error("No iCloud Devices found")
github picklepete / pyicloud / pyicloud / services / findmyiphone.py View on Github external
device_id = device_info['id']
            if device_id not in self._devices:
                self._devices[device_id] = AppleDevice(
                    device_info,
                    self.session,
                    self.params,
                    manager=self,
                    sound_url=self._fmip_sound_url,
                    lost_url=self._fmip_lost_url,
                    message_url=self._fmip_message_url,
                )
            else:
                self._devices[device_id].update(device_info)

        if not self._devices:
            raise PyiCloudNoDevicesException()
github dale3h / homeassistant-config / custom_components / icloud.py View on Github external
self._batteryStatus = status['batteryStatus']
                self.update_ha_state()
                status = self.identifier.status(DEVICESTATUSSET)
                battery = status['batteryLevel']*100
                location = status['location']
                if location:
                    see(
                        hass=self.hass,
                        dev_id=dev_id,
                        host_name=status['name'],
                        gps=(location['latitude'],
                             location['longitude']),
                        battery=battery,
                        gps_accuracy=location['horizontalAccuracy']
                    )
            except PyiCloudNoDevicesException:
                _LOGGER.error('No iCloud Devices found!')
github nficano / alexa-find-my-iphone / src / site-packages / pyicloud / services / findmyiphone.py View on Github external
device_id = device_info['id']
            if device_id not in self._devices:
                self._devices[device_id] = AppleDevice(
                    device_info,
                    self.session,
                    self.params,
                    manager=self,
                    sound_url=self._fmip_sound_url,
                    lost_url=self._fmip_lost_url,
                    message_url=self._fmip_message_url,
                )
            else:
                self._devices[device_id].update(device_info)

        if not self._devices:
            raise PyiCloudNoDevicesException()