mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
commit
baf7fb7264
@ -2,9 +2,15 @@
|
|||||||
.git
|
.git
|
||||||
.github
|
.github
|
||||||
config
|
config
|
||||||
|
docs
|
||||||
|
|
||||||
|
# Development
|
||||||
|
.devcontainer
|
||||||
|
.vscode
|
||||||
|
|
||||||
# Test related files
|
# Test related files
|
||||||
.tox
|
.tox
|
||||||
|
tests
|
||||||
|
|
||||||
# Other virtualization methods
|
# Other virtualization methods
|
||||||
venv
|
venv
|
||||||
|
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
ARG BUILD_FROM
|
||||||
|
FROM ${BUILD_FROM}
|
||||||
|
|
||||||
|
WORKDIR /usr/src
|
||||||
|
|
||||||
|
## Setup Home Assistant
|
||||||
|
COPY . homeassistant/
|
||||||
|
RUN pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
||||||
|
-r homeassistant/requirements_all.txt -c homeassistant/homeassistant/package_constraints.txt \
|
||||||
|
&& pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
|
||||||
|
-e ./homeassistant \
|
||||||
|
&& python3 -m compileall homeassistant/homeassistant
|
||||||
|
|
||||||
|
# Home Assistant S6-Overlay
|
||||||
|
COPY rootfs /
|
||||||
|
|
||||||
|
WORKDIR /config
|
@ -14,7 +14,7 @@ schedules:
|
|||||||
always: true
|
always: true
|
||||||
variables:
|
variables:
|
||||||
- name: versionBuilder
|
- name: versionBuilder
|
||||||
value: '6.9'
|
value: '7.2.0'
|
||||||
- group: docker
|
- group: docker
|
||||||
- group: github
|
- group: github
|
||||||
- group: twine
|
- group: twine
|
||||||
@ -108,11 +108,9 @@ stages:
|
|||||||
docker run --rm --privileged \
|
docker run --rm --privileged \
|
||||||
-v ~/.docker:/root/.docker:rw \
|
-v ~/.docker:/root/.docker:rw \
|
||||||
-v /run/docker.sock:/run/docker.sock:rw \
|
-v /run/docker.sock:/run/docker.sock:rw \
|
||||||
-v $(pwd):/homeassistant:ro \
|
-v $(pwd):/data:ro \
|
||||||
homeassistant/amd64-builder:$(versionBuilder) \
|
homeassistant/amd64-builder:$(versionBuilder) \
|
||||||
--homeassistant $(homeassistantRelease) "--$(buildArch)" \
|
--generic $(homeassistantRelease) "--$(buildArch)" -t /data \
|
||||||
-r https://github.com/home-assistant/hassio-homeassistant \
|
|
||||||
-t generic --docker-hub homeassistant
|
|
||||||
|
|
||||||
docker run --rm --privileged \
|
docker run --rm --privileged \
|
||||||
-v ~/.docker:/root/.docker \
|
-v ~/.docker:/root/.docker \
|
||||||
|
@ -5,6 +5,7 @@ trigger:
|
|||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- dev
|
- dev
|
||||||
|
- rc
|
||||||
paths:
|
paths:
|
||||||
include:
|
include:
|
||||||
- requirements_all.txt
|
- requirements_all.txt
|
||||||
@ -18,7 +19,7 @@ schedules:
|
|||||||
always: true
|
always: true
|
||||||
variables:
|
variables:
|
||||||
- name: versionWheels
|
- name: versionWheels
|
||||||
value: '1.4-3.7-alpine3.10'
|
value: '1.10.1-3.7-alpine3.11'
|
||||||
resources:
|
resources:
|
||||||
repositories:
|
repositories:
|
||||||
- repository: azure
|
- repository: azure
|
||||||
@ -32,8 +33,10 @@ jobs:
|
|||||||
builderVersion: '$(versionWheels)'
|
builderVersion: '$(versionWheels)'
|
||||||
builderApk: 'build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev'
|
builderApk: 'build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev'
|
||||||
builderPip: 'Cython;numpy'
|
builderPip: 'Cython;numpy'
|
||||||
|
skipBinary: 'aiohttp'
|
||||||
wheelsRequirement: 'requirements_wheels.txt'
|
wheelsRequirement: 'requirements_wheels.txt'
|
||||||
wheelsRequirementDiff: 'requirements_diff.txt'
|
wheelsRequirementDiff: 'requirements_diff.txt'
|
||||||
|
wheelsConstraint: 'homeassistant/package_constraints.txt'
|
||||||
preBuild:
|
preBuild:
|
||||||
- script: |
|
- script: |
|
||||||
cp requirements_all.txt requirements_wheels.txt
|
cp requirements_all.txt requirements_wheels.txt
|
||||||
@ -69,9 +72,5 @@ jobs:
|
|||||||
sed -i "s|# py_noaa|py_noaa|g" ${requirement_file}
|
sed -i "s|# py_noaa|py_noaa|g" ${requirement_file}
|
||||||
sed -i "s|# bme680|bme680|g" ${requirement_file}
|
sed -i "s|# bme680|bme680|g" ${requirement_file}
|
||||||
sed -i "s|# python-gammu|python-gammu|g" ${requirement_file}
|
sed -i "s|# python-gammu|python-gammu|g" ${requirement_file}
|
||||||
|
|
||||||
if [[ "$(buildArch)" =~ arm ]]; then
|
|
||||||
sed -i "s|# VL53L1X|VL53L1X|g" ${requirement_file}
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
displayName: 'Prepare requirements files for Hass.io'
|
displayName: 'Prepare requirements files for Hass.io'
|
||||||
|
14
build.json
Normal file
14
build.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"image": "homeassistant/{arch}-homeassistant",
|
||||||
|
"build_from": {
|
||||||
|
"aarch64": "homeassistant/aarch64-homeassistant-base:7.0.1",
|
||||||
|
"armhf": "homeassistant/armhf-homeassistant-base:7.0.1",
|
||||||
|
"armv7": "homeassistant/armv7-homeassistant-base:7.0.1",
|
||||||
|
"amd64": "homeassistant/amd64-homeassistant-base:7.0.1",
|
||||||
|
"i386": "homeassistant/i386-homeassistant-base:7.0.1"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"io.hass.type": "core"
|
||||||
|
},
|
||||||
|
"version_tag": true
|
||||||
|
}
|
@ -75,8 +75,9 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
|||||||
|
|
||||||
def token_saver(token):
|
def token_saver(token):
|
||||||
_LOGGER.debug("Saving updated token")
|
_LOGGER.debug("Saving updated token")
|
||||||
entry.data[CONF_TOKEN] = token
|
hass.config_entries.async_update_entry(
|
||||||
hass.config_entries.async_update_entry(entry, data={**entry.data})
|
entry, data={**entry.data, CONF_TOKEN: token}
|
||||||
|
)
|
||||||
|
|
||||||
# Force token update.
|
# Force token update.
|
||||||
entry.data[CONF_TOKEN]["expires_in"] = -1
|
entry.data[CONF_TOKEN]["expires_in"] = -1
|
||||||
@ -105,12 +106,18 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
|||||||
async def async_setup_webhook(hass: HomeAssistantType, entry: ConfigEntry, session):
|
async def async_setup_webhook(hass: HomeAssistantType, entry: ConfigEntry, session):
|
||||||
"""Set up a webhook to handle binary sensor events."""
|
"""Set up a webhook to handle binary sensor events."""
|
||||||
if CONF_WEBHOOK_ID not in entry.data:
|
if CONF_WEBHOOK_ID not in entry.data:
|
||||||
entry.data[CONF_WEBHOOK_ID] = hass.components.webhook.async_generate_id()
|
webhook_id = hass.components.webhook.async_generate_id()
|
||||||
entry.data[CONF_WEBHOOK_URL] = hass.components.webhook.async_generate_url(
|
webhook_url = hass.components.webhook.async_generate_url(webhook_id)
|
||||||
entry.data[CONF_WEBHOOK_ID]
|
_LOGGER.info("Registering new webhook at: %s", webhook_url)
|
||||||
|
|
||||||
|
hass.config_entries.async_update_entry(
|
||||||
|
entry,
|
||||||
|
data={
|
||||||
|
**entry.data,
|
||||||
|
CONF_WEBHOOK_ID: webhook_id,
|
||||||
|
CONF_WEBHOOK_URL: webhook_url,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
_LOGGER.info("Registering new webhook at: %s", entry.data[CONF_WEBHOOK_URL])
|
|
||||||
hass.config_entries.async_update_entry(entry, data={**entry.data})
|
|
||||||
await hass.async_add_executor_job(
|
await hass.async_add_executor_job(
|
||||||
session.update_webhook,
|
session.update_webhook,
|
||||||
entry.data[CONF_WEBHOOK_URL],
|
entry.data[CONF_WEBHOOK_URL],
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Z-Wave",
|
"name": "Z-Wave",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/zwave",
|
"documentation": "https://www.home-assistant.io/integrations/zwave",
|
||||||
"requirements": ["homeassistant-pyozw==0.1.9", "pydispatcher==2.0.5"],
|
"requirements": ["homeassistant-pyozw==0.1.10", "pydispatcher==2.0.5"],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@home-assistant/z-wave"]
|
"codeowners": ["@home-assistant/z-wave"]
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Constants used by Home Assistant components."""
|
"""Constants used by Home Assistant components."""
|
||||||
MAJOR_VERSION = 0
|
MAJOR_VERSION = 0
|
||||||
MINOR_VERSION = 107
|
MINOR_VERSION = 107
|
||||||
PATCH_VERSION = "5"
|
PATCH_VERSION = "6"
|
||||||
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
||||||
__version__ = f"{__short_version__}.{PATCH_VERSION}"
|
__version__ = f"{__short_version__}.{PATCH_VERSION}"
|
||||||
REQUIRED_PYTHON_VER = (3, 7, 0)
|
REQUIRED_PYTHON_VER = (3, 7, 0)
|
||||||
|
@ -701,7 +701,9 @@ class Script:
|
|||||||
|
|
||||||
def _log(self, msg, *args, level=logging.INFO):
|
def _log(self, msg, *args, level=logging.INFO):
|
||||||
if self.name:
|
if self.name:
|
||||||
msg = f"{self.name}: {msg}"
|
msg = f"%s: {msg}"
|
||||||
|
args = [self.name, *args]
|
||||||
|
|
||||||
if level == _LOG_EXCEPTION:
|
if level == _LOG_EXCEPTION:
|
||||||
self._logger.exception(msg, *args)
|
self._logger.exception(msg, *args)
|
||||||
else:
|
else:
|
||||||
|
@ -699,7 +699,7 @@ holidays==0.10.1
|
|||||||
home-assistant-frontend==20200318.1
|
home-assistant-frontend==20200318.1
|
||||||
|
|
||||||
# homeassistant.components.zwave
|
# homeassistant.components.zwave
|
||||||
homeassistant-pyozw==0.1.9
|
homeassistant-pyozw==0.1.10
|
||||||
|
|
||||||
# homeassistant.components.homematicip_cloud
|
# homeassistant.components.homematicip_cloud
|
||||||
homematicip==0.10.17
|
homematicip==0.10.17
|
||||||
|
@ -266,7 +266,7 @@ holidays==0.10.1
|
|||||||
home-assistant-frontend==20200318.1
|
home-assistant-frontend==20200318.1
|
||||||
|
|
||||||
# homeassistant.components.zwave
|
# homeassistant.components.zwave
|
||||||
homeassistant-pyozw==0.1.9
|
homeassistant-pyozw==0.1.10
|
||||||
|
|
||||||
# homeassistant.components.homematicip_cloud
|
# homeassistant.components.homematicip_cloud
|
||||||
homematicip==0.10.17
|
homematicip==0.10.17
|
||||||
|
5
rootfs/etc/services.d/home-assistant/finish
Normal file
5
rootfs/etc/services.d/home-assistant/finish
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/execlineb -S0
|
||||||
|
# ==============================================================================
|
||||||
|
# Take down the S6 supervision tree when Home Assistant fails
|
||||||
|
# ==============================================================================
|
||||||
|
s6-svscanctl -t /var/run/s6/services
|
7
rootfs/etc/services.d/home-assistant/run
Normal file
7
rootfs/etc/services.d/home-assistant/run
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Start Home Assistant service
|
||||||
|
# ==============================================================================
|
||||||
|
cd /config || bashio::exit.nok "Can't find config folder!"
|
||||||
|
|
||||||
|
exec python3 -m homeassistant --config /config
|
@ -1743,3 +1743,15 @@ async def test_if_running_parallel(hass):
|
|||||||
assert len(events) == 4
|
assert len(events) == 4
|
||||||
assert events[2].data["value"] == 2
|
assert events[2].data["value"] == 2
|
||||||
assert events[3].data["value"] == 2
|
assert events[3].data["value"] == 2
|
||||||
|
|
||||||
|
|
||||||
|
async def test_script_logging(caplog):
|
||||||
|
"""Test script logging."""
|
||||||
|
script_obj = script.Script(None, [], "Script with % Name")
|
||||||
|
script_obj._log("Test message with name %s", 1)
|
||||||
|
|
||||||
|
assert "Script with % Name: Test message with name 1" in caplog.text
|
||||||
|
|
||||||
|
script_obj = script.Script(None, [])
|
||||||
|
script_obj._log("Test message without name %s", 2)
|
||||||
|
assert "Test message without name 2" in caplog.text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user