Merge pull request #39079 from home-assistant/rc

This commit is contained in:
Paulus Schoutsen 2020-08-20 10:57:46 +02:00 committed by GitHub
commit ff9a4f8754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 79 additions and 47 deletions

View File

@ -3,7 +3,7 @@
"name": "Google Cast", "name": "Google Cast",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/cast", "documentation": "https://www.home-assistant.io/integrations/cast",
"requirements": ["pychromecast==7.2.0"], "requirements": ["pychromecast==7.2.1"],
"after_dependencies": ["cloud","zeroconf"], "after_dependencies": ["cloud","zeroconf"],
"zeroconf": ["_googlecast._tcp.local."], "zeroconf": ["_googlecast._tcp.local."],
"codeowners": ["@emontnemery"] "codeowners": ["@emontnemery"]

View File

@ -73,40 +73,64 @@ async def async_setup_entry(
await dimmer_coordinator.async_refresh() await dimmer_coordinator.async_refresh()
items_of_category = await get_items_of_category(hass, entry, CONTROL4_CATEGORY) items_of_category = await get_items_of_category(hass, entry, CONTROL4_CATEGORY)
entity_list = []
for item in items_of_category: for item in items_of_category:
if item["type"] == CONTROL4_ENTITY_TYPE: try:
item_name = item["name"] if item["type"] == CONTROL4_ENTITY_TYPE:
item_id = item["id"] item_name = item["name"]
item_parent_id = item["parentId"] item_id = item["id"]
item_is_dimmer = item["capabilities"]["dimmer"] item_parent_id = item["parentId"]
if item_is_dimmer: item_manufacturer = None
item_coordinator = dimmer_coordinator item_device_name = None
item_model = None
for parent_item in items_of_category:
if parent_item["id"] == item_parent_id:
item_manufacturer = parent_item["manufacturer"]
item_device_name = parent_item["name"]
item_model = parent_item["model"]
else: else:
item_coordinator = non_dimmer_coordinator continue
except KeyError:
for parent_item in items_of_category: _LOGGER.exception(
if parent_item["id"] == item_parent_id: "Unknown device properties received from Control4: %s", item,
item_manufacturer = parent_item["manufacturer"]
item_device_name = parent_item["name"]
item_model = parent_item["model"]
async_add_entities(
[
Control4Light(
entry_data,
entry,
item_coordinator,
item_name,
item_id,
item_device_name,
item_manufacturer,
item_model,
item_parent_id,
item_is_dimmer,
)
],
True,
) )
continue
if item_id in dimmer_coordinator.data:
item_is_dimmer = True
item_coordinator = dimmer_coordinator
elif item_id in non_dimmer_coordinator.data:
item_is_dimmer = False
item_coordinator = non_dimmer_coordinator
else:
director = entry_data[CONF_DIRECTOR]
item_variables = await director.getItemVariables(item_id)
_LOGGER.warning(
"Couldn't get light state data for %s, skipping setup. Available variables from Control4: %s",
item_name,
item_variables,
)
continue
entity_list.append(
Control4Light(
entry_data,
entry,
item_coordinator,
item_name,
item_id,
item_device_name,
item_manufacturer,
item_model,
item_parent_id,
item_is_dimmer,
)
)
async_add_entities(entity_list, True)
class Control4Light(Control4Entity, LightEntity): class Control4Light(Control4Entity, LightEntity):

View File

@ -2,7 +2,7 @@
"domain": "discovery", "domain": "discovery",
"name": "Discovery", "name": "Discovery",
"documentation": "https://www.home-assistant.io/integrations/discovery", "documentation": "https://www.home-assistant.io/integrations/discovery",
"requirements": ["netdisco==2.8.1"], "requirements": ["netdisco==2.8.2"],
"after_dependencies": ["zeroconf"], "after_dependencies": ["zeroconf"],
"codeowners": [], "codeowners": [],
"quality_scale": "internal" "quality_scale": "internal"

View File

@ -781,6 +781,7 @@ def entity_to_json(config, entity):
retval["type"] = "On/Off light" retval["type"] = "On/Off light"
retval["productname"] = "On/Off light" retval["productname"] = "On/Off light"
retval["modelid"] = "HASS321" retval["modelid"] = "HASS321"
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX})
return retval return retval

View File

@ -3,6 +3,6 @@
"name": "Meteorologisk institutt (Met.no)", "name": "Meteorologisk institutt (Met.no)",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/met", "documentation": "https://www.home-assistant.io/integrations/met",
"requirements": ["pyMetno==0.7.0"], "requirements": ["pyMetno==0.7.1"],
"codeowners": ["@danielhiversen"] "codeowners": ["@danielhiversen"]
} }

View File

@ -2,6 +2,6 @@
"domain": "norway_air", "domain": "norway_air",
"name": "Om Luftkvalitet i Norge (Norway Air)", "name": "Om Luftkvalitet i Norge (Norway Air)",
"documentation": "https://www.home-assistant.io/integrations/norway_air", "documentation": "https://www.home-assistant.io/integrations/norway_air",
"requirements": ["pyMetno==0.7.0"], "requirements": ["pyMetno==0.7.1"],
"codeowners": [] "codeowners": []
} }

View File

@ -2,7 +2,7 @@
"domain": "ssdp", "domain": "ssdp",
"name": "Simple Service Discovery Protocol (SSDP)", "name": "Simple Service Discovery Protocol (SSDP)",
"documentation": "https://www.home-assistant.io/integrations/ssdp", "documentation": "https://www.home-assistant.io/integrations/ssdp",
"requirements": ["defusedxml==0.6.0", "netdisco==2.8.1"], "requirements": ["defusedxml==0.6.0", "netdisco==2.8.2"],
"after_dependencies": ["zeroconf"], "after_dependencies": ["zeroconf"],
"codeowners": [] "codeowners": []
} }

View File

@ -2,7 +2,7 @@
"domain": "zeroconf", "domain": "zeroconf",
"name": "Zero-configuration networking (zeroconf)", "name": "Zero-configuration networking (zeroconf)",
"documentation": "https://www.home-assistant.io/integrations/zeroconf", "documentation": "https://www.home-assistant.io/integrations/zeroconf",
"requirements": ["zeroconf==0.28.0"], "requirements": ["zeroconf==0.28.1"],
"dependencies": ["api"], "dependencies": ["api"],
"codeowners": ["@Kane610"], "codeowners": ["@Kane610"],
"quality_scale": "internal" "quality_scale": "internal"

View File

@ -1,7 +1,7 @@
"""Constants used by Home Assistant components.""" """Constants used by Home Assistant components."""
MAJOR_VERSION = 0 MAJOR_VERSION = 0
MINOR_VERSION = 114 MINOR_VERSION = 114
PATCH_VERSION = "2" PATCH_VERSION = "3"
__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, 1) REQUIRED_PYTHON_VER = (3, 7, 1)

View File

@ -16,7 +16,7 @@ hass-nabucasa==0.35.0
home-assistant-frontend==20200811.0 home-assistant-frontend==20200811.0
importlib-metadata==1.6.0;python_version<'3.8' importlib-metadata==1.6.0;python_version<'3.8'
jinja2>=2.11.1 jinja2>=2.11.1
netdisco==2.8.1 netdisco==2.8.2
paho-mqtt==1.5.0 paho-mqtt==1.5.0
pip>=8.0.3 pip>=8.0.3
python-slugify==4.0.1 python-slugify==4.0.1
@ -28,7 +28,7 @@ sqlalchemy==1.3.18
voluptuous-serialize==2.4.0 voluptuous-serialize==2.4.0
voluptuous==0.11.7 voluptuous==0.11.7
yarl==1.4.2 yarl==1.4.2
zeroconf==0.28.0 zeroconf==0.28.1
pycryptodome>=3.6.6 pycryptodome>=3.6.6

View File

@ -945,7 +945,7 @@ netdata==0.2.0
# homeassistant.components.discovery # homeassistant.components.discovery
# homeassistant.components.ssdp # homeassistant.components.ssdp
netdisco==2.8.1 netdisco==2.8.2
# homeassistant.components.neurio_energy # homeassistant.components.neurio_energy
neurio==0.3.1 neurio==0.3.1
@ -1181,7 +1181,7 @@ pyHS100==0.3.5.1
# homeassistant.components.met # homeassistant.components.met
# homeassistant.components.norway_air # homeassistant.components.norway_air
pyMetno==0.7.0 pyMetno==0.7.1
# homeassistant.components.rfxtrx # homeassistant.components.rfxtrx
pyRFXtrx==0.25 pyRFXtrx==0.25
@ -1256,7 +1256,7 @@ pycfdns==0.0.1
pychannels==1.0.0 pychannels==1.0.0
# homeassistant.components.cast # homeassistant.components.cast
pychromecast==7.2.0 pychromecast==7.2.1
# homeassistant.components.cmus # homeassistant.components.cmus
pycmus==0.1.1 pycmus==0.1.1
@ -2269,7 +2269,7 @@ youtube_dl==2020.07.28
zengge==0.2 zengge==0.2
# homeassistant.components.zeroconf # homeassistant.components.zeroconf
zeroconf==0.28.0 zeroconf==0.28.1
# homeassistant.components.zha # homeassistant.components.zha
zha-quirks==0.0.43 zha-quirks==0.0.43

View File

@ -443,7 +443,7 @@ nessclient==0.9.15
# homeassistant.components.discovery # homeassistant.components.discovery
# homeassistant.components.ssdp # homeassistant.components.ssdp
netdisco==2.8.1 netdisco==2.8.2
# homeassistant.components.nexia # homeassistant.components.nexia
nexia==0.9.3 nexia==0.9.3
@ -559,7 +559,7 @@ pyHS100==0.3.5.1
# homeassistant.components.met # homeassistant.components.met
# homeassistant.components.norway_air # homeassistant.components.norway_air
pyMetno==0.7.0 pyMetno==0.7.1
# homeassistant.components.rfxtrx # homeassistant.components.rfxtrx
pyRFXtrx==0.25 pyRFXtrx==0.25
@ -595,7 +595,7 @@ pyblackbird==0.5
pybotvac==0.0.17 pybotvac==0.0.17
# homeassistant.components.cast # homeassistant.components.cast
pychromecast==7.2.0 pychromecast==7.2.1
# homeassistant.components.coolmaster # homeassistant.components.coolmaster
pycoolmasternet==0.0.4 pycoolmasternet==0.0.4
@ -1005,7 +1005,7 @@ xmltodict==0.12.0
yeelight==0.5.2 yeelight==0.5.2
# homeassistant.components.zeroconf # homeassistant.components.zeroconf
zeroconf==0.28.0 zeroconf==0.28.1
# homeassistant.components.zha # homeassistant.components.zha
zha-quirks==0.0.43 zha-quirks==0.0.43

View File

@ -22,6 +22,7 @@ from homeassistant.components import (
from homeassistant.components.emulated_hue import Config, hue_api from homeassistant.components.emulated_hue import Config, hue_api
from homeassistant.components.emulated_hue.hue_api import ( from homeassistant.components.emulated_hue.hue_api import (
HUE_API_STATE_BRI, HUE_API_STATE_BRI,
HUE_API_STATE_BRI_MAX,
HUE_API_STATE_CT, HUE_API_STATE_CT,
HUE_API_STATE_HUE, HUE_API_STATE_HUE,
HUE_API_STATE_ON, HUE_API_STATE_ON,
@ -282,6 +283,12 @@ async def test_light_without_brightness_supported(hass_hue, hue_client):
assert light_without_brightness_json["state"][HUE_API_STATE_ON] is True assert light_without_brightness_json["state"][HUE_API_STATE_ON] is True
assert light_without_brightness_json["type"] == "On/Off light" assert light_without_brightness_json["type"] == "On/Off light"
# BRI required for alexa compat
assert (
light_without_brightness_json["state"][HUE_API_STATE_BRI]
== HUE_API_STATE_BRI_MAX
)
async def test_light_without_brightness_can_be_turned_off(hass_hue, hue_client): async def test_light_without_brightness_can_be_turned_off(hass_hue, hue_client):
"""Test that light without brightness can be turned off.""" """Test that light without brightness can be turned off."""