Compare commits

...

11 Commits
187 ... 189

Author SHA1 Message Date
Pascal Vizeli
cea1a1a15f Merge pull request #1306 from home-assistant/dev
Release 189
2019-09-24 15:24:27 +02:00
dependabot-preview[bot]
c2700b14dc Bump packaging from 19.1 to 19.2 (#1305)
Bumps [packaging](https://github.com/pypa/packaging) from 19.1 to 19.2.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pypa/packaging/compare/19.1...19.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-24 10:31:56 +02:00
dependabot-preview[bot]
07d27170db Bump pytest from 5.1.2 to 5.1.3 (#1303)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.1.2...5.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-24 10:31:13 +02:00
Pascal Vizeli
8eb8c07df6 Update uvloop 0.13.0 (#1302) 2019-09-23 23:00:57 +02:00
Pascal Vizeli
7bee6f884c Update aiohttp 3.6.1 (#1301) 2019-09-23 22:45:02 +02:00
Franck Nijhof
78dd20e314 Fixes accidental string concatenation in classifiers list (#1300) 2019-09-23 12:23:57 +02:00
Pascal Vizeli
2a011b6448 Fix typo to validate list (#1298)
* Fix typo to validate list

* Fix lint

* Add Typo
2019-09-20 17:28:23 +02:00
Pascal Vizeli
5c90370ec8 Bump version 189 2019-09-15 15:08:12 +02:00
Pascal Vizeli
120465b88d Merge pull request #1294 from home-assistant/dev
Release 188
2019-09-15 15:07:39 +02:00
Pascal Vizeli
c77292439a Fix invalid secrets (#1293)
* Fix invalid secrets format

* Fix style
2019-09-15 15:06:22 +02:00
Pascal Vizeli
0a0209f81a Bump version 188 2019-09-12 23:32:20 +02:00
6 changed files with 19 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
import logging
import re
import secrets
from typing import Any, Dict
import uuid
import voluptuous as vol
@@ -85,6 +86,7 @@ from ..const import (
STATE_STARTED,
STATE_STOPPED,
)
from ..coresys import CoreSys
from ..discovery.validate import valid_discovery_service
from ..validate import (
ALSA_DEVICE,
@@ -310,7 +312,7 @@ SCHEMA_ADDON_SNAPSHOT = vol.Schema(
)
def validate_options(coresys, raw_schema):
def validate_options(coresys: CoreSys, raw_schema: Dict[str, Any]):
"""Validate schema."""
def validate(struct):
@@ -346,7 +348,7 @@ def validate_options(coresys, raw_schema):
# pylint: disable=no-value-for-parameter
# pylint: disable=inconsistent-return-statements
def _single_validate(coresys, typ, value, key):
def _single_validate(coresys: CoreSys, typ: str, value: Any, key: str):
"""Validate a single element."""
# if required argument
if value is None:
@@ -385,7 +387,7 @@ def _single_validate(coresys, typ, value, key):
return NETWORK_PORT(value)
elif typ.startswith(V_MATCH):
return vol.Match(match.group("match"))(str(value))
elif typ.strartswith(V_LIST):
elif typ.startswith(V_LIST):
return vol.In(match.group("list").split("|"))(str(value))
raise vol.Invalid(f"Fatal error for {key} type {typ}")

View File

@@ -2,7 +2,7 @@
from pathlib import Path
from ipaddress import ip_network
HASSIO_VERSION = "187"
HASSIO_VERSION = "189"
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"

View File

@@ -5,12 +5,15 @@ from pathlib import Path
from typing import Dict
from ruamel.yaml import YAML, YAMLError
import voluptuous as vol
from .coresys import CoreSys, CoreSysAttributes
from .utils import AsyncThrottle
_LOGGER: logging.Logger = logging.getLogger(__name__)
SECRETS_SCHEMA = vol.Schema({str: vol.Any(str, int, None, float)})
class SecretsManager(CoreSysAttributes):
"""Manage Home Assistant secrets."""
@@ -50,8 +53,12 @@ class SecretsManager(CoreSysAttributes):
# Read secrets
try:
yaml = YAML()
self.secrets = await self.sys_run_in_executor(yaml.load, self.path_secrets)
data = await self.sys_run_in_executor(yaml.load, self.path_secrets) or {}
self.secrets = SECRETS_SCHEMA(data)
except YAMLError as err:
_LOGGER.error("Can't process Home Assistant secrets: %s", err)
except vol.Invalid:
_LOGGER.warning("Home Assistant secrets have a invalid format")
else:
_LOGGER.debug("Reload Home Assistant secrets: %s", len(self.secrets))

View File

@@ -1,4 +1,4 @@
aiohttp==3.5.4
aiohttp==3.6.1
async_timeout==3.0.1
attrs==19.1.0
cchardet==2.1.4
@@ -7,10 +7,10 @@ cpe==1.2.1
cryptography==2.7
docker==4.0.2
gitpython==3.0.2
packaging==19.1
packaging==19.2
pytz==2019.2
pyudev==0.21.0
ruamel.yaml==0.15.100
uvloop==0.12.2
uvloop==0.13.0
voluptuous==0.11.7
ptvsd==4.3.2

View File

@@ -1,5 +1,5 @@
flake8==3.7.8
pylint==2.3.1
pytest==5.1.2
pytest==5.1.3
pytest-timeout==1.3.3
pytest-aiohttp==0.3.0

View File

@@ -19,7 +19,7 @@ setup(
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Home Automation"
"Topic :: Home Automation",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Development Status :: 5 - Production/Stable",