Merge pull request #74926 from home-assistant/rc

This commit is contained in:
Paulus Schoutsen 2022-07-10 14:33:08 -07:00 committed by GitHub
commit 4418e6c4b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 131 additions and 54 deletions

View File

@ -3,7 +3,7 @@
"name": "deCONZ",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/deconz",
"requirements": ["pydeconz==97"],
"requirements": ["pydeconz==98"],
"ssdp": [
{
"manufacturer": "Royal Philips Electronics",

View File

@ -2,7 +2,7 @@
"domain": "edl21",
"name": "EDL21",
"documentation": "https://www.home-assistant.io/integrations/edl21",
"requirements": ["pysml==0.0.7"],
"requirements": ["pysml==0.0.8"],
"codeowners": ["@mtdcr"],
"iot_class": "local_push",
"loggers": ["sml"]

View File

@ -17,6 +17,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.const import (
CONF_NAME,
DEGREE,
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
ENERGY_KILO_WATT_HOUR,
@ -250,6 +251,7 @@ SENSOR_UNIT_MAPPING = {
"W": POWER_WATT,
"A": ELECTRIC_CURRENT_AMPERE,
"V": ELECTRIC_POTENTIAL_VOLT,
"°": DEGREE,
}
@ -449,7 +451,7 @@ class EDL21Entity(SensorEntity):
@property
def native_unit_of_measurement(self):
"""Return the unit of measurement."""
if (unit := self._telegram.get("unit")) is None:
if (unit := self._telegram.get("unit")) is None or unit == 0:
return None
return SENSOR_UNIT_MAPPING[unit]

View File

@ -4,7 +4,7 @@
"documentation": "https://www.home-assistant.io/integrations/ezviz",
"dependencies": ["ffmpeg"],
"codeowners": ["@RenierM26", "@baqs"],
"requirements": ["pyezviz==0.2.0.8"],
"requirements": ["pyezviz==0.2.0.9"],
"config_flow": true,
"iot_class": "cloud_polling",
"loggers": ["paho_mqtt", "pyezviz"]

View File

@ -2,7 +2,7 @@
"domain": "frontier_silicon",
"name": "Frontier Silicon",
"documentation": "https://www.home-assistant.io/integrations/frontier_silicon",
"requirements": ["afsapi==0.2.4"],
"requirements": ["afsapi==0.2.5"],
"codeowners": ["@wlcrs"],
"iot_class": "local_polling"
}

View File

@ -2,7 +2,7 @@
"domain": "hdmi_cec",
"name": "HDMI-CEC",
"documentation": "https://www.home-assistant.io/integrations/hdmi_cec",
"requirements": ["pyCEC==0.5.1"],
"requirements": ["pyCEC==0.5.2"],
"codeowners": [],
"iot_class": "local_push",
"loggers": ["pycec"]

View File

@ -3,7 +3,7 @@
"name": "Mazda Connected Services",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/mazda",
"requirements": ["pymazda==0.3.3"],
"requirements": ["pymazda==0.3.6"],
"codeowners": ["@bdr99"],
"quality_scale": "platinum",
"iot_class": "cloud_polling",

View File

@ -3,7 +3,7 @@
"name": "QNAP QSW",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/qnap_qsw",
"requirements": ["aioqsw==0.1.0"],
"requirements": ["aioqsw==0.1.1"],
"codeowners": ["@Noltari"],
"iot_class": "local_polling",
"loggers": ["aioqsw"],

View File

@ -3,7 +3,7 @@
"name": "RainMachine",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/rainmachine",
"requirements": ["regenmaschine==2022.07.0"],
"requirements": ["regenmaschine==2022.07.1"],
"codeowners": ["@bachya"],
"iot_class": "local_polling",
"homekit": {

View File

@ -2,7 +2,7 @@
"domain": "roku",
"name": "Roku",
"documentation": "https://www.home-assistant.io/integrations/roku",
"requirements": ["rokuecp==0.16.0"],
"requirements": ["rokuecp==0.17.0"],
"homekit": {
"models": ["3820X", "3810X", "4660X", "7820X", "C105X", "C135X"]
},

View File

@ -3,7 +3,7 @@
"name": "SMS notifications via GSM-modem",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/sms",
"requirements": ["python-gammu==3.2.3"],
"requirements": ["python-gammu==3.2.4"],
"codeowners": ["@ocalvo"],
"iot_class": "local_polling",
"loggers": ["gammu"]

View File

@ -93,7 +93,7 @@ class SystemBridgeDataUpdateCoordinator(
if not self.websocket_client.connected:
await self._setup_websocket()
await self.websocket_client.get_data(modules)
self.hass.async_create_task(self.websocket_client.get_data(modules))
async def async_handle_module(
self,
@ -107,9 +107,7 @@ class SystemBridgeDataUpdateCoordinator(
async def _listen_for_data(self) -> None:
"""Listen for events from the WebSocket."""
try:
await self.websocket_client.register_data_listener(MODULES)
await self.websocket_client.listen(callback=self.async_handle_module)
except AuthenticationException as exception:
self.last_update_success = False
@ -175,6 +173,9 @@ class SystemBridgeDataUpdateCoordinator(
self.async_update_listeners()
self.hass.async_create_task(self._listen_for_data())
await self.websocket_client.register_data_listener(MODULES)
self.last_update_success = True
self.async_update_listeners()

View File

@ -3,7 +3,7 @@
"name": "System Bridge",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/system_bridge",
"requirements": ["systembridgeconnector==3.1.5"],
"requirements": ["systembridgeconnector==3.3.2"],
"codeowners": ["@timmo001"],
"zeroconf": ["_system-bridge._tcp.local."],
"after_dependencies": ["zeroconf"],

View File

@ -83,13 +83,12 @@ SENSORS: tuple[VeSyncSensorEntityDescription, ...] = (
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.details["filter_life"],
value_fn=lambda device: device.filter_life,
exists_fn=lambda device: sku_supported(device, FILTER_LIFE_SUPPORTED),
),
VeSyncSensorEntityDescription(
key="air-quality",
name="Air Quality",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda device: device.details["air_quality"],
exists_fn=lambda device: sku_supported(device, AIR_QUALITY_SUPPORTED),
),

View File

@ -94,20 +94,23 @@ def get_device_entities(
# If the value ID returns as None, we don't need to include this entity
if (value_id := get_value_id_from_unique_id(entry.unique_id)) is None:
continue
state_key = get_state_key_from_unique_id(entry.unique_id)
zwave_value = node.values[value_id]
primary_value_data = {
"command_class": zwave_value.command_class,
"command_class_name": zwave_value.command_class_name,
"endpoint": zwave_value.endpoint,
"property": zwave_value.property_,
"property_name": zwave_value.property_name,
"property_key": zwave_value.property_key,
"property_key_name": zwave_value.property_key_name,
}
if state_key is not None:
primary_value_data["state_key"] = state_key
primary_value_data = None
if (zwave_value := node.values.get(value_id)) is not None:
primary_value_data = {
"command_class": zwave_value.command_class,
"command_class_name": zwave_value.command_class_name,
"endpoint": zwave_value.endpoint,
"property": zwave_value.property_,
"property_name": zwave_value.property_name,
"property_key": zwave_value.property_key,
"property_key_name": zwave_value.property_key_name,
}
state_key = get_state_key_from_unique_id(entry.unique_id)
if state_key is not None:
primary_value_data["state_key"] = state_key
entity = {
"domain": entry.domain,
"entity_id": entry.entity_id,

View File

@ -7,7 +7,7 @@ from .backports.enum import StrEnum
MAJOR_VERSION: Final = 2022
MINOR_VERSION: Final = 7
PATCH_VERSION: Final = "2"
PATCH_VERSION: Final = "3"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 9, 0)

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "homeassistant"
version = "2022.7.2"
version = "2022.7.3"
license = {text = "Apache-2.0"}
description = "Open-source home automation platform running on Python 3."
readme = "README.rst"

View File

@ -89,7 +89,7 @@ adguardhome==0.5.1
advantage_air==0.3.1
# homeassistant.components.frontier_silicon
afsapi==0.2.4
afsapi==0.2.5
# homeassistant.components.agent_dvr
agent-py==0.0.23
@ -229,7 +229,7 @@ aiopvpc==3.0.0
aiopyarr==22.6.0
# homeassistant.components.qnap_qsw
aioqsw==0.1.0
aioqsw==0.1.1
# homeassistant.components.recollect_waste
aiorecollect==1.0.8
@ -1323,7 +1323,7 @@ py-zabbix==1.1.7
py17track==2021.12.2
# homeassistant.components.hdmi_cec
pyCEC==0.5.1
pyCEC==0.5.2
# homeassistant.components.control4
pyControl4==0.0.6
@ -1444,7 +1444,7 @@ pydaikin==2.7.0
pydanfossair==0.1.0
# homeassistant.components.deconz
pydeconz==97
pydeconz==98
# homeassistant.components.delijn
pydelijn==1.0.0
@ -1489,7 +1489,7 @@ pyeverlights==0.1.0
pyevilgenius==2.0.0
# homeassistant.components.ezviz
pyezviz==0.2.0.8
pyezviz==0.2.0.9
# homeassistant.components.fido
pyfido==2.1.1
@ -1640,7 +1640,7 @@ pymailgunner==1.4
pymata-express==1.19
# homeassistant.components.mazda
pymazda==0.3.3
pymazda==0.3.6
# homeassistant.components.mediaroom
pymediaroom==0.6.5.4
@ -1835,7 +1835,7 @@ pysmartthings==0.7.6
pysmarty==0.8
# homeassistant.components.edl21
pysml==0.0.7
pysml==0.0.8
# homeassistant.components.snmp
pysnmplib==5.0.15
@ -1895,7 +1895,7 @@ python-family-hub-local==0.0.2
python-forecastio==1.4.0
# homeassistant.components.sms
# python-gammu==3.2.3
# python-gammu==3.2.4
# homeassistant.components.gc100
python-gc100==1.0.3a0
@ -2065,7 +2065,7 @@ raincloudy==0.0.7
raspyrfm-client==1.2.8
# homeassistant.components.rainmachine
regenmaschine==2022.07.0
regenmaschine==2022.07.1
# homeassistant.components.renault
renault-api==0.1.11
@ -2092,7 +2092,7 @@ rjpl==0.3.6
rocketchat-API==0.6.1
# homeassistant.components.roku
rokuecp==0.16.0
rokuecp==0.17.0
# homeassistant.components.roomba
roombapy==1.6.5
@ -2268,7 +2268,7 @@ swisshydrodata==0.1.0
synology-srm==0.2.0
# homeassistant.components.system_bridge
systembridgeconnector==3.1.5
systembridgeconnector==3.3.2
# homeassistant.components.tailscale
tailscale==0.2.0

View File

@ -198,7 +198,7 @@ aiopvpc==3.0.0
aiopyarr==22.6.0
# homeassistant.components.qnap_qsw
aioqsw==0.1.0
aioqsw==0.1.1
# homeassistant.components.recollect_waste
aiorecollect==1.0.8
@ -974,7 +974,7 @@ pycoolmasternet-async==0.1.2
pydaikin==2.7.0
# homeassistant.components.deconz
pydeconz==97
pydeconz==98
# homeassistant.components.dexcom
pydexcom==0.2.3
@ -995,7 +995,7 @@ pyeverlights==0.1.0
pyevilgenius==2.0.0
# homeassistant.components.ezviz
pyezviz==0.2.0.8
pyezviz==0.2.0.9
# homeassistant.components.fido
pyfido==2.1.1
@ -1113,7 +1113,7 @@ pymailgunner==1.4
pymata-express==1.19
# homeassistant.components.mazda
pymazda==0.3.3
pymazda==0.3.6
# homeassistant.components.melcloud
pymelcloud==2.5.6
@ -1376,7 +1376,7 @@ radios==0.1.1
radiotherm==2.1.0
# homeassistant.components.rainmachine
regenmaschine==2022.07.0
regenmaschine==2022.07.1
# homeassistant.components.renault
renault-api==0.1.11
@ -1391,7 +1391,7 @@ rflink==0.0.63
ring_doorbell==0.7.2
# homeassistant.components.roku
rokuecp==0.16.0
rokuecp==0.17.0
# homeassistant.components.roomba
roombapy==1.6.5
@ -1513,7 +1513,7 @@ sunwatcher==0.2.1
surepy==0.7.2
# homeassistant.components.system_bridge
systembridgeconnector==3.1.5
systembridgeconnector==3.3.2
# homeassistant.components.tailscale
tailscale==0.2.0

View File

@ -10,8 +10,12 @@ from homeassistant.components.zwave_js.diagnostics import (
async_get_device_diagnostics,
)
from homeassistant.components.zwave_js.discovery import async_discover_node_values
from homeassistant.components.zwave_js.helpers import get_device_id
from homeassistant.helpers.device_registry import async_get
from homeassistant.components.zwave_js.helpers import (
get_device_id,
get_value_id_from_unique_id,
)
from homeassistant.helpers.device_registry import async_get as async_get_dev_reg
from homeassistant.helpers.entity_registry import async_get as async_get_ent_reg
from .common import PROPERTY_ULTRAVIOLET
@ -53,7 +57,7 @@ async def test_device_diagnostics(
version_state,
):
"""Test the device level diagnostics data dump."""
dev_reg = async_get(hass)
dev_reg = async_get_dev_reg(hass)
device = dev_reg.async_get_device({get_device_id(client.driver, multisensor_6)})
assert device
@ -106,7 +110,7 @@ async def test_device_diagnostics(
async def test_device_diagnostics_error(hass, integration):
"""Test the device diagnostics raises exception when an invalid device is used."""
dev_reg = async_get(hass)
dev_reg = async_get_dev_reg(hass)
device = dev_reg.async_get_or_create(
config_entry_id=integration.entry_id, identifiers={("test", "test")}
)
@ -118,3 +122,71 @@ async def test_empty_zwave_value_matcher():
"""Test empty ZwaveValueMatcher is invalid."""
with pytest.raises(ValueError):
ZwaveValueMatcher()
async def test_device_diagnostics_missing_primary_value(
hass,
client,
multisensor_6,
integration,
hass_client,
):
"""Test that the device diagnostics handles an entity with a missing primary value."""
dev_reg = async_get_dev_reg(hass)
device = dev_reg.async_get_device({get_device_id(client.driver, multisensor_6)})
assert device
entity_id = "sensor.multisensor_6_air_temperature"
ent_reg = async_get_ent_reg(hass)
entry = ent_reg.async_get(entity_id)
# check that the primary value for the entity exists in the diagnostics
diagnostics_data = await get_diagnostics_for_device(
hass, hass_client, integration, device
)
value = multisensor_6.values.get(get_value_id_from_unique_id(entry.unique_id))
assert value
air_entity = next(
x for x in diagnostics_data["entities"] if x["entity_id"] == entity_id
)
assert air_entity["primary_value"] == {
"command_class": value.command_class,
"command_class_name": value.command_class_name,
"endpoint": value.endpoint,
"property": value.property_,
"property_name": value.property_name,
"property_key": value.property_key,
"property_key_name": value.property_key_name,
}
# make the entity's primary value go missing
event = Event(
type="value removed",
data={
"source": "node",
"event": "value removed",
"nodeId": multisensor_6.node_id,
"args": {
"commandClassName": value.command_class_name,
"commandClass": value.command_class,
"endpoint": value.endpoint,
"property": value.property_,
"prevValue": 0,
"propertyName": value.property_name,
},
},
)
multisensor_6.receive_event(event)
diagnostics_data = await get_diagnostics_for_device(
hass, hass_client, integration, device
)
air_entity = next(
x for x in diagnostics_data["entities"] if x["entity_id"] == entity_id
)
assert air_entity["primary_value"] is None