Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for public release with latest integration library #13

Merged
merged 29 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f72d92e
WIP (api events broken) project refactoring
zehnm Nov 21, 2023
f682378
WIP refactor: own module for driver setup flow
zehnm Feb 16, 2024
aef1a80
build: ucapi 0.1.4
zehnm Feb 28, 2024
af5d53c
ci: enable automated builds on push
zehnm Feb 28, 2024
8d0b3ef
WIP Cleaning up AppleTv class
zehnm Feb 28, 2024
8134668
build: add IntelliJ project configuration
zehnm Feb 28, 2024
2aadfe3
build: ucapi 0.1.5
zehnm Feb 28, 2024
187635c
fixup! ci: enable automated builds on push
zehnm Feb 28, 2024
1583298
WIP Cleaning up driver.py
zehnm Feb 28, 2024
5a56826
fixup! ci: enable automated builds on push
zehnm Feb 29, 2024
d090e40
WIP fix all linting issues
zehnm Feb 29, 2024
4a52710
Allow manual IP address to setup AppleTV
zehnm Feb 29, 2024
70d050c
Improved error handling for invalid configuration file
zehnm Feb 29, 2024
f6ff478
WIP working setup flow & basic functionality
zehnm Feb 29, 2024
6ddd86e
fix update event, add new key commands
zehnm Feb 29, 2024
097501b
test new key commands with color buttons
zehnm Feb 29, 2024
3718dee
WIP bug fixes, clean up, new commands
zehnm Mar 1, 2024
11b8240
Update ucapi with new media-player features
zehnm Mar 4, 2024
ecf0c08
Enhance device configuration with address field
zehnm Mar 4, 2024
f845b92
AppleTv class cleanup
zehnm Mar 4, 2024
213950e
AppleTv class cleanup & manual device setup
zehnm Mar 4, 2024
c808c3a
fix: only discover Apple TV devices
zehnm Mar 4, 2024
0aebc06
Initial changelog, clean up
zehnm Mar 4, 2024
200d667
Bug fixes, enhanced setup flow, initial multi-device support
zehnm Mar 5, 2024
308f7f6
Connect ATV when subscribing to entities
zehnm Mar 5, 2024
a737780
Log device name in AppleTv
zehnm Mar 5, 2024
422e645
Fix driver state handling with multiple devices
zehnm Mar 5, 2024
404ea04
Power and device state handling fixes
zehnm Mar 6, 2024
f1994cd
Update docs
zehnm Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# GitHub Action to build a self contained binary of the Apple TV Python driver
# GitHub Action to build a self-contained binary of the Apple TV Python driver
---
name: "Build & Release"

on:
workflow_dispatch:
push:
branches:
- main
- refactor/intg-lib-0.1.3 # FOR TESTING ONLY
tags:
- v[0-9]+.[0-9]+.[0-9]+*
# pull_request:
# branches:
# - main
# types: [ opened, synchronize, reopened ]
pull_request:
types: [ opened, synchronize, reopened ]

env:
INTG_NAME: appletv
Expand All @@ -23,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# History of 200 should be more than enough to calculate commit count since last release tag.
fetch-depth: 200
Expand All @@ -33,13 +34,6 @@ jobs:
git fetch origin +refs/tags/*:refs/tags/*
echo "VERSION=$(git describe --match "v[0-9]*" --tags HEAD --always)" >> $GITHUB_ENV

# We need the integration library, this is temporary until we decide to publish it to pypi
- name: Clone integrations library
shell: bash
run: |
git clone https://martonborzak:${{ secrets.PAT }}@github.com/aitatoi/integration-python-library.git --branch v0.0.10
ls -lah

- name: Verify driver.json version for release build
if: contains(github.ref, 'tags/v')
run: |
Expand All @@ -60,19 +54,16 @@ jobs:
-v ${GITHUB_WORKSPACE}:/workspace \
docker.io/unfoldedcircle/r2-pyinstaller:${PYTHON_VER} \
bash -c \
"cd /workspace/integration-python-library && \
python setup.py bdist_wheel && \
pip install -I dist/ucapi-0.0.10-py3-none-any.whl && \
cd /workspace && \
"cd /workspace && \
python -m pip install -r requirements.txt && \
pyinstaller --clean --onefile --name intg-appletv --collect-all zeroconf driver.py"
pyinstaller --clean --onefile --name intg-appletv --collect-all zeroconf intg-appletv/driver.py"

- name: Add version
run: |
mkdir -p artifacts
cd artifacts
echo ${{ env.VERSION }} > version.txt

- name: Prepare artifacts
shell: bash
run: |
Expand All @@ -86,7 +77,7 @@ jobs:
tar czvf ${{ env.ARTIFACT_NAME }}.tar.gz -C ${GITHUB_WORKSPACE}/artifacts .
ls -lah

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
id: upload_artifact
with:
name: ${{ env.ARTIFACT_NAME }}
Expand All @@ -102,7 +93,7 @@ jobs:

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: Extract build archives from downloaded files
run: |
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/python-code-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Check Python code formatting

on:
push:
paths:
- 'intg-appletv/**'
- 'requirements.txt'
- 'test-requirements.txt'
- 'tests/**'
- '.github/**/*.yml'
- '.pylintrc'
- 'pyproject.toml'
pull_request:
branches: [main]
types: [opened, synchronize, reopened]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-22.04

name: Check Python code formatting
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install pip
run: |
python -m pip install --upgrade pip

- name: Install dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Analyzing the code with pylint
run: |
python -m pylint intg-appletv
- name: Lint with flake8
run: |
python -m flake8 intg-appletv --count --show-source --statistics
- name: Check code formatting with isort
run: |
python -m isort intg-appletv/. --check --verbose
- name: Check code formatting with black
run: |
python -m black intg-appletv --check --verbose --line-length 120
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/integration-appletv.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .idea/runConfigurations/check_black.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .idea/runConfigurations/check_flake8.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .idea/runConfigurations/check_isort.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions .idea/runConfigurations/driver.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .idea/runConfigurations/pylint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading