diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3dcd7c4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## v1.0.1 (2023-10-21) +## Fixes +- checks if FindMy cache file exists before continuing +- correct python packaging + +## v1.0.0 (16-10-2023) +### Features +- output AirTag battery status in table +- visualize battery as bar indicator + diff --git a/README.md b/README.md index f58b83a..6c9fa1a 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,11 @@ The FindMy app may need to be opened to receive the battery status of the AirTag 2. Run `python3 airtag-bat.py` -### Executable +### pip -A compiled executable is also located under `dist`. -Simply run `./airtag-bat` from this directory or link/move the executable to `/usr/local/bin`. +1. Install with `pip3 install airtag-bat` +2. Run anywhere with `airtag-bat` + +## Sample Output ![image](docs/output.png) diff --git a/airtag_bat/main.py b/airtag_bat/main.py index 9efddfe..931baa1 100644 --- a/airtag_bat/main.py +++ b/airtag_bat/main.py @@ -7,6 +7,11 @@ def get_bat(): # Location of FindMy cache file for AirTags FINDMY_FILES = '~/Library/Caches/com.apple.findmy.fmipcore/Items.data' + # checks if FindMy cache file exists + if os.path.exists(os.path.expanduser(FINDMY_FILES)) == False: + print("Please open FindMy to generate cache file") + return + # dict with AirTag names, and battery status airtags = {"AirTag" : [], "BatteryStatus" : [], "BatteryLevel" : []} diff --git a/dist/airtag_bat-1.0.1-py3-none-any.whl b/dist/airtag_bat-1.0.1-py3-none-any.whl new file mode 100644 index 0000000..e3b4ab7 Binary files /dev/null and b/dist/airtag_bat-1.0.1-py3-none-any.whl differ diff --git a/dist/airtag_bat-1.0.1.tar.gz b/dist/airtag_bat-1.0.1.tar.gz new file mode 100644 index 0000000..bed388f Binary files /dev/null and b/dist/airtag_bat-1.0.1.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index 52b005f..85efab5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "airtag_bat" -version = "1.0.0" +version = "1.0.1" description = "A tool to read AirTag battery status" authors = [ { name = "Henrik zu Jeddeloh", email = "henrik.zujeddeloh@protonmail.com"},