Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fixed: checks for FindMy chache file before running
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikzujeddeloh committed Oct 21, 2023
1 parent 5876e70 commit 5af78fc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions airtag_bat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" : []}

Expand Down
Binary file added dist/airtag_bat-1.0.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/airtag_bat-1.0.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"},
Expand Down

0 comments on commit 5af78fc

Please sign in to comment.