Skip to content

Commit

Permalink
iCloud3 v3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gcobb321 committed Dec 23, 2024
1 parent aab6651 commit 9eebb7f
Show file tree
Hide file tree
Showing 28 changed files with 3,231 additions and 2,256 deletions.
22 changes: 21 additions & 1 deletion custom_components/icloud3/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
**Installing for the first time_** - See [here](https://gcobb321.github.io/icloud3_v3_docs/#/chapters/3.2-installing-and-configuring) for instructions on installing as a New Installation
**iCloud3 v3 Documentation** - iCloud3 User Guide can be found [here](https://gcobb321.github.io/icloud3_v3_docs/#/)

3.1.4
.......................
### Change Log - v3.1.4 (12/22/2024)
1. APPLE ACCOUNT PASSWORD AUTHENTICATION:
- Reverted back to the old password authentication protocol before the Secure Remote Password (SRP) protocol was implemented
- The Password SRP protocol will be tried if the old password authentication protocol fails.
2. ADD ICLOUD3 DEVICE SCREEN (Redesign) - Redesigned the screen so the basic tracking parameters (iCloud & Mobile App devices and picture) are selected on this screen instead of the Update Device screen.
3. UPDATE DEVICE SCREEN (Redesign) - The rarely used fields (inZone & Fixed Interval, Track from Zone, etc) are not displayed if they are using the default values. A check box is enabled to display these fields.
4. TOOLS SCREEN (New Feature) - A `Tools` screen replaces the `Actions` screen on the Configure Menu screen. This is used for configuration file maintenance to reset all Devices Apple Account fields, Delete all Apple Accounts and Devices, Delete all iCloud3 and Apple Account cookie files, etc.
5. STARTUP (Improved) - Error and warning messages have been improved when setting up Apple Accounts and the Mobile App devices. When errors are encountered (devices can not be found, invalid Apple Account information, etc), an attempt will be made to correct the error using known device names and identification codes. Sometimes it works, sometimes it doesn't and the configuration will need to be updated.
6. ERROR & WARNING MESSAGES (Improved) - Changed various messages to improve readability and simplify the text.
7. A lot of internal code changes to improve code maintenance and to remove dead code.

What's Next:
.......................
1. YubiKey support.
2. Implementation of the Password SRP protocol as the primary method of authentication passwords. It works but asks for the 6-digit verification code constantly. I have things to try but it will need long-term testing to insure the verification code request is minimized.
3. There are times when HA adds a `_2` extension to the device_tracker and sensor entity name when HA is reloaded and the iCloud3 integration is still running. A new Tool will be developed to easily reset these entity names to their correct name without the `_2`.




3.1.2
Expand All @@ -18,7 +38,7 @@
if Gb.conf_apple_accounts[0][CONF_USERNAME] == '':
~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
```
```



Expand Down
7 changes: 4 additions & 3 deletions custom_components/icloud3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from .support import pyicloud_ic3_interface
from .support import event_log
from .icloud3_main import iCloud3

from .support.pyicloud_ic3 import (PyiCloudValidateAppleAcct, )

Gb.HARootLogger = logging.getLogger("")
Gb.HALogger = logging.getLogger(__name__)
Expand Down Expand Up @@ -183,12 +183,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Gb.EvLog.display_user_message(f"Starting {ICLOUD3_VERSION_MSG}")
Gb.PyiCloudValidateAppleAcct = PyiCloudValidateAppleAcct()
Gb.username_valid_by_username = {}
if Gb.use_data_source_ICLOUD:
await Gb.hass.async_add_executor_job(
move_icloud_cookies_to_icloud3_apple_acct)
await Gb.hass.async_add_executor_job(
pyicloud_ic3_interface.verify_all_apple_accounts)
# pyicloud_ic3_interface.create_all_PyiCloudServices)
pyicloud_ic3_interface.check_all_apple_accts_valid_upw)

# set_up_default_area_id()

Expand Down
2,330 changes: 1,306 additions & 1,024 deletions custom_components/icloud3/config_flow.py

Large diffs are not rendered by default.

307 changes: 206 additions & 101 deletions custom_components/icloud3/config_flow_forms.py

Large diffs are not rendered by default.

116 changes: 60 additions & 56 deletions custom_components/icloud3/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

VERSION = '3.1.3'
VERSION = '3.1.4'
VERSION_BETA = ''
#-----------------------------------------
ICLOUD3 = 'iCloud3'
Expand All @@ -35,7 +35,7 @@
HA_CONFIG_IC3_URL = f'/config/integrations/integration/{DOMAIN}'
WAZE_LOCATION_HISTORY_DATABASE = 'icloud3.waze_location_history.db'
SENSOR_WAZEHIST_TRACK_NAME = 'icloud3_wazehist_track'
IC3LOG_FILENAME = f'{DOMAIN}-0.log'
IC3LOG_FILENAME = f'{DOMAIN}.log'
PICTURE_WWW_STANDARD_DIRS = 'www/icloud3, www/community, www/images, www/custom_cards'

DEVICE_TRACKER = 'device_tracker'
Expand Down Expand Up @@ -99,34 +99,40 @@
IPHONE = 'iphone'
IPAD_FNAME = 'iPad'
IPAD = 'ipad'
IMAC_FNAME = 'iMac'
IMAC = 'imac'
MAC_FNAME = 'Mac'
MAC = 'mac'
IPOD_FNAME = 'iPod'
IPOD = 'ipod'
WATCH_FNAME = 'Watch'
WATCH = 'watch'
AIRPODS_FNAME = 'AirPods'
AIRPODS = 'airpods'
ICLOUD = 'iCloud'
ICLOUD = 'icloud'
OTHER_FNAME = 'Other'
OTHER = 'other'

#tracking_method config parameter being used
ICLOUD = 'iCloud' #iCloud Location Services
FAMSHR = 'iCloud' #Family Sharing
MOBAPP = 'MobApp' #HA Mobile App v1.5x or v2.x
NO_MOBAPP = 'no_mobapp'
IOSAPP = 'iosapp'
NO_IOSAPP = 'no_iosapp'

# Apple is using a country specific iCloud server based on the country code in pyicloud_ic3.
# Add to the HOME_ENDPOINT & SETUP_ENDPOINT urls if the HA country code is one of these values.
APPLE_SPECIAL_ICLOUD_SERVER_COUNTRY_CODE = ['cn', 'CN']

DEVICE_TYPES = [
IPHONE, IPAD, WATCH, AIRPODS, IMAC, IPOD, ICLOUD,
IPHONE, IPAD, WATCH, AIRPODS, MAC, IPOD, ICLOUD,
IPHONE_FNAME, IPAD_FNAME, WATCH_FNAME, AIRPODS_FNAME,
IMAC_FNAME, IPOD_FNAME, ICLOUD,
MAC_FNAME, IPOD_FNAME, ICLOUD,
]
DEVICE_TYPE_FNAMES = {
IPHONE: IPHONE_FNAME,
IPAD: IPAD_FNAME,
WATCH: WATCH_FNAME,
AIRPODS: AIRPODS_FNAME,
IMAC: IMAC_FNAME,
MAC: MAC_FNAME,
IPOD: IPOD_FNAME,
OTHER: OTHER_FNAME,
}
Expand All @@ -138,11 +144,21 @@ def DEVICE_TYPE_FNAME(device_type):
IPAD: "mdi:tablet",
WATCH: "mdi:watch-variant",
AIRPODS: "mdi:earbuds-outline",
IMAC : "mdi:laptop",
MAC : "mdi:laptop",
IPOD: "mdi:ipod",
OTHER: 'mdi:laptop'
}

DEVICE_TYPE_INZONE_INTERVALS = {
IPHONE: 120,
IPAD: 120,
WATCH: 15,
MAC: 120,
AIRPODS: 15,
NO_MOBAPP: 15,
OTHER: 120,
}

UM_FNAME = {'mi': 'Miles', 'km': 'Kilometers'}
DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
DATETIME_ZERO = '0000-00-00 00:00:00'
Expand Down Expand Up @@ -266,12 +282,13 @@ def DEVICE_TYPE_FNAME(device_type):
'''
lite_circled_letters = "Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ"
dark_circled_letters = "🅐 🅑 🅒 🅓 🅔 🅕 🅖 🅗 🅘 🅙 🅚 🅛 🅜 🅝 🅞 🅟 🅠 🅡 🅢 🅣 🅤 🅥 🅦 🅧 🅨 🅩 ✪"
Symbols = ±▪•●▬⮾ ⊗ ⊘✓×ø¦ ▶◀ ►◄▲▼ ∙▪ »« oPhone=►▶→⟾➤➟➜➔➤🡆🡪🡺⟹🡆➔ᐅ◈🝱☒☢⛒⊘Ɵ⊗ⓧⓍ⛒🜔
Important =✔️❗❌✨➰⚠️❓⚽🛑⛔⚡⭐⭕ⓘ• ⍰ ‶″“”‘’‶″ 🕓 🔻🔺✔✅❎☑️☁️🍎🔻⏭️⏮️🍏🅰️⮽➕
↺↻⟲⟳⭯⭮↺↻⥀⥁↶↷⮌⮍⮎⮏⤻⤸⤾⤿⤺⤼⤽⤹🗘⮔⤶⤷⃕⟳↻🔄🔁➡️🔃⬇️
— –ᗒ⋮… ⁃ » ━▶ ━➤🡺 —> > ❯↦ …🡪ᗕᗒ ᐳ ─🡢 ⎯ ━ ──ᗒ 🡢 ─ᐅ ↣ ➙ →《》◆◈◉● ⟷•⟛⚯⧟⫗' '᚛᚜ 〉〈 ⦒⦑ ⟩⟨ ≻≺ ⸩⸨
Symbols = ±▪•●▬⮾ ⊗ ⊘✓×ø¦ ▶◀ ►◄▲▼ ∙▪ »« oPhone=►▶→⟾➤➟➜➔➤🡆🡪🡺⟹🡆➔ᐅ◈🝱☒☢⛒⊘Ɵ⊗ⓧⓍ⛒z🜔
Important =✔️❗❌✨➰⚠️☢❓⚽⛔🛑⚡⭐◌\⭕🔶🔸ⓘ• ⍰ ‶″“”‘’‶″ 🕓 🔻🔺✔✅❎☑️☁️🍎🔻⏭️⏮️🍏🅰️⮽➕
↺↻⟲⟳⭯⭮↺↻⥀⥁↶↷⮌⮍⮎⮏⤻⤸⤾⤿⤺⤼⤽⤹🗘⮔⤶⤷⃕⟳↻🔄🔁➡️🔃⬇️🔗✳
— –ᗒ⋮… ⁃ » ━▶ ━➤🡺 —> > ❯↦ …⋯⋮ ⋱⋰🡪ᗕᗒ ᐳ ─🡢 ⎯ ━ ──ᗒ 🡢 ─ᐅ ↣ ➙ →《》◆◈◉● ⟷•⟛⚯⧟⫗' '᚛᚜ 〉〈 ⦒⦑ ⟩⟨ ≻≺ ⸩⸨
▐‖ ▹▻◁─▷◅◃‖╠ᐅ🡆▶▐🡆▐▶‖➤▐➤➜➔❰❰❱❱ ⠤ … ² ⚯⟗⟐⥄⥵⧴⧕⫘⧉⯏≷≶≳≲≪≫⋘⋙ ∮∯ ❪❫❴❵❮❯❰❱
⣇⠈⠉⠋⠛⠟⠿⡿⣿ ⠗⠺ ⠿ ⸩⸨
⣇⠈⠉⠋⠛⠟⠿⡿⣿ ⠗⠺ ⠿ ⸩⸨⯎⯌⯏⯍✧ 🙾 🙿 ⲶⲼ+≈⟣⟢⟡
≽≼≽ ⋞⋟≺≻ ≪≫≾≿⋘⋙ ⋖⋗
https://www.fileformat.info/info/unicode/block/braille_patterns/utf8test.htm
https://www.htmlsymbols.xyz/unit-symbols
'''
Expand All @@ -283,10 +300,9 @@ def DEVICE_TYPE_FNAME(device_type):
NBSP6 = '⠿' #'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
CRLF = '⣇' #'<br>'
NL = '\n'
#LINK = ' ⟛ '
LLINK = '⸨'
RLINK = '⸩'
LINK = '-⸨'
LLINK = ''
RLINK = ''
LINK = '⟢'
CLOCK_FACE = '🕓'
INFO = '🛈'
CHECK_MARK = '✓ '
Expand All @@ -313,17 +329,21 @@ def DEVICE_TYPE_FNAME(device_type):
DOTS = '…'
PLUS_MINUS = '±'
LDOT2 = f'•{NBSP2}'
CRLF_DOT = f'{CRLF}{NBSP3}{NBSP2}'
CRLF_LDOT = f'{CRLF}{NBSP2}'
CRLF_DOT = f'{CRLF}{NBSP2}{NBSP2}'
CRLF_LDOT = f'{CRLF}{NBSP}'
NL_DOT = f'{NL} • '
CRLF_XD = f'{CRLF}{NBSP2}×{NBSP2}'
CRLF_X = f'{CRLF}{NBSP3}×{NBSP2}'
CRLF_XD = f'{CRLF}{NBSP}×{NBSP2}'
CRLF_X = f'{CRLF}{NBSP2}×{NBSP2}'
CRLF_CIRCLE_X = f'{CRLF}{NBSP2}{NBSP}'
CRLF_RED_X = f'{CRLF}❌'
CRLF_HDOT = f'{CRLF}{NBSP4}{NBSP3}{NBSP2}'
CRLF_CHK = f'{CRLF}{NBSP3}{NBSP}'
CRLF_STAR = f'{CRLF}{NBSP2}{NBSP}'
CRLF_RED_X = f'{CRLF}{NBSP}'
CRLF_RED_ALERT = f'{CRLF}{NBSP}'
CRLF_HDOT = f'{CRLF}{NBSP6}{NBSP2}'
CRLF_CHK = f'{CRLF}{NBSP2}{NBSP}'
CRLF_STAR = f'{CRLF}{NBSP}{NBSP}'
CRLF_YELLOW_ALERT = f'{CRLF}⚠️{NBSP}'
CRLF_RED_MARK = f'{CRLF}{NBSP}{NBSP}'
CRLF_RED_STOP = f'{CRLF}{NBSP}{RED_STOP}'
CRLF_RED_ALERT = f'{CRLF}{NBSP}{RED_ALERT}'
CRLF_SP3_DOT = f'{CRLF}{NBSP3}{NBSP}'
CRLF_SP5_DOT = f'{CRLF}{NBSP5}{NBSP}'
CRLF_SP8_DOT = f'{CRLF}{NBSP4}{NBSP4}{NBSP}'
Expand All @@ -350,14 +370,6 @@ def DEVICE_TYPE_FNAME(device_type):

OPT_NONE = 0

#tracking_method config parameter being used
ICLOUD = 'iCloud' #iCloud Location Services
FAMSHR = 'iCloud' #Family Sharing
IOSAPP = 'iosapp'
MOBAPP = 'MobApp' #HA Mobile App v1.5x or v2.x
NO_MOBAPP = 'no_mobapp'
NO_IOSAPP = 'no_iosapp'

# Device tracking modes
TRACK_DEVICE = 'track'
MONITOR_DEVICE = 'monitor'
Expand Down Expand Up @@ -842,29 +854,28 @@ def DEVICE_TYPE_FNAME(device_type):
CONF_PICTURE_WWW_DIRS: []
}

DEFAULT_APPLE_ACCOUNTS_CONF = {
CONF_USERNAME: '',
CONF_PASSWORD: '',
CONF_TOTP_KEY: '',
CONF_LOCATE_ALL: True,
}

DEFAULT_TRACKING_CONF = {
CONF_USERNAME: '',
CONF_PASSWORD: '',
CONF_APPLE_ACCOUNTS: [],
CONF_ENCODE_PASSWORD: True,
CONF_ICLOUD_SERVER_ENDPOINT_SUFFIX: '',
CONF_SETUP_ICLOUD_SESSION_EARLY: True,
CONF_DATA_SOURCE: f'{ICLOUD},{MOBAPP}',
CONF_APPLE_ACCOUNTS: [],
CONF_DEVICES: [],
}

DEFAULT_APPLE_ACCOUNTS_CONF = {
CONF_USERNAME: '',
CONF_PASSWORD: '',
CONF_TOTP_KEY: '',
CONF_LOCATE_ALL: True,
}

DEFAULT_DEVICE_CONF = {
CONF_IC3_DEVICENAME: ' ',
CONF_FNAME: '',
CONF_PICTURE: 'None',
#CONF_EVLOG_DISPLAY_ORDER: 0,
CONF_UNIQUE_ID: '',
CONF_DEVICE_TYPE: 'iPhone',
CONF_INZONE_INTERVAL: 120,
Expand All @@ -884,16 +895,17 @@ def DEVICE_TYPE_FNAME(device_type):
CONF_LOG_ZONES: ['none'],
}
# Used in conf_flow to reinialize the Configuration Devices
DEFAULT_DEVICE_DATA_SOURCE = {
DEFAULT_DEVICE_APPLE_ACCT_DATA_SOURCE = {
CONF_APPLE_ACCOUNT: '',
CONF_FAMSHR_DEVICENAME: 'None',
CONF_FAMSHR_DEVICE_ID: '',
CONF_RAW_MODEL : '',
CONF_MODEL: '',
CONF_MODEL_DISPLAY_NAME: '',
}
DEFAULT_DEVICE_MOBAPP_DATA_SOURCE = {
CONF_MOBILE_APP_DEVICE: 'None',
}

RANGE_DEVICE_CONF = {
CONF_INZONE_INTERVAL: [5, 480],
CONF_FIXED_INTERVAL: [0, 480],
Expand Down Expand Up @@ -927,15 +939,7 @@ def DEVICE_TYPE_FNAME(device_type):
CONF_CENTER_IN_ZONE: False,
CONF_DISCARD_POOR_GPS_INZONE: False,
CONF_DISTANCE_BETWEEN_DEVICES: True,
CONF_INZONE_INTERVALS: {
IPHONE: 120,
IPAD: 120,
WATCH: 15,
IMAC: 120,
AIRPODS: 15,
NO_MOBAPP: 15,
OTHER: 120,
},
CONF_INZONE_INTERVALS: DEVICE_TYPE_INZONE_INTERVALS.copy(),

# Waze Configuration Parameters
CONF_WAZE_USED: True,
Expand Down Expand Up @@ -1055,7 +1059,7 @@ def DEVICE_TYPE_FNAME(device_type):
CONF_OLD_LOCATION_ADJUSTMENT,
IPHONE,
IPAD,
IMAC,
MAC,
WATCH,
AIRPODS,
NO_MOBAPP,
Expand Down
Loading

0 comments on commit 9eebb7f

Please sign in to comment.