pycatlink 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. pycatlink-1.0.0/.env.example +18 -0
  2. pycatlink-1.0.0/.github/FUNDING.yml +2 -0
  3. pycatlink-1.0.0/.github/workflows/publish.yml +118 -0
  4. pycatlink-1.0.0/.github/workflows/quality.yml +93 -0
  5. pycatlink-1.0.0/.github/workflows/release.yml +44 -0
  6. pycatlink-1.0.0/.gitignore +219 -0
  7. pycatlink-1.0.0/.python-version +1 -0
  8. pycatlink-1.0.0/.releaserc +12 -0
  9. pycatlink-1.0.0/.vscode/settings.json +4 -0
  10. pycatlink-1.0.0/LICENSE.md +9 -0
  11. pycatlink-1.0.0/NOTICE.md +205 -0
  12. pycatlink-1.0.0/PKG-INFO +35 -0
  13. pycatlink-1.0.0/README.md +10 -0
  14. pycatlink-1.0.0/custom_components/catlink/__init__.py +63 -0
  15. pycatlink-1.0.0/custom_components/catlink/binary_sensor.py +89 -0
  16. pycatlink-1.0.0/custom_components/catlink/button.py +107 -0
  17. pycatlink-1.0.0/custom_components/catlink/config_flow.py +116 -0
  18. pycatlink-1.0.0/custom_components/catlink/const.py +40 -0
  19. pycatlink-1.0.0/custom_components/catlink/coordinator.py +77 -0
  20. pycatlink-1.0.0/custom_components/catlink/entity.py +77 -0
  21. pycatlink-1.0.0/custom_components/catlink/icons.json +219 -0
  22. pycatlink-1.0.0/custom_components/catlink/manifest.json +16 -0
  23. pycatlink-1.0.0/custom_components/catlink/models.py +35 -0
  24. pycatlink-1.0.0/custom_components/catlink/select.py +215 -0
  25. pycatlink-1.0.0/custom_components/catlink/sensor.py +360 -0
  26. pycatlink-1.0.0/custom_components/catlink/switch.py +393 -0
  27. pycatlink-1.0.0/custom_components/catlink/translations/de.json +234 -0
  28. pycatlink-1.0.0/custom_components/catlink/translations/en.json +246 -0
  29. pycatlink-1.0.0/hacs.json +7 -0
  30. pycatlink-1.0.0/pycatlink/__init__.py +1 -0
  31. pycatlink-1.0.0/pycatlink/__main__.py +252 -0
  32. pycatlink-1.0.0/pycatlink/account.py +75 -0
  33. pycatlink-1.0.0/pycatlink/c08.py +444 -0
  34. pycatlink-1.0.0/pycatlink/client.py +159 -0
  35. pycatlink-1.0.0/pycatlink/const.py +243 -0
  36. pycatlink-1.0.0/pycatlink/device.py +43 -0
  37. pycatlink-1.0.0/pycatlink/exceptions.py +28 -0
  38. pycatlink-1.0.0/pycatlink/models.py +364 -0
  39. pycatlink-1.0.0/pycatlink/py.typed +0 -0
  40. pycatlink-1.0.0/pycatlink/utils.py +40 -0
  41. pycatlink-1.0.0/pyproject.toml +31 -0
  42. pycatlink-1.0.0/tests/.gitkeep +0 -0
  43. pycatlink-1.0.0/tests/test_dummy.py +2 -0
  44. pycatlink-1.0.0/uv.lock +2683 -0
@@ -0,0 +1,18 @@
1
+ # CatLink API Credentials
2
+ # Copy this file to .env and fill in your actual credentials
3
+ # The .env file should never be committed to version control
4
+
5
+ # Your CatLink account phone number
6
+ CATLINK_PHONE=your_phone_number_here
7
+
8
+ # Your CatLink account password
9
+ CATLINK_PASSWORD=your_password_here
10
+
11
+ # Optional: Phone international code (default: 86 for China)
12
+ # CATLINK_PHONE_INTERNATIONAL_CODE=86
13
+
14
+ # Optional: API base URL (use default if not specified)
15
+ # CATLINK_API_BASE=https://app.catlinks.cn/api
16
+
17
+ # Optional: Language code (default: zh_CN)
18
+ # CATLINK_LANGUAGE=zh_CN
@@ -0,0 +1,2 @@
1
+ github: EuleMitKeule
2
+ custom: paypal.me/lennardbeers
@@ -0,0 +1,118 @@
1
+ name: Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types:
7
+ - published
8
+
9
+ jobs:
10
+ version:
11
+ runs-on: ubuntu-latest
12
+ outputs:
13
+ version: ${{ steps.set_output.outputs.version }}
14
+ upload_url: ${{ steps.set_output.outputs.upload_url }}
15
+ env:
16
+ VERSION: ""
17
+ UPLOAD_URL: ""
18
+ steps:
19
+ - name: Get version and upload url from release
20
+ if: github.event_name == 'release'
21
+ run: |
22
+ echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
23
+ echo "UPLOAD_URL=${{ github.event.release.upload_url }}" >> $GITHUB_ENV
24
+
25
+ - name: Get release from API
26
+ if: github.event_name == 'workflow_dispatch'
27
+ id: release_api
28
+ uses: octokit/request-action@v2.x
29
+ with:
30
+ route: GET /repos/${{ github.repository }}/releases/latest
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.PAT }}
33
+
34
+ - name: Parse API response
35
+ if: github.event_name == 'workflow_dispatch'
36
+ run: |
37
+ echo "VERSION=${{ fromJson(steps.release_api.outputs.data).tag_name }}" >> $GITHUB_ENV
38
+ echo "UPLOAD_URL=${{ fromJson(steps.release_api.outputs.data).upload_url }}" >> $GITHUB_ENV
39
+
40
+ - name: Log version and upload URL
41
+ run: |
42
+ echo "Version: $VERSION"
43
+ echo "Upload URL: $UPLOAD_URL"
44
+
45
+ - name: Fail if no version or no upload URL
46
+ run: |
47
+ if [[ -z "$VERSION" || -z "$UPLOAD_URL" ]]; then
48
+ echo "Missing version or upload URL"
49
+ exit 1
50
+ fi
51
+
52
+ - name: Set outputs
53
+ id: set_output
54
+ run: |
55
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
56
+ echo "upload_url=$UPLOAD_URL" >> $GITHUB_OUTPUT
57
+
58
+ package:
59
+ needs: version
60
+ runs-on: ubuntu-latest
61
+ environment:
62
+ name: pypi
63
+ url: https://pypi.org/p/pycatlink
64
+ permissions:
65
+ id-token: write
66
+ steps:
67
+ - name: Checkout code
68
+ uses: actions/checkout@v6
69
+
70
+ - name: Set up Python
71
+ uses: actions/setup-python@v6
72
+ with:
73
+ python-version: "3.14"
74
+
75
+ - name: Install uv
76
+ uses: astral-sh/setup-uv@v7
77
+ with:
78
+ python-version: "3.14"
79
+ enable-cache: true
80
+ cache-suffix: uv-${{ runner.os }}-3.14
81
+
82
+ - name: Install dependecies
83
+ run: uv sync
84
+
85
+ - name: Set all versions
86
+ run: |
87
+ $version = "${{ needs.version.outputs.version }}"
88
+ Get-ChildItem -Recurse -File | ForEach-Object {
89
+ (Get-Content $_.FullName -Raw) -replace '0\.0\.0-dev', $version | Set-Content $_.FullName -NoNewline
90
+ }
91
+ shell: pwsh
92
+
93
+ - name: Build package
94
+ run: |
95
+ uv build
96
+
97
+ - name: Publish to PyPI
98
+ uses: pypa/gh-action-pypi-publish@release/v1
99
+
100
+ - name: Upload package to release
101
+ uses: actions/upload-release-asset@v1
102
+ env:
103
+ GITHUB_TOKEN: ${{ secrets.PAT }}
104
+ with:
105
+ upload_url: ${{ needs.version.outputs.upload_url }}
106
+ asset_path: ./dist/pycatlink-${{ needs.version.outputs.version }}.tar.gz
107
+ asset_name: pycatlink-${{ needs.version.outputs.version }}.tar.gz
108
+ asset_content_type: application/gzip
109
+
110
+ - name: Upload wheel to release
111
+ uses: actions/upload-release-asset@v1
112
+ env:
113
+ GITHUB_TOKEN: ${{ secrets.PAT }}
114
+ with:
115
+ upload_url: ${{ needs.version.outputs.upload_url }}
116
+ asset_path: ./dist/pycatlink-${{ needs.version.outputs.version }}-py3-none-any.whl
117
+ asset_name: pycatlink-${{ needs.version.outputs.version }}-py3-none-any.whl
118
+ asset_content_type: application/zip
@@ -0,0 +1,93 @@
1
+ name: Code Quality
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ types:
7
+ - opened
8
+ - synchronize
9
+ - reopened
10
+ push:
11
+ branches:
12
+ - master
13
+ - develop
14
+
15
+ jobs:
16
+ cache:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Checkout
20
+ uses: actions/checkout@v6
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v7
24
+ with:
25
+ python-version: "3.14"
26
+ enable-cache: true
27
+ cache-suffix: uv-${{ runner.os }}-3.14
28
+
29
+ - name: Install dependecies
30
+ run: uv sync --all-groups
31
+
32
+ ruff:
33
+ needs: cache
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - name: Checkout
37
+ uses: actions/checkout@v6
38
+
39
+ - name: Install uv
40
+ uses: astral-sh/setup-uv@v7
41
+ with:
42
+ python-version: "3.14"
43
+ enable-cache: true
44
+ cache-suffix: uv-${{ runner.os }}-3.14
45
+
46
+ - name: Install dependecies
47
+ run: uv sync --all-groups
48
+
49
+ - name: Run ruff
50
+ run: |
51
+ uv run ruff check .
52
+
53
+ mypy:
54
+ needs: cache
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - name: Checkout
58
+ uses: actions/checkout@v6
59
+
60
+ - name: Install uv
61
+ uses: astral-sh/setup-uv@v7
62
+ with:
63
+ python-version: "3.14"
64
+ enable-cache: true
65
+ cache-suffix: uv-${{ runner.os }}-3.14
66
+
67
+ - name: Install dependecies
68
+ run: uv sync --all-groups
69
+
70
+ - name: Run mypy
71
+ run: |
72
+ uv run mypy --strict .
73
+
74
+ tests:
75
+ needs: cache
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - name: Checkout
79
+ uses: actions/checkout@v6
80
+
81
+ - name: Install uv
82
+ uses: astral-sh/setup-uv@v7
83
+ with:
84
+ python-version: "3.14"
85
+ enable-cache: true
86
+ cache-suffix: uv-${{ runner.os }}-3.14
87
+
88
+ - name: Install dependecies
89
+ run: uv sync --all-groups
90
+
91
+ - name: Run tests
92
+ run: |
93
+ uv run pytest --cov=. --cov-report=term tests
@@ -0,0 +1,44 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ release:
8
+ runs-on: ubuntu-latest
9
+ concurrency: release
10
+ permissions:
11
+ contents: write
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v6
15
+ with:
16
+ fetch-depth: 0
17
+ persist-credentials: false
18
+
19
+ - name: Semantic Release
20
+ id: semantic
21
+ uses: cycjimmy/semantic-release-action@v6
22
+ env:
23
+ GITHUB_TOKEN: ${{ secrets.PAT }}
24
+
25
+ - name: Inject version into manifest
26
+ if: steps.semantic.outputs.new_release_published == 'true'
27
+ run: |
28
+ sed -i 's/"version": "0.0.0-dev"/"version": "${{ steps.semantic.outputs.new_release_version }}"/' \
29
+ custom_components/catlink/manifest.json
30
+ sed -i 's/version = "0.0.0-dev"/version = "${{ steps.semantic.outputs.new_release_version }}"/' \
31
+ pyproject.toml
32
+
33
+ - name: Create zip
34
+ if: steps.semantic.outputs.new_release_published == 'true'
35
+ run: |
36
+ cd custom_components/catlink
37
+ zip -r ../../catlink.zip .
38
+
39
+ - name: Upload zip to release
40
+ if: steps.semantic.outputs.new_release_published == 'true'
41
+ run: |
42
+ gh release upload ${{ steps.semantic.outputs.new_release_version }} catlink.zip
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.PAT }}
@@ -0,0 +1,219 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+
204
+ # Ruff stuff:
205
+ .ruff_cache/
206
+
207
+ # PyPI configuration file
208
+ .pypirc
209
+
210
+ # Marimo
211
+ marimo/_static/
212
+ marimo/_lsp/
213
+ __marimo__/
214
+
215
+ # Streamlit
216
+ .streamlit/secrets.toml
217
+
218
+ # Custom
219
+ data/
@@ -0,0 +1 @@
1
+ 3.14.2
@@ -0,0 +1,12 @@
1
+ {
2
+ "repository_url": "https://github.com/eulemitkeule/pycatlink.git",
3
+ "branches": [
4
+ "master"
5
+ ],
6
+ "plugins": [
7
+ "@semantic-release/commit-analyzer",
8
+ "@semantic-release/release-notes-generator",
9
+ "@semantic-release/github"
10
+ ],
11
+ "tagFormat": "${version}"
12
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "python.testing.pytestEnabled": true,
3
+ "python.testing.unittestEnabled": false,
4
+ }
@@ -0,0 +1,9 @@
1
+ # MIT License
2
+
3
+ Copyright 2026 Lennard Beers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.