Compare commits

...

13 Commits

Author SHA1 Message Date
Paulus Schoutsen
d196fd136d Bumped version to 0.107.0b6 2020-03-16 14:53:13 -07:00
Bram Kragten
4f78674a4c Updated frontend to 20200316.1 (#32878) 2020-03-16 14:53:05 -07:00
Bram Kragten
a7aca10668 Lovelace: storage key based on id instead of url_path (#32873)
* Fix storage key based on url_path

* Fix test
2020-03-16 14:53:04 -07:00
Paulus Schoutsen
03b1c6ddee Remove group as a dependency from entity integrations (#32870)
* remove group dependency

* Update device sun light trigger

* Add zone dep back to device tracker
2020-03-16 14:53:03 -07:00
David F. Mulcahey
661f1b69f2 Bump ZHA quirks to 0.0.37 (#32867) 2020-03-16 14:53:03 -07:00
Bram Kragten
ccb34083fe Add lovelace reload service for yaml resources (#32865)
* Lovelace add reload service for yaml resources

* Clean up imports

* Comments
2020-03-16 14:53:02 -07:00
Bram Kragten
7f6b3c1130 Bumped version to 0.107.0b5 2020-03-16 13:59:27 +01:00
Bram Kragten
f2c3f76b8e Updated frontend to 20200316.0 (#32866) 2020-03-16 13:49:50 +01:00
Pascal Vizeli
b6a3bcf87f Update pyozw 0.1.9 (#32864) 2020-03-16 13:49:49 +01:00
Tom Harris
65423bb62b Bump insteonplm to 0.16.8 (#32847) 2020-03-16 13:49:48 +01:00
Kit Klein
104665d849 Ignore the ignored konnected config entries (#32845)
* ignore the ignored konnected config entries

* key off data instead of source
2020-03-16 13:49:47 +01:00
Alan Tse
fb1ba86b08 Bump teslajsonpy to 0.5.1 (#32827) 2020-03-16 13:49:47 +01:00
David Bonnes
cee72724b6 Ensure unique_ids for all evohome thermostats (#32604)
* initial commit

* small tweak
2020-03-16 13:49:46 +01:00
31 changed files with 107 additions and 52 deletions

View File

@@ -3,7 +3,8 @@
"name": "Automation",
"documentation": "https://www.home-assistant.io/integrations/automation",
"requirements": [],
"dependencies": ["device_automation", "group", "webhook"],
"dependencies": [],
"after_dependencies": ["device_automation", "webhook"],
"codeowners": ["@home-assistant/core"],
"quality_scale": "internal"
}

View File

@@ -3,7 +3,7 @@
"name": "Cover",
"documentation": "https://www.home-assistant.io/integrations/cover",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": ["@home-assistant/core"],
"quality_scale": "internal"
}

View File

@@ -3,7 +3,8 @@
"name": "Presence-based Lights",
"documentation": "https://www.home-assistant.io/integrations/device_sun_light_trigger",
"requirements": [],
"dependencies": ["device_tracker", "group", "light", "person"],
"dependencies": [],
"after_dependencies": ["device_tracker", "group", "light", "person"],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -3,7 +3,8 @@
"name": "Device Tracker",
"documentation": "https://www.home-assistant.io/integrations/device_tracker",
"requirements": [],
"dependencies": ["group", "zone"],
"dependencies": ["zone"],
"after_dependencies": [],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -149,7 +149,12 @@ class EvoZone(EvoChild, EvoClimateDevice):
"""Initialize a Honeywell TCC Zone."""
super().__init__(evo_broker, evo_device)
self._unique_id = evo_device.zoneId
if evo_device.modelType.startswith("VisionProWifi"):
# this system does not have a distinct ID for the zone
self._unique_id = f"{evo_device.zoneId}z"
else:
self._unique_id = evo_device.zoneId
self._name = evo_device.name
self._icon = "mdi:radiator"

View File

@@ -3,7 +3,7 @@
"name": "Fan",
"documentation": "https://www.home-assistant.io/integrations/fan",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -3,7 +3,7 @@
"name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/integrations/frontend",
"requirements": [
"home-assistant-frontend==20200313.0"
"home-assistant-frontend==20200316.1"
],
"dependencies": [
"api",

View File

@@ -2,7 +2,7 @@
"domain": "insteon",
"name": "Insteon",
"documentation": "https://www.home-assistant.io/integrations/insteon",
"requirements": ["insteonplm==0.16.7"],
"requirements": ["insteonplm==0.16.8"],
"dependencies": [],
"codeowners": []
}

View File

@@ -306,6 +306,7 @@ class KonnectedView(HomeAssistantView):
[
entry.data[CONF_ACCESS_TOKEN]
for entry in hass.config_entries.async_entries(DOMAIN)
if entry.data.get(CONF_ACCESS_TOKEN)
]
)
if auth is None or not next(

View File

@@ -3,7 +3,7 @@
"name": "Light",
"documentation": "https://www.home-assistant.io/integrations/light",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -3,7 +3,7 @@
"name": "Lock",
"documentation": "https://www.home-assistant.io/integrations/lock",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -4,10 +4,14 @@ import logging
import voluptuous as vol
from homeassistant.components import frontend
from homeassistant.config import async_hass_config_yaml, async_process_component_config
from homeassistant.const import CONF_FILENAME
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import collection, config_validation as cv
from homeassistant.helpers.service import async_register_admin_service
from homeassistant.helpers.typing import ConfigType, HomeAssistantType, ServiceCallType
from homeassistant.loader import async_get_integration
from homeassistant.util import sanitize_filename
from . import dashboard, resources, websocket
@@ -25,8 +29,10 @@ from .const import (
MODE_STORAGE,
MODE_YAML,
RESOURCE_CREATE_FIELDS,
RESOURCE_RELOAD_SERVICE_SCHEMA,
RESOURCE_SCHEMA,
RESOURCE_UPDATE_FIELDS,
SERVICE_RELOAD_RESOURCES,
STORAGE_DASHBOARD_CREATE_FIELDS,
STORAGE_DASHBOARD_UPDATE_FIELDS,
url_slug,
@@ -62,29 +68,41 @@ CONFIG_SCHEMA = vol.Schema(
)
async def async_setup(hass, config):
async def async_setup(hass: HomeAssistantType, config: ConfigType):
"""Set up the Lovelace commands."""
mode = config[DOMAIN][CONF_MODE]
yaml_resources = config[DOMAIN].get(CONF_RESOURCES)
frontend.async_register_built_in_panel(hass, DOMAIN, config={"mode": mode})
async def reload_resources_service_handler(service_call: ServiceCallType) -> None:
"""Reload yaml resources."""
try:
conf = await async_hass_config_yaml(hass)
except HomeAssistantError as err:
_LOGGER.error(err)
return
integration = await async_get_integration(hass, DOMAIN)
config = await async_process_component_config(hass, conf, integration)
resource_collection = await create_yaml_resource_col(
hass, config[DOMAIN].get(CONF_RESOURCES)
)
hass.data[DOMAIN]["resources"] = resource_collection
if mode == MODE_YAML:
default_config = dashboard.LovelaceYAML(hass, None, None)
resource_collection = await create_yaml_resource_col(hass, yaml_resources)
if yaml_resources is None:
try:
ll_conf = await default_config.async_load(False)
except HomeAssistantError:
pass
else:
if CONF_RESOURCES in ll_conf:
_LOGGER.warning(
"Resources need to be specified in your configuration.yaml. Please see the docs."
)
yaml_resources = ll_conf[CONF_RESOURCES]
resource_collection = resources.ResourceYAMLCollection(yaml_resources or [])
async_register_admin_service(
hass,
DOMAIN,
SERVICE_RELOAD_RESOURCES,
reload_resources_service_handler,
schema=RESOURCE_RELOAD_SERVICE_SCHEMA,
)
else:
default_config = dashboard.LovelaceStorage(hass, None)
@@ -196,6 +214,24 @@ async def async_setup(hass, config):
return True
async def create_yaml_resource_col(hass, yaml_resources):
"""Create yaml resources collection."""
if yaml_resources is None:
default_config = dashboard.LovelaceYAML(hass, None, None)
try:
ll_conf = await default_config.async_load(False)
except HomeAssistantError:
pass
else:
if CONF_RESOURCES in ll_conf:
_LOGGER.warning(
"Resources need to be specified in your configuration.yaml. Please see the docs."
)
yaml_resources = ll_conf[CONF_RESOURCES]
return resources.ResourceYAMLCollection(yaml_resources or [])
async def system_health_info(hass):
"""Get info for the info page."""
return await hass.data[DOMAIN]["dashboards"][None].async_get_info()

View File

@@ -41,6 +41,9 @@ RESOURCE_UPDATE_FIELDS = {
vol.Optional(CONF_URL): cv.string,
}
SERVICE_RELOAD_RESOURCES = "reload_resources"
RESOURCE_RELOAD_SERVICE_SCHEMA = vol.Schema({})
CONF_TITLE = "title"
CONF_REQUIRE_ADMIN = "require_admin"
CONF_SHOW_IN_SIDEBAR = "show_in_sidebar"

View File

@@ -88,7 +88,7 @@ class LovelaceStorage(LovelaceConfig):
storage_key = CONFIG_STORAGE_KEY_DEFAULT
else:
url_path = config[CONF_URL_PATH]
storage_key = CONFIG_STORAGE_KEY.format(url_path)
storage_key = CONFIG_STORAGE_KEY.format(config["id"])
super().__init__(hass, url_path, config)

View File

@@ -0,0 +1,4 @@
# Describes the format for available lovelace services
reload_resources:
description: Reload Lovelace resources from yaml configuration.

View File

@@ -3,7 +3,7 @@
"name": "Plant Monitor",
"documentation": "https://www.home-assistant.io/integrations/plant",
"requirements": [],
"dependencies": ["group", "zone"],
"dependencies": [],
"after_dependencies": ["recorder"],
"codeowners": ["@ChristianKuehnel"],
"quality_scale": "internal"

View File

@@ -3,6 +3,6 @@
"name": "Remote",
"documentation": "https://www.home-assistant.io/integrations/remote",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": []
}

View File

@@ -3,7 +3,7 @@
"name": "Scripts",
"documentation": "https://www.home-assistant.io/integrations/script",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": ["@home-assistant/core"],
"quality_scale": "internal"
}

View File

@@ -3,7 +3,7 @@
"name": "Switch",
"documentation": "https://www.home-assistant.io/integrations/switch",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tesla",
"requirements": [
"teslajsonpy==0.4.0"
"teslajsonpy==0.5.1"
],
"dependencies": [],
"codeowners": [

View File

@@ -3,6 +3,6 @@
"name": "Vacuum",
"documentation": "https://www.home-assistant.io/integrations/vacuum",
"requirements": [],
"dependencies": ["group"],
"dependencies": [],
"codeowners": []
}

View File

@@ -5,7 +5,7 @@
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows-homeassistant==0.14.0",
"zha-quirks==0.0.36",
"zha-quirks==0.0.37",
"zigpy-cc==0.1.0",
"zigpy-deconz==0.7.0",
"zigpy-homeassistant==0.16.0",

View File

@@ -3,7 +3,7 @@
"name": "Z-Wave",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zwave",
"requirements": ["homeassistant-pyozw==0.1.8", "pydispatcher==2.0.5"],
"requirements": ["homeassistant-pyozw==0.1.9", "pydispatcher==2.0.5"],
"dependencies": [],
"codeowners": ["@home-assistant/z-wave"]
}

View File

@@ -1,7 +1,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 107
PATCH_VERSION = "0b4"
PATCH_VERSION = "0b6"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)

View File

@@ -12,7 +12,7 @@ cryptography==2.8
defusedxml==0.6.0
distro==1.4.0
hass-nabucasa==0.32.2
home-assistant-frontend==20200313.0
home-assistant-frontend==20200316.1
importlib-metadata==1.5.0
jinja2>=2.10.3
netdisco==2.6.0

View File

@@ -696,10 +696,10 @@ hole==0.5.0
holidays==0.10.1
# homeassistant.components.frontend
home-assistant-frontend==20200313.0
home-assistant-frontend==20200316.1
# homeassistant.components.zwave
homeassistant-pyozw==0.1.8
homeassistant-pyozw==0.1.9
# homeassistant.components.homematicip_cloud
homematicip==0.10.17
@@ -747,7 +747,7 @@ incomfort-client==0.4.0
influxdb==5.2.3
# homeassistant.components.insteon
insteonplm==0.16.7
insteonplm==0.16.8
# homeassistant.components.iperf3
iperf3==0.1.11
@@ -1996,7 +1996,7 @@ temperusb==1.5.3
# tensorflow==1.13.2
# homeassistant.components.tesla
teslajsonpy==0.4.0
teslajsonpy==0.5.1
# homeassistant.components.thermoworks_smoke
thermoworks_smoke==0.1.8
@@ -2158,7 +2158,7 @@ zengge==0.2
zeroconf==0.24.5
# homeassistant.components.zha
zha-quirks==0.0.36
zha-quirks==0.0.37
# homeassistant.components.zhong_hong
zhong_hong_hvac==1.0.9

View File

@@ -263,10 +263,10 @@ hole==0.5.0
holidays==0.10.1
# homeassistant.components.frontend
home-assistant-frontend==20200313.0
home-assistant-frontend==20200316.1
# homeassistant.components.zwave
homeassistant-pyozw==0.1.8
homeassistant-pyozw==0.1.9
# homeassistant.components.homematicip_cloud
homematicip==0.10.17
@@ -684,7 +684,7 @@ sunwatcher==0.2.1
tellduslive==0.10.10
# homeassistant.components.tesla
teslajsonpy==0.4.0
teslajsonpy==0.5.1
# homeassistant.components.toon
toonapilib==3.2.4
@@ -747,7 +747,7 @@ yahooweather==0.10
zeroconf==0.24.5
# homeassistant.components.zha
zha-quirks==0.0.36
zha-quirks==0.0.37
# homeassistant.components.zha
zigpy-cc==0.1.0

View File

@@ -156,7 +156,7 @@ def calc_allowed_references(integration: Integration) -> Set[str]:
"""Return a set of allowed references."""
allowed_references = (
ALLOWED_USED_COMPONENTS
| set(integration.manifest["dependencies"])
| set(integration.manifest.get("dependencies", []))
| set(integration.manifest.get("after_dependencies", []))
)
@@ -250,7 +250,7 @@ def validate(integrations: Dict[str, Integration], config):
validate_dependencies(integrations, integration)
# check that all referenced dependencies exist
for dep in integration.manifest["dependencies"]:
for dep in integration.manifest.get("dependencies", []):
if dep not in integrations:
integration.add_error(
"dependencies", f"Dependency {dep} does not exist"

View File

@@ -52,8 +52,8 @@ MANIFEST_SCHEMA = vol.Schema(
vol.Url(), documentation_url # pylint: disable=no-value-for-parameter
),
vol.Optional("quality_scale"): vol.In(SUPPORTED_QUALITY_SCALES),
vol.Required("requirements"): [str],
vol.Required("dependencies"): [str],
vol.Optional("requirements"): [str],
vol.Optional("dependencies"): [str],
vol.Optional("after_dependencies"): [str],
vol.Required("codeowners"): [str],
vol.Optional("logo"): vol.Url(), # pylint: disable=no-value-for-parameter

View File

@@ -582,6 +582,10 @@ async def test_state_updates(hass, aiohttp_client, mock_panel):
)
entry.add_to_hass(hass)
# Add empty data field to ensure we process it correctly (possible if entry is ignored)
entry = MockConfigEntry(domain="konnected", title="Konnected Alarm Panel", data={},)
entry.add_to_hass(hass)
assert (
await async_setup_component(
hass,

View File

@@ -373,7 +373,6 @@ async def test_storage_dashboards(hass, hass_ws_client, hass_storage):
assert response["result"]["icon"] == "mdi:map"
dashboard_id = response["result"]["id"]
dashboard_path = response["result"]["url_path"]
assert "created-url-path" in hass.data[frontend.DATA_PANELS]
@@ -408,9 +407,9 @@ async def test_storage_dashboards(hass, hass_ws_client, hass_storage):
)
response = await client.receive_json()
assert response["success"]
assert hass_storage[dashboard.CONFIG_STORAGE_KEY.format(dashboard_path)][
"data"
] == {"config": {"yo": "hello"}}
assert hass_storage[dashboard.CONFIG_STORAGE_KEY.format(dashboard_id)]["data"] == {
"config": {"yo": "hello"}
}
assert len(events) == 1
assert events[0].data["url_path"] == "created-url-path"