Skip to content

Commit

Permalink
iCloud3 v3.1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gcobb321 committed Feb 26, 2025
1 parent 0a979de commit 272b52a
Show file tree
Hide file tree
Showing 51 changed files with 453 additions and 215 deletions.
19 changes: 15 additions & 4 deletions custom_components/icloud3/Release Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@ v3.1.5b1 Removed, Replaced with v3.1.5b2 [here](https://github.com/gcobb321/iclo



### Release Notes - v3.1.6
### Release Notes - v3.1.7
#### 🎉 Improvements and New Features
1. When the password is used to authenticate the Apple Account, Apple sends an email to the account owner that a login/authentication was done. An entry has been added to the Event Log when iCloud3 doe this. The authentication date/time (PST) in the Event Log message is, hopefully, the same as on the email. View on _Event Log > Show Startup log, Errors & Alerts_. Note: The times the _Event Log_ and email may not match.
1. _Configure > Update Devices_ screen - Added an Action option to open a new screen to update the rarely updated parameters (inzone interval, log zone, track-from-zone, etc).

#### 🐛 Bug Fixes
1. Fixed a problem restarting after an Internet Connection Error occurred. iCloud3 would get stuck in a loop displaying a 'Paused/Resumed' message on the Event Log and tracking would stop.
2. Event Log - Fixed a problem building the Configure Button URL (THIS CAUSES A BROWSER REFRESH MSG ON ALL DEVICES).
3. Fixed a problem sending a notification to an iPhone that no data has been received from the Mobile App for over 6-hours.
4. Fixed a problem where changes to a device's Friendly Name were not updating the sensors Friendly Name correctly.


### Release Notes - v3.1.6 (2/22/2025)
#### 🎉 Improvements and New Features
1. Apple sends an email to the account owner that a login/authentication was done when the password is used to authenticate the Apple Account. A note is now added to the Event Log when this occurs showing the authentication date/time (PST) in the Event Log message. Hopefully, the time on the email is the same as the login (but it probably will not be). All password logins can be viewed on _Event Log > Show Startup log, Errors & Alerts_.
2. The Apple Account username is now obscured in the iCloud3 log files.
3. The _Data Sources_ ... screen name was changed to _Apple Accounts & Mobile App_ for clarity.
4. Formatting improvements to the _Apple Accounts & Mobile App screen.
4. Formatting improvements to the _Apple Accounts & Mobile App_ screen.
5. The Apple Server Location can now be selected by Apple Account (Applies to China users).
6. Messages are no longer sent to a phone when there is an Internet Connection error. Phones were being hammered with messages when the Internet connection would cycle between an offline and online state.
7. When Pausing all tracking, the time paused and age is now displayed in the Event Log.

#### 🐛 Bug Fixes
1. When iCloud3 started and was setting up the tracked devices, if the Mobile App device parameter was set to 'ScanFor a device' and that device was not found in the list of Mobile App devices, an error was aborting the setup process. This resulted in no Apple account or Mobile App devices being set up correctly. This has been fixed.
2. Fixed some problems with accessing Apple Servers in China where the .cn URL suffix was not being appended correctly.
2. Fixed some problems accessing Apple Servers in China where the .cn URL suffix was not being appended correctly.
3. Fixed a problem displaying all of the Apple Accounts when multiple Apple Accounts were set up and the first one was not logged into.

#### ☕ Buy me a Coffee
Expand Down
5 changes: 5 additions & 0 deletions custom_components/icloud3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
# config_file.count_lines_of_code(Gb.icloud3_directory)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
try:
# _log(f"{Gb.hass.data['lovelace']=}")
# dashboard = Gb.hass.data['lovelace'].dashboards['icloud3']
# #_log(f"{dashboard.__dict__=}")
# _log(f"{dashboard.config=}")
# _log(f"{dashboard._data=}")

pass

Expand Down
266 changes: 167 additions & 99 deletions custom_components/icloud3/config_flow.py

Large diffs are not rendered by default.

164 changes: 115 additions & 49 deletions custom_components/icloud3/config_flow_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from .global_variables import GlobalVariables as Gb
from .const import (RED_ALERT, LINK, RLINK, RARROW,
IPHONE, IPAD, WATCH, AIRPODS, ICLOUD, OTHER,
IPHONE, IPAD, WATCH, AIRPODS, ICLOUD, OTHER, HOME, NONE,
DEVICE_TYPE_FNAME, DEVICE_TYPE_FNAMES, MOBAPP, NO_MOBAPP,
INACTIVE_DEVICE, HOME_DISTANCE,
PICTURE_WWW_STANDARD_DIRS, CONF_PICTURE_WWW_DIRS,
Expand Down Expand Up @@ -619,24 +619,35 @@ def form_add_device(self):
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
def form_update_device(self):

# Build Other Tracking Parameters values text
log_zones_fnames = [zone_dname(zone) for zone in self.conf_device[CONF_LOG_ZONES] if zone.startswith('name') is False]
tfz_fnames = [zone_dname(zone) for zone in self.conf_device[CONF_TRACK_FROM_ZONES]]
device_type_fname = DEVICE_TYPE_FNAME(self._parm_or_device(CONF_DEVICE_TYPE))
otp_msg = (f"Type ({device_type_fname}), "
f"inZoneInterval ({format_timer(self.conf_device[CONF_INZONE_INTERVAL]*60)})")
otp_msg += ", FixedInterval"
if self.conf_device[CONF_FIXED_INTERVAL] > 0:
otp_msg += f" ({format_timer(self.conf_device[CONF_FIXED_INTERVAL]*60)})"
otp_msg += ", LogZones"
if self.conf_device[CONF_LOG_ZONES] != [NONE]:
otp_msg += f" ({list_to_str(log_zones_fnames)})"
otp_msg += ", TrackFromZone"
if self.conf_device[CONF_TRACK_FROM_ZONES] != [HOME]:
otp_msg += f" ({list_to_str(tfz_fnames)})"
otp_msg += ", PrimaryTrackFromZone"
if self.conf_device[CONF_TRACK_FROM_BASE_ZONE] != HOME:
otp_msg += f" ({zone_dname(self.conf_device[CONF_TRACK_FROM_BASE_ZONE])})"
otp_action_item = ACTION_LIST_OPTIONS[
'update_other_device_parameters'].replace('^otp_msg', otp_msg)

error_key = ''
self.errors = self.errors or {}
self.actions_list = []
self.actions_list.append(otp_action_item)
self.actions_list.append(ACTION_LIST_OPTIONS['save'])
self.actions_list.append(ACTION_LIST_OPTIONS['cancel_goto_menu'])
self.actions_list.append(ACTION_LIST_OPTIONS['cancel_goto_select_device'])

# Display Advanced Tracking Parameters
log_zones_fnames = [zone_dname(zone) for zone in self.conf_device[CONF_LOG_ZONES] if zone.startswith('Name') is False]
tfz_fnames = [zone_dname(zone) for zone in self.conf_device[CONF_TRACK_FROM_ZONES]]
device_type_fname = DEVICE_TYPE_FNAME(self._parm_or_device(CONF_DEVICE_TYPE))
RARELY_UPDATED_PARMS_HEADER = ( f"DeviceType ({device_type_fname}), "
f"inZoneInterval ({format_timer(self.conf_device[CONF_INZONE_INTERVAL]*60)}), "
f"FixedInterval ({format_timer(self.conf_device[CONF_FIXED_INTERVAL]*60)}), "
f"LogFromZones ({list_to_str(log_zones_fnames)}), "
f"Track-from-Zone ({list_to_str(tfz_fnames)}), "
f"PrimaryTrackFromZone ({zone_dname(self.conf_device[CONF_TRACK_FROM_BASE_ZONE])})")
atp_default = [RARELY_UPDATED_PARMS_HEADER] if self.display_rarely_updated_parms else []

devicename = self._parm_or_device(CONF_IC3_DEVICENAME)
icloud3_fname = self._parm_or_device(CONF_FNAME) or ' '
Expand Down Expand Up @@ -725,23 +736,85 @@ def form_update_device(self):
options=dict_value_to_list(TRACKING_MODE_OPTIONS), mode='dropdown')),
})

if self.display_rarely_updated_parms is False:
schema.update({
vol.Optional(RARELY_UPDATED_PARMS,
default=atp_default):
cv.multi_select([RARELY_UPDATED_PARMS_HEADER]),
})
# if self.display_rarely_updated_parms is False:
# schema.update({
# vol.Optional(RARELY_UPDATED_PARMS,
# default=atp_default):
# cv.multi_select([RARELY_UPDATED_PARMS_HEADER]),
# })

# if self.display_rarely_updated_parms:
# device_type_fname = DEVICE_TYPE_FNAME(self._parm_or_device(CONF_DEVICE_TYPE))
# schema.update({
# vol.Required(CONF_DEVICE_TYPE,
# default=self._option_parm_to_text(CONF_DEVICE_TYPE, DEVICE_TYPE_FNAMES)):
# selector.SelectSelector(selector.SelectSelectorConfig(
# options=dict_value_to_list(DEVICE_TYPE_FNAMES), mode='dropdown')),
# vol.Required(CONF_INZONE_INTERVAL,
# default=self.conf_device[CONF_INZONE_INTERVAL]):
# # default=self._parm_or_device(CONF_INZONE_INTERVAL)):
# selector.NumberSelector(selector.NumberSelectorConfig(
# min=5, max=480, step=5, unit_of_measurement='minutes')),
# vol.Required(CONF_FIXED_INTERVAL,
# default=self.conf_device[CONF_FIXED_INTERVAL]):
# selector.NumberSelector(selector.NumberSelectorConfig(
# min=0, max=480, step=5, unit_of_measurement='minutes')),
# vol.Optional(CONF_LOG_ZONES,
# default=self._parm_or_device(CONF_LOG_ZONES)):
# cv.multi_select(six_item_dict(log_zones_key_text)),
# vol.Required(CONF_TRACK_FROM_ZONES,
# default=self._parm_or_device(CONF_TRACK_FROM_ZONES)):
# cv.multi_select(six_item_dict(self.zone_name_key_text)),
# #cv.multi_select(self.zone_name_key_text),
# vol.Required(CONF_TRACK_FROM_BASE_ZONE,
# default=self._option_parm_to_text(CONF_TRACK_FROM_BASE_ZONE,
# self.zone_name_key_text, conf_device=True)):
# selector.SelectSelector(selector.SelectSelectorConfig(
# options=dict_value_to_list(self.zone_name_key_text), mode='dropdown')),
# })

if self.display_rarely_updated_parms:
device_type_fname = DEVICE_TYPE_FNAME(self._parm_or_device(CONF_DEVICE_TYPE))
schema.update({
schema.update({
vol.Required('action_items',
default=self.action_default_text('save')):
selector.SelectSelector(selector.SelectSelectorConfig(
options=self.actions_list, mode='list')),
})

return vol.Schema(schema)

#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# UPDATE OTHER DEVICE PARAMETERS
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
def form_update_other_device_parameters(self):

# Display Advanced Tracking Parameters
# log_zones_fnames = [zone_dname(zone) for zone in self.conf_device[CONF_LOG_ZONES] if zone.startswith('Name') is False]
# tfz_fnames = [zone_dname(zone) for zone in self.conf_device[CONF_TRACK_FROM_ZONES]]
# device_type_fname = DEVICE_TYPE_FNAME(self._parm_or_device(CONF_DEVICE_TYPE))
# RARELY_UPDATED_PARMS_HEADER = ( f"DeviceType ({device_type_fname}), "
# f"inZoneInterval ({format_timer(self.conf_device[CONF_INZONE_INTERVAL]*60)}), "
# f"FixedInterval ({format_timer(self.conf_device[CONF_FIXED_INTERVAL]*60)}), "
# f"LogFromZones ({list_to_str(log_zones_fnames)}), "
# f"Track-from-Zone ({list_to_str(tfz_fnames)}), "
# f"PrimaryTrackFromZone ({zone_dname(self.conf_device[CONF_TRACK_FROM_BASE_ZONE])})")
# atp_default = [RARELY_UPDATED_PARMS_HEADER] if self.display_rarely_updated_parms else []

self.actions_list = []
self.actions_list.append(ACTION_LIST_OPTIONS['save'])
self.actions_list.append(ACTION_LIST_OPTIONS['cancel_goto_previous'])

log_zones_key_text = {'none': 'None'}
log_zones_key_text.update(self.zone_name_key_text)
log_zones_key_text.update(LOG_ZONES_KEY_TEXT)

device_type_fname = DEVICE_TYPE_FNAME(self._parm_or_device(CONF_DEVICE_TYPE))
return vol.Schema({
vol.Required(CONF_DEVICE_TYPE,
default=self._option_parm_to_text(CONF_DEVICE_TYPE, DEVICE_TYPE_FNAMES)):
selector.SelectSelector(selector.SelectSelectorConfig(
options=dict_value_to_list(DEVICE_TYPE_FNAMES), mode='dropdown')),
vol.Required(CONF_INZONE_INTERVAL,
default=self.conf_device[CONF_INZONE_INTERVAL]):
# default=self._parm_or_device(CONF_INZONE_INTERVAL)):
selector.NumberSelector(selector.NumberSelectorConfig(
min=5, max=480, step=5, unit_of_measurement='minutes')),
vol.Required(CONF_FIXED_INTERVAL,
Expand All @@ -754,44 +827,37 @@ def form_update_device(self):
vol.Required(CONF_TRACK_FROM_ZONES,
default=self._parm_or_device(CONF_TRACK_FROM_ZONES)):
cv.multi_select(six_item_dict(self.zone_name_key_text)),
#cv.multi_select(self.zone_name_key_text),
vol.Required(CONF_TRACK_FROM_BASE_ZONE,
default=self._option_parm_to_text(CONF_TRACK_FROM_BASE_ZONE,
self.zone_name_key_text, conf_device=True)):
selector.SelectSelector(selector.SelectSelectorConfig(
options=dict_value_to_list(self.zone_name_key_text), mode='dropdown')),
})

schema.update({
vol.Required('action_items',
default=self.action_default_text('save')):
selector.SelectSelector(selector.SelectSelectorConfig(
options=self.actions_list, mode='list')),
})

return vol.Schema(schema)
default=self.action_default_text('save')):
selector.SelectSelector(selector.SelectSelectorConfig(
options=self.actions_list, mode='list')),
})


#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# DELETE DEVICE
# DASHBOARD BUILDER
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# def form_delete_device(self):
# self.actions_list = DEVICE_DELETE_ACTIONS.copy()
# device_text = ( f"{self.conf_device[CONF_FNAME]} "
# f"({self.conf_device[CONF_IC3_DEVICENAME]})")
# device_selected = self.device_items_list[self.conf_device_idx]

# # The first item is 'Delete this device, add the selected device's info
# return vol.Schema({
# vol.Required('device_selected',
# default=device_selected):
# selector.SelectSelector(selector.SelectSelectorConfig(
# options=[device_selected], mode='list')),
# vol.Required('action_items',
# default=self.action_default_text('delete_device_cancel')):
# selector.SelectSelector(
# selector.SelectSelectorConfig(options=self.actions_list, mode='list')),
# })
def form_dashboard_builder(self):
self.actions_list = ACTION_LIST_ITEMS_BASE.copy()
action_default = 'cancel_goto_menu'


return vol.Schema({
# vol.Optional('under_construction',
# default='Under Construction'):
# cv.multi_select(['Under Construction']),
vol.Required('action_items',
default=self.action_default_text(action_default)):
selector.SelectSelector(
selector.SelectSelectorConfig(options=self.actions_list, mode='list')),
})


#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# TOOLS
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 @@ -12,7 +12,7 @@

# from homeassistant.const import (Platform)

VERSION = '3.1.6'
VERSION = '3.1.6.1'
VERSION_BETA = ''
#-----------------------------------------
DOMAIN = 'icloud3'
Expand Down
6 changes: 5 additions & 1 deletion custom_components/icloud3/const_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
'data_source': 'APPLE ACCOUNTS & MOBILE APP > Add, Change and Delete Apple Accounts, Enable Monitoring the Mobile App ',
'device_list': 'ICLOUD3 DEVICES > Add, Change and Delete Tracked and Monitored Devices',
'verification_code': 'ENTER/REQUEST AN APPLE ACCOUNT VERIFICATION CODE > Enter or Request the 6-digit Apple Account Verification Code',
'away_time_zone': 'AWAY TIME ZONE > Select the displayed time zone for devices away from Home',
'change_device_order': 'CHANGE DEVICE ORDER > Change the Event Log Device display and tracking update sequence',
'sensors': 'SENSORS > Set Sensors created by iCloud3, Exclude Specific Sensors from being created',
'dashboard_builder': 'DASHBOARD BUILDER > Build a Lovelace Dashboard with tracked devices and the Event Log',
'tools': 'TOOLS > Log Level, Delete Apple Acct & Device Assignment, Delete Apple Acct Cookie & iCloud3 Config files, Repair sensor ‘_2’ entity name errors, Restart HA/Reload iCloud3',

'away_time_zone': 'AWAY TIME ZONE > Select the displayed time zone for devices away from Home',
'tracking_parameters': 'TRACKING PARAMETERS > Nearby Device Info, Accuracy Thresholds & Other Location Request Intervals',
'format_settings': 'FIELD FORMATS & OTHER PARAMETERS > Zone Display & Device Tracker State formats, Unit of Measure/Time & Distance formats, Picture Dir Filters, Event Log Overrides, etc',
'display_text_as': 'DISPLAY TEXT AS > Event Log Text Replacement',
Expand All @@ -36,10 +37,12 @@
MENU_KEY_TEXT['verification_code'],
MENU_KEY_TEXT['away_time_zone'],
MENU_KEY_TEXT['sensors'],
# MENU_KEY_TEXT['dashboard_builder'],
MENU_KEY_TEXT['tools'],
]
MENU_PAGE_1_INITIAL_ITEM = 0
MENU_KEY_TEXT_PAGE_1 = [
# MENU_KEY_TEXT['away_time_zone'],
MENU_KEY_TEXT['tracking_parameters'],
MENU_KEY_TEXT['format_settings'],
MENU_KEY_TEXT['display_text_as'],
Expand Down Expand Up @@ -75,6 +78,7 @@
'add_device': 'ADD DEVICE > Continue to the `‘Update Devices`’ screen to finish setting up the new device',
'delete_device': 'DELETE DEVICE > Delete the selected device',
'change_device_order': 'CHANGE DEVICE ORDER > Change the tracking order of the Devices and their display sequence on the Event Log',
'update_other_device_parameters': 'UPDATE OTHER DEVICE PARAMETERS > (^otp_msg)',

'inactive_to_track': 'TRACK ALL OR SELECTED > Change the `Tracking Mode‘ of all of the devices (or the selected devices) from `Inactive‘ to `Tracked‘',
'inactive_keep_inactive': 'DO NOT TRACK, KEEP INACTIVE > None of these devices should be `Tracked‘ and should remain `Inactive‘',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 272b52a

Please sign in to comment.