Skip to content

Commit

Permalink
iCloud3 v2.2.1 General Release
Browse files Browse the repository at this point in the history
  • Loading branch information
gcobb321 committed Nov 2, 2020
1 parent 5d66001 commit ccecde3
Show file tree
Hide file tree
Showing 12 changed files with 1,939 additions and 13,397 deletions.
2 changes: 1 addition & 1 deletion custom_components/icloud3/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" iCloud3 Device Tracker """
"""iCloud3 Device Tracker"""
1,777 changes: 1,077 additions & 700 deletions custom_components/icloud3/device_tracker.py

Large diffs are not rendered by default.

738 changes: 421 additions & 317 deletions custom_components/icloud3/icloud3-event-log-card.js

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions custom_components/icloud3/pyicloud_ic3.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
to generate a Authentication error code rather than generating it's own 2SA Needed Exception
"""

from six import PY2, string_types
from six import PY2, string_types, text_type
from uuid import uuid1
import inspect
import json
Expand Down Expand Up @@ -103,22 +103,34 @@ def request(self, method, url, **kwargs): # pylint: disable=arguments-differ
if self.service.password_filter not in request_logger.filters:
request_logger.addFilter(self.service.password_filter)

request_logger.debug(f"{method}, {url}, {kwargs.get('data', '')}")
request_logger.debug(f"106 REQUEST -- {25*'-'}")
request_logger.debug(f"106 REQUEST -- {method}, {url}, {kwargs.get('data', '')}")
#request_logger.info(f"{method}, {url}, {kwargs.get("data", "")}"")

kwargs_retry_flag = kwargs.get("retried", None)
kwargs.pop("retried", None)

response = super(PyiCloudSession, self).request(method, url, **kwargs)

request_logger.debug(f"115 RESPONSE -- {response}, StatusCode-{response.status_code}, okStatus-{response.ok}")
request_logger.debug(f"110 RESPONSE -- {25*'-'}")

content_type = response.headers.get("Content-Type", "").split(";")[0]
json_mimetypes = ["application/json", "text/json"]

kwargs_retry_flag = True
if not response.ok and content_type not in json_mimetypes:
try:
data = response.json()
request_logger.debug(f"120 RESPONSE ERROR DATA -- {data}")
except:
pass

if (kwargs_retry_flag is None
and (response.status_code == AUTHENTICATION_REQUIRED
or response.status_code == DEVICE_STATUS_ERROR)):
message = (f"Reauthentication Required for Account: {self.service.user['apple_id']}")
request_logger.debug(f"133 MESSAGE -- {message}")

api_error = PyiCloudAPIResponseException(
message, response.status_code, retry=True
Expand All @@ -139,7 +151,7 @@ def request(self, method, url, **kwargs): # pylint: disable=arguments-differ
request_logger.warning("Failed to parse response with JSON mimetype")
return response

request_logger.debug(data)
#request_logger.debug(f"150 RESPONSE DATA -- {data}")
#request_logger.info(data)

reason = data.get("errorMessage")
Expand Down
5 changes: 4 additions & 1 deletion custom_components/icloud3/services.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# yamllint disable rule:document-start
# yamllint disable rule:line-length

icloud3_update:
description: This service allows you to change the way iCloud3 operates.
fields:
Expand All @@ -24,7 +27,7 @@ icloud3_restart:
account_name:
description: account_name of the iCloud3 custom component specified in the Configuration Variables section described at the beginning of this document. (Required)
example: gary_icloud

icloud3_lost_iphone:
description: This service will play the Lost iPhone sound on a specific device.
fields:
Expand Down
49 changes: 0 additions & 49 deletions development area - v2.2.1/change log.txt

This file was deleted.

Loading

0 comments on commit ccecde3

Please sign in to comment.