meteocat 0.1.19
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.
- package/.github/workflows/release.yml +33 -0
- package/.pre-commit-config.yaml +37 -0
- package/.releaserc +11 -0
- package/.releaserc.toml +14 -0
- package/AUTHORS.md +12 -0
- package/CHANGELOG.md +361 -0
- package/LICENSE +194 -0
- package/README.md +41 -0
- package/custom_components/meteocat/__init__.py +139 -0
- package/custom_components/meteocat/condition.py +28 -0
- package/custom_components/meteocat/config_flow.py +192 -0
- package/custom_components/meteocat/const.py +46 -0
- package/custom_components/meteocat/coordinator.py +177 -0
- package/custom_components/meteocat/entity.py +91 -0
- package/custom_components/meteocat/helpers.py +42 -0
- package/custom_components/meteocat/manifest.json +12 -0
- package/custom_components/meteocat/options_flow.py +71 -0
- package/custom_components/meteocat/sensor.py +190 -0
- package/custom_components/meteocat/strings.json +26 -0
- package/custom_components/meteocat/translations/ca.json +26 -0
- package/custom_components/meteocat/translations/en.json +26 -0
- package/custom_components/meteocat/translations/es.json +26 -0
- package/custom_components/meteocat/version.py +2 -0
- package/filetree.py +48 -0
- package/filetree.txt +43 -0
- package/hacs.json +6 -0
- package/package.json +22 -0
- package/poetry.lock +3205 -0
- package/pyproject.toml +64 -0
- package/releaserc.json +18 -0
- package/requirements.test.txt +3 -0
- package/setup.cfg +64 -0
- package/setup.py +10 -0
- package/tests/__init__.py +0 -0
- package/tests/bandit.yaml +17 -0
- package/tests/conftest.py +19 -0
- package/tests/test_init.py +9 -0
package/pyproject.toml
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "meteocat"
|
|
3
|
+
version = "0.1.18"
|
|
4
|
+
description = "Script para obtener datos meteorológicos de la API de Meteocat"
|
|
5
|
+
authors = ["figorr <jdcuartero@yahoo.es>"]
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
repository = "https://gitlab.com/figorr/meteocat"
|
|
9
|
+
keywords = ['meteocat']
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
[tool.poetry.dependencies]
|
|
13
|
+
python = "3.12.7"
|
|
14
|
+
requests = "^2.32.3"
|
|
15
|
+
python-dotenv = "^1.0.1"
|
|
16
|
+
simplejson = "^3.19.3"
|
|
17
|
+
setuptools = "^75.5.0"
|
|
18
|
+
python-semantic-release = "^9.14.0"
|
|
19
|
+
twine = "^5.1.1"
|
|
20
|
+
aiofiles = "^24.1.0"
|
|
21
|
+
voluptuous = "^0.15.2"
|
|
22
|
+
syrupy = "^4.8.0"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
[tool.semantic_release]
|
|
26
|
+
branch = "master" # Define la rama desde la que se harán los lanzamientos
|
|
27
|
+
version_source = "commit" # Determina la versión basada en los commits
|
|
28
|
+
version_variable = "meteocat/version.py:__version__" # Ubicación de la variable de versión
|
|
29
|
+
changelog = { file = "CHANGELOG.md" } # Genera el changelog en el archivo especificado
|
|
30
|
+
upload_to_pypi = false # Sube automáticamente la versión a PyPI
|
|
31
|
+
ci = false # Cambiar a false si no usas CI/CD
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
[build-system]
|
|
35
|
+
requires = ["poetry-core"]
|
|
36
|
+
build-backend = "poetry.core.masonry.api"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[tool.poetry.dev-dependencies]
|
|
40
|
+
aresponses = "*"
|
|
41
|
+
detox = "*"
|
|
42
|
+
flake8 = "*"
|
|
43
|
+
mypy = "*"
|
|
44
|
+
pydocstyle = "*"
|
|
45
|
+
pylint = "*"
|
|
46
|
+
pytest-aiohttp = "*"
|
|
47
|
+
pytest-cov = "*"
|
|
48
|
+
python-semantic-release = "^9.14.0"
|
|
49
|
+
tox = "*"
|
|
50
|
+
safety = ">=1.8.7"
|
|
51
|
+
black = { version = ">19.10b0", allow-prereleases = true }
|
|
52
|
+
Sphinx = ">=3.5.0,<7.0.0"
|
|
53
|
+
autoapi = ">=2.0.1"
|
|
54
|
+
sphinx-rtd-theme = "^0.5.1"
|
|
55
|
+
m2r2 = ">=0.2.7"
|
|
56
|
+
tomlkit = ">=0.7.0"
|
|
57
|
+
sphinx-autoapi = ">=1.7.0"
|
|
58
|
+
sphinx-copybutton = ">=0.3.1"
|
|
59
|
+
pipdeptree = "^2.2.1"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
[tool.poetry.group.dev.dependencies]
|
|
63
|
+
pyupgrade = "^3.4.0"
|
|
64
|
+
pre-commit = "^3.3.1"
|
package/releaserc.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": ["master"],
|
|
3
|
+
"plugins": [
|
|
4
|
+
"@semantic-release/commit-analyzer",
|
|
5
|
+
"@semantic-release/release-notes-generator",
|
|
6
|
+
"@semantic-release/changelog",
|
|
7
|
+
[
|
|
8
|
+
"@semantic-release/exec",
|
|
9
|
+
{
|
|
10
|
+
"prepareCmd": "python setup.py sdist bdist_wheel",
|
|
11
|
+
"publishCmd": "twine upload dist/* -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD}"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"@semantic-release/github",
|
|
15
|
+
"@semantic-release/git"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
|
package/setup.cfg
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[coverage:run]
|
|
2
|
+
source =
|
|
3
|
+
custom_components
|
|
4
|
+
|
|
5
|
+
[coverage:report]
|
|
6
|
+
exclude_lines =
|
|
7
|
+
pragma: no cover
|
|
8
|
+
raise NotImplemented()
|
|
9
|
+
if __name__ == '__main__':
|
|
10
|
+
main()
|
|
11
|
+
show_missing = true
|
|
12
|
+
|
|
13
|
+
[tool:pytest]
|
|
14
|
+
testpaths = tests
|
|
15
|
+
norecursedirs = .git
|
|
16
|
+
asyncio_mode = auto
|
|
17
|
+
addopts =
|
|
18
|
+
-p syrupy
|
|
19
|
+
--strict
|
|
20
|
+
--cov=custom_components
|
|
21
|
+
|
|
22
|
+
[flake8]
|
|
23
|
+
# https://github.com/ambv/black#line-length
|
|
24
|
+
max-line-length = 88
|
|
25
|
+
# E501: line too long
|
|
26
|
+
# W503: Line break occurred before a binary operator
|
|
27
|
+
# E203: Whitespace before ':'
|
|
28
|
+
# D202 No blank lines allowed after function docstring
|
|
29
|
+
# W504 line break after binary operator
|
|
30
|
+
ignore =
|
|
31
|
+
E501,
|
|
32
|
+
W503,
|
|
33
|
+
E203,
|
|
34
|
+
D202,
|
|
35
|
+
W504
|
|
36
|
+
|
|
37
|
+
[isort]
|
|
38
|
+
# https://github.com/timothycrosley/isort
|
|
39
|
+
# https://github.com/timothycrosley/isort/wiki/isort-Settings
|
|
40
|
+
# splits long import on multiple lines indented by 4 spaces
|
|
41
|
+
multi_line_output = 3
|
|
42
|
+
include_trailing_comma=True
|
|
43
|
+
force_grid_wrap=0
|
|
44
|
+
use_parentheses=True
|
|
45
|
+
line_length=88
|
|
46
|
+
indent = " "
|
|
47
|
+
# by default isort don't check module indexes
|
|
48
|
+
not_skip = __init__.py
|
|
49
|
+
# will group `import x` and `from x import` of the same module.
|
|
50
|
+
force_sort_within_sections = true
|
|
51
|
+
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
|
|
52
|
+
default_section = THIRDPARTY
|
|
53
|
+
known_first_party = custom_components,tests
|
|
54
|
+
forced_separate = tests
|
|
55
|
+
combine_as_imports = true
|
|
56
|
+
|
|
57
|
+
[mypy]
|
|
58
|
+
python_version = 3.7
|
|
59
|
+
ignore_errors = true
|
|
60
|
+
follow_imports = silent
|
|
61
|
+
ignore_missing_imports = true
|
|
62
|
+
warn_incomplete_stub = true
|
|
63
|
+
warn_redundant_casts = true
|
|
64
|
+
warn_unused_configs = true
|
package/setup.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
# Leer la versión desde el archivo version.py
|
|
4
|
+
with open("meteocat/version.py") as f:
|
|
5
|
+
exec(f.read()) # Ejecuta el archivo version.py para cargar la variable __version__
|
|
6
|
+
|
|
7
|
+
setup(
|
|
8
|
+
name="meteocat",
|
|
9
|
+
version=__version__, # Usa la versión cargada dinámicamente # type: ignore
|
|
10
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Fixtures for testing."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
import sys
|
|
5
|
+
import os
|
|
6
|
+
from homeassistant.setup import async_setup_component
|
|
7
|
+
from homeassistant.core import HomeAssistant
|
|
8
|
+
|
|
9
|
+
# Agregar el directorio raíz al PYTHONPATH
|
|
10
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
11
|
+
|
|
12
|
+
# Habilitar la integración personalizada 'meteocat' en el entorno de pruebas
|
|
13
|
+
@pytest.fixture(autouse=True)
|
|
14
|
+
async def auto_enable_custom_integrations(hass: HomeAssistant):
|
|
15
|
+
"""Enable custom integrations."""
|
|
16
|
+
# Aquí se puede habilitar la integración personalizada 'meteocat'
|
|
17
|
+
await async_setup_component(hass, 'meteocat', {})
|
|
18
|
+
yield
|
|
19
|
+
# Si es necesario, puedes hacer limpieza después de cada prueba
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""Test component setup."""
|
|
2
|
+
from homeassistant.setup import async_setup_component
|
|
3
|
+
|
|
4
|
+
from custom_components.meteocat.const import DOMAIN
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
async def test_async_setup(hass):
|
|
8
|
+
"""Test the component gets setup."""
|
|
9
|
+
assert await async_setup_component(hass, DOMAIN, {}) is True
|