mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Updated to support per device find iphone sound. (#19535)
Added additional log statements to help debug
This commit is contained in:
parent
10ff169c76
commit
a9f796a97c
@ -200,7 +200,9 @@ class Icloud(DeviceScanner):
|
|||||||
self._intervals = {}
|
self._intervals = {}
|
||||||
for device in self.api.devices:
|
for device in self.api.devices:
|
||||||
status = device.status(DEVICESTATUSSET)
|
status = device.status(DEVICESTATUSSET)
|
||||||
|
_LOGGER.debug('Device Status is %s', status)
|
||||||
devicename = slugify(status['name'].replace(' ', '', 99))
|
devicename = slugify(status['name'].replace(' ', '', 99))
|
||||||
|
_LOGGER.info('Adding icloud device: %s', devicename)
|
||||||
if devicename in self.devices:
|
if devicename in self.devices:
|
||||||
_LOGGER.error('Multiple devices with name: %s', devicename)
|
_LOGGER.error('Multiple devices with name: %s', devicename)
|
||||||
continue
|
continue
|
||||||
@ -404,6 +406,7 @@ class Icloud(DeviceScanner):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
status = device.status(DEVICESTATUSSET)
|
status = device.status(DEVICESTATUSSET)
|
||||||
|
_LOGGER.debug('Device Status is %s', status)
|
||||||
dev_id = status['name'].replace(' ', '', 99)
|
dev_id = status['name'].replace(' ', '', 99)
|
||||||
dev_id = slugify(dev_id)
|
dev_id = slugify(dev_id)
|
||||||
attrs[ATTR_DEVICESTATUS] = DEVICESTATUSCODES.get(
|
attrs[ATTR_DEVICESTATUS] = DEVICESTATUSCODES.get(
|
||||||
@ -441,9 +444,9 @@ class Icloud(DeviceScanner):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self.api.authenticate()
|
self.api.authenticate()
|
||||||
|
|
||||||
for device in self.api.devices:
|
for device in self.api.devices:
|
||||||
if devicename is None or device == self.devices[devicename]:
|
if str(device) == str(self.devices[devicename]):
|
||||||
|
_LOGGER.info("Playing Lost iPhone sound for %s", devicename)
|
||||||
device.play_sound()
|
device.play_sound()
|
||||||
|
|
||||||
def update_icloud(self, devicename=None):
|
def update_icloud(self, devicename=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user