Skip to content

Commit

Permalink
iCloud3 v3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gcobb321 committed Nov 9, 2024
1 parent aee0688 commit aab6651
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

------

[![CurrentVersion](https://img.shields.io/badge/Current_Version-v3.1.2-blue.svg)](https://github.com/gcobb321/icloud3) [![Type](https://img.shields.io/badge/Type-Custom_Component-orange.svg)](https://github.com/gcobb321/icloud3) [![HACS](https://img.shields.io/badge/HACS-Standard_Repository-orange.svg)](https://github.com/gcobb321/icloud3)
[![CurrentVersion](https://img.shields.io/badge/Current_Version-v3.1.3-blue.svg)](https://github.com/gcobb321/icloud3) [![Type](https://img.shields.io/badge/Type-Custom_Component-orange.svg)](https://github.com/gcobb321/icloud3) [![HACS](https://img.shields.io/badge/HACS-Standard_Repository-orange.svg)](https://github.com/gcobb321/icloud3)

[![ProjectStage](https://img.shields.io/badge/Project_Stage-General_Availability-forestgreen.svg)](https://github/gcobb321/icloud3) [![Released](https://img.shields.io/badge/Released-November,_2024-forestgreen.svg)](https://github.com/gcobb321/icloud3)

Expand Down
12 changes: 11 additions & 1 deletion custom_components/icloud3/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
3.1.2
.......................
### Change Log - v3.1.2
1. INITIAL SETUP (Fixed) - Fixed some issues related to setting up iCloud3 the first time or with no apple accounts.
1. INITIAL SETUP (Fixed) - This fixed some issues related an initial install where there are no apple accounts or where the iCloud3 Apple account's first configuration file entry was blank.. This fixes the error message:
```
File "/config/custom_components/icloud3/config_flow.py", line 1974,
in async_step_update_apple_acct
self._update_conf_apple_accounts(self.aa_idx, user_input)
File "/config/custom_components/icloud3/config_flow.py", line 2055,
in _update_conf_apple_accounts
if Gb.conf_apple_accounts[0][CONF_USERNAME] == '':
~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
```



Expand Down
14 changes: 8 additions & 6 deletions custom_components/icloud3/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
sort_dict_by_values,
encode_password, decode_password, )
from .helpers.messaging import (log_exception, log_debug_msg, log_info_msg,
_log, _evlog,
_log, _evlog, more_info,
post_event, post_monitor_msg, )
from .helpers import entity_io
from .helpers import file_io
Expand Down Expand Up @@ -3977,9 +3977,6 @@ async def _build_mobapp_entity_selection_list(self, selected_devicename=None):
Gb.mobapp_dnames_by_devicename[_conf_device[CONF_IC3_DEVICENAME]] =\
_conf_device[CONF_MOBILE_APP_DEVICE]

# if is_empty(Gb.devicenames_by_mobapp_dname):
# return

mobapp_devices ={mobapp_dname:(
f"{mobapp_info[0]} "
f"(device_tracker.{mobapp_dname}) > "
Expand All @@ -3998,10 +3995,15 @@ async def _build_mobapp_entity_selection_list(self, selected_devicename=None):

else:
devicename = Gb.devicenames_by_mobapp_dname[mobapp_dname]
Device = Gb.Devices_by_devicename[devicename]
Device = Gb.Devices_by_devicename.get(devicename)
if Device:
fname_devicename = Device.fname_devicename
else:
fname_devicename = f"{CIRCLE_STAR}{devicename} (UNKNOWN)"

devices_used[mobapp_dname] = (
f"{mobapp_info.split(';')[0]}{RARROW}"
f"ASSIGNED TO-{Device.fname_devicename}")
f"ASSIGNED TO-{fname_devicename}")

try:
scan_for_mobapp_devices = {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/icloud3/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

VERSION = '3.1.2'
VERSION = '3.1.3'
VERSION_BETA = ''
#-----------------------------------------
ICLOUD3 = 'iCloud3'
Expand Down
13 changes: 11 additions & 2 deletions custom_components/icloud3/const_more_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@

'instructions_already_displayed': (
f"{CRLF_DASH_75}"
f"{CRLF}See the instructions that have already been displayed"
),
f"{CRLF}See the instructions that have already been displayed"),

'password_srp_error': (
f"{CRLF_DASH_75}"
f"{CRLF}The Python module that creates the Secure Remote Password (SRP) "
f"hash key has calculated an incorrect value for a valid assword. You probably "
f"will have to change the Apple Account password to be able to log into it. "
f"{CRLF}{CRLF}For more infornation, go to the iCloud3 GitHub "
f"issues page. Click the red Bug icon on the Event Log and "
f"review the{CRLF}`➤ Password SRP Error Message` issue at the top of the screen."),

}
2 changes: 1 addition & 1 deletion custom_components/icloud3/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"issue_tracker": "https://github.com/gcobb321/icloud3/issues",
"loggers": ["icloud3"],
"requirements": ["srp"],
"version": "3.1.2"
"version": "3.1.3"
}
9 changes: 3 additions & 6 deletions custom_components/icloud3/support/pyicloud_ic3.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,11 +802,8 @@ def authenticate(self, refresh_session=False):
Gb.PyiCloudValidateAppleAcct.validate_username_password(
self.username, self.password)
if username_password_valid:
err_msg += ("Python SRP Library Credentials Error. The Python "
"module that creates the Secure Remote Password hash key "
"has calculated an incorrect value for a valid "
"Username/Password. Try changing the Password to see "
"if the Apple Acct can be logged into. ")
err_msg += (f"Python SRP Library Credentials Error"
f"{more_info('password_srp_error')}")
else:
err_msg += "Authentication error, Invalid Username or Password, "
elif self.response_code == 503 or self.response_code_pwsrp_err == 503:
Expand Down Expand Up @@ -1815,7 +1812,7 @@ def update_device_location_data(self, requested_by_devicename=None, devices_data
or device_data[LOCATION] == {}
or device_data[LOCATION] is None):
if device_id not in Gb.devices_without_location_data:
Gb.devices_without_location_data.append(device_id)
list_add(Gb.devices_without_location_data, device_data_name)
rawdata_hdr_msg = 'NO LOCATION'
if device_data[ICLOUD_DEVICE_STATUS] == 203:
rawdata_hdr_msg += ', OFFLINE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def verify_all_apple_accounts():
password = Gb.PyiCloud_password_by_username[username]

if is_empty(username) or is_empty(password):
Gb.username_valid_by_username[f"AppleAcctNoUserPW-#{cnt}"] = False
# Gb.username_valid_by_username[f"AppleAcctNoUserPW-#{cnt}"] = False
continue

# Validate username/password so we know all future login attempts will be with valid apple accts
Expand Down
13 changes: 8 additions & 5 deletions custom_components/icloud3/support/start_ic3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,10 +1135,9 @@ def create_Devices_object():
Gb.icloud_dnames_by_devicename = {}
Gb.conf_startup_errors_by_devicename = {}

_log(f"{len(Gb.conf_apple_accounts)=} {len(Gb.username_valid_by_username)=}")
if len(Gb.conf_apple_accounts) != len(Gb.username_valid_by_username):
pyicloud_ic3_interface.verify_all_apple_accounts()
_log(f"{len(Gb.conf_apple_accounts)=} {len(Gb.username_valid_by_username)=}")
# _log(f"{len(Gb.conf_apple_accounts)=} {len(Gb.username_valid_by_username)=}")
# if len(Gb.conf_apple_accounts) != len(Gb.username_valid_by_username):
pyicloud_ic3_interface.verify_all_apple_accounts()

for conf_device in Gb.conf_devices:
devicename = conf_device[CONF_IC3_DEVICENAME]
Expand Down Expand Up @@ -1639,6 +1638,9 @@ def _post_evlog_apple_acct_tracked_devices_info(PyiCloud):
exception_msg = ', DUPLICATE DEVICE'
else:
msg_symb = CRLF_X
if pyicloud_icloud_dname in Gb.devices_without_location_data:
msg_symb = f"{CRLF} {YELLOW_ALERT} "
exception_msg = ', NOT LOCATED'

device_msg = ( f"{msg_symb}"
f"{pyicloud_icloud_dname}{RARROW}")
Expand Down Expand Up @@ -1683,7 +1685,8 @@ def _post_evlog_apple_acct_tracked_devices_info(PyiCloud):
# log_rawdata(log_title, {'filter': _RawData.device_data})

devices_assigned_cnt += 1
msg_symb = f"{CRLF}{NBSP2}{YELLOW_ALERT}" if pyicloud_icloud_dname.endswith('.') else CRLF_CHK
msg_symb = f"{CRLF}{NBSP2}{YELLOW_ALERT}" \
if pyicloud_icloud_dname.endswith('.') else CRLF_CHK
device_msg=(f"{msg_symb}"
f"{pyicloud_icloud_dname}{RARROW}"
f"{Device.fname}/{devicename} ")
Expand Down
6 changes: 3 additions & 3 deletions custom_components/icloud3/support/start_ic3_control.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..global_variables import GlobalVariables as Gb
from ..const import (VERSION, VERSION_BETA, ICLOUD3, ICLOUD3_VERSION, DOMAIN, ICLOUD3_VERSION_MSG,
NOT_SET, IC3LOG_FILENAME,
CRLF, CRLF_DOT, CRLF_HDOT, CRLF_X, NL, NL_DOT, LINK,
CRLF, CRLF_DOT, CRLF_HDOT, CRLF_X, NL, NL_DOT, LINK, YELLOW_ALERT,
EVLOG_ALERT, EVLOG_ERROR, EVLOG_IC3_STARTING, EVLOG_IC3_STAGE_HDR,
SETTINGS_INTEGRATIONS_MSG, INTEGRATIONS_IC3_CONFIG_MSG,
CONF_VERSION, ICLOUD, ZONE_DISTANCE,
Expand Down Expand Up @@ -365,8 +365,8 @@ def _log_into_apple_accounts(retry=False):

if is_empty(Gb.devices_without_location_data):
post_event(f"Apple Acct > {PyiCloud.username_base}, All Devices Located")
else:
post_event(f"Apple Acct > Devices not Located > {list_to_str(Gb.devices_without_location_data)}")
# else:
# post_event(f"{YELLOW_ALERT}Apple Acct > Devices not Located, {list_to_str(Gb.devices_without_location_data)}")

return True

Expand Down

0 comments on commit aab6651

Please sign in to comment.