mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Cleanup commented code + comprehensions in iOS (#51238)
This commit is contained in:
parent
99afa15f47
commit
06e5314bc8
@ -212,20 +212,20 @@ CONFIGURATION_FILE = ".ios.conf"
|
||||
|
||||
def devices_with_push(hass):
|
||||
"""Return a dictionary of push enabled targets."""
|
||||
targets = {}
|
||||
for device_name, device in hass.data[DOMAIN][ATTR_DEVICES].items():
|
||||
if device.get(ATTR_PUSH_ID) is not None:
|
||||
targets[device_name] = device.get(ATTR_PUSH_ID)
|
||||
return targets
|
||||
return {
|
||||
device_name: device.get(ATTR_PUSH_ID)
|
||||
for device_name, device in hass.data[DOMAIN][ATTR_DEVICES].items()
|
||||
if device.get(ATTR_PUSH_ID) is not None
|
||||
}
|
||||
|
||||
|
||||
def enabled_push_ids(hass):
|
||||
"""Return a list of push enabled target push IDs."""
|
||||
push_ids = []
|
||||
for device in hass.data[DOMAIN][ATTR_DEVICES].values():
|
||||
if device.get(ATTR_PUSH_ID) is not None:
|
||||
push_ids.append(device.get(ATTR_PUSH_ID))
|
||||
return push_ids
|
||||
return [
|
||||
device.get(ATTR_PUSH_ID)
|
||||
for device in hass.data[DOMAIN][ATTR_DEVICES].values()
|
||||
if device.get(ATTR_PUSH_ID) is not None
|
||||
]
|
||||
|
||||
|
||||
def devices(hass):
|
||||
@ -337,14 +337,6 @@ class iOSIdentifyDeviceView(HomeAssistantView):
|
||||
|
||||
hass = request.app["hass"]
|
||||
|
||||
# Commented for now while iOS app is getting frequent updates
|
||||
# try:
|
||||
# data = IDENTIFY_SCHEMA(req_data)
|
||||
# except vol.Invalid as ex:
|
||||
# return self.json_message(
|
||||
# vol.humanize.humanize_error(request.json, ex),
|
||||
# HTTP_BAD_REQUEST)
|
||||
|
||||
data[ATTR_LAST_SEEN_AT] = datetime.datetime.now().isoformat()
|
||||
|
||||
device_id = data[ATTR_DEVICE_ID]
|
||||
|
Loading…
x
Reference in New Issue
Block a user