Skip to content

Commit 23ba31c

Browse files
authored
Upgrade to Kodi 20 (#23)
* refactor: PEP8 * refactor: update manifest and resources * refactor: move lib inside resources * refactor: more PEP8 * refactor: start to use dependency injection * feat: rewrite for kodi 21 * ci: fix workflow * ci: fix workflow * build: add pre-commit lint and typecheck * refactor: lint, use protocols * refactor: reformat settings * fix: working settings setters * fix: wrong ssdp discovery * fix version and workflow * build: add check script to pipenv * feat: add multiple instances handling closes #18 * feat: add audio capture component * fix: single instance components
1 parent 87bb83f commit 23ba31c

39 files changed

+1312
-832
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Check and publish addon
2+
3+
on: [push]
4+
5+
env:
6+
ADDON_NAME: script.service.hyperion-control
7+
TARGET_KODI_VER: nexus
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python 3.11
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.11"
18+
- name: Install addon checker
19+
run: |
20+
pip install -q kodi-addon-checker
21+
- name: Check with addon-checker
22+
run: |
23+
kodi-addon-checker --branch $TARGET_KODI_VER --allow-folder-id-mismatch .
24+
25+
publish:
26+
runs-on: ubuntu-latest
27+
28+
needs: check
29+
if: github.ref_type == 'tag'
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Set up Python 3.11
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: "3.11"
36+
- name: Install addon submitter
37+
run: |
38+
pip install -q git+https://github.com/xbmc/kodi-addon-submitter.git
39+
- name: Submit addon
40+
run: |
41+
submit-addon -r repo-scripts -b $TARGET_KODI_VER -s --pull-request $ADDON_NAME
42+
env:
43+
GH_USERNAME: ${{ github.actor }}
44+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
45+
EMAIL: ""

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ Desktop.ini
88
# python
99
*.pyo
1010
__pycache__
11+
.idea
12+
Pipfile.lock

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
default_language_version:
2+
python: python3
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: check-toml
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- id: check-added-large-files
12+
- repo: https://github.com/executablebooks/mdformat
13+
rev: 0.7.16
14+
hooks:
15+
- id: mdformat
16+
exclude: CHANGELOG.md
17+
additional_dependencies:
18+
- mdformat-black
19+
- mdformat-frontmatter
20+
- mdformat-admon
21+
- repo: https://github.com/psf/black
22+
rev: 22.10.0
23+
hooks:
24+
- id: black
25+
- repo: https://github.com/charliermarsh/ruff-pre-commit
26+
rev: 'v0.0.252'
27+
hooks:
28+
- id: ruff
29+
args: [--fix, --exit-non-zero-on-fix]
30+
- repo: https://github.com/pre-commit/mirrors-mypy
31+
rev: 'v1.4.1'
32+
hooks:
33+
- id: mypy

Pipfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
[dev-packages]
9+
kodistubs = "*"
10+
kodi-addon-checker = "*"
11+
12+
[requires]
13+
python_version = "3.11"
14+
15+
[scripts]
16+
pre-commit = "pre-commit install"
17+
lint = "pre-commit run --all"
18+
check = "kodi-addon-checker --branch nexus --allow-folder-id-mismatch ."

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Hyperion Control is an addon for Kodi Mediacenter that observes Kodi events (pla
88
For example playing a video should enable screen capture, if you pause the video or you are at the Kodi menu the screen capture should be disabled to show a background effect as mood light
99

1010
### Features
11+
1112
- Supports various Hyperion components
1213
- Setup wizard with Hyperion Server detection (zero configuration)
1314
- Token Authorization (optional)
@@ -16,9 +17,11 @@ For example playing a video should enable screen capture, if you pause the video
1617
- Execute from settings dialog: Hyperion Server detection
1718

1819
### Installation
20+
1921
- Download .zip from release page and use "Install from zip file" dialog at the Kodi addons section.
2022

2123
### Credits
24+
2225
- Dan Krause for the SSDP client
2326
- Paulchen-Panther for service development
2427
- brindosch for service development

addon.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<addon id="script.service.hyperion-control" name="Hyperion Control" version="19.0.2" provider-name="hyperion-project">
2+
<addon id="script.service.hyperion-control" name="Hyperion Control" version="20.0.0" provider-name="hyperion-project">
33
<requires>
4-
<import addon="xbmc.addon" version="17.0.0"/>
5-
<import addon="xbmc.python" version="3.0.0"/>
6-
<import addon="script.module.simplejson" version="3.3.0"/>
7-
<import addon="script.module.httplib2" version="0.8.0"/>
4+
<import addon="xbmc.addon" version="20.0.0"/>
5+
<import addon="xbmc.python" version="3.0.1"/>
6+
<import addon="script.module.requests" version="2.3.0"/>
87
</requires>
9-
<extension point="xbmc.service" library="service.py" start="login">
10-
<provides>service</provides>
11-
</extension>
8+
<extension point="xbmc.service" library="service.py"/>
129
<extension point="xbmc.addon.metadata">
1310
<summary lang="en_GB">Control Hyperion Ambilight</summary>
1411
<summary lang="de_DE">Hyperion Ambilight Steuerung</summary>
1512
<description lang="en_GB">Enable and disable components (like capture) of Hyperion automatically based on playing/screensaver state of Kodi[CR]-Supports auto detection of Hyperion Servers[CR]-Token authentication</description>
1613
<description lang="de_DE">Aktiviere und deaktiviere automatisch Hyperion Komponenten basierend auf dem aktuellen Kodi Status[CR]-Unterstützt Hyperion Server suche[CR]-Token Autorisierung</description>
17-
<disclaimer lang="en_GB"></disclaimer>
18-
<language></language>
14+
<language>en de es fr hu pl</language>
1915
<platform>all</platform>
2016
<license>MIT</license>
2117
<forum>https://hyperion-project.org/forum</forum>
22-
<website>https://www.hyperion-project.org</website>
23-
<email></email>
18+
<website>https://hyperion-project.org/forum</website>
2419
<source>https://github.com/hyperion-project/hyperion.control</source>
2520
<news>
21+
20.0.0
22+
- Kodi 20 (Nexus) support
23+
- major refactor to adhere to SOLID principles
24+
2625
19.0.2
2726
- New languages: Español, Français, Polski
2827

@@ -39,9 +38,9 @@
3938
- Fixed issue where kodi api does not properly announce video playing states
4039
</news>
4140
<assets>
42-
<icon>resources/media/icon.png</icon>
43-
<fanart>resources/media/fanart.png</fanart>
44-
<screenshot>resources/media/screenshot-01.png</screenshot>
41+
<icon>resources/icon.png</icon>
42+
<fanart>resources/fanart.png</fanart>
43+
<screenshot>resources/screenshot-01.png</screenshot>
4544
</assets>
4645
</extension>
4746
</addon>

lib/connection.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

lib/connection_ws.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

lib/gui.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)