Skip to content

Commit

Permalink
2023.1.2 (#85481)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Jan 9, 2023
2 parents 71ce737 + 8348479 commit b3454bf
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 33 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/dsmr_reader/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ class DSMRReaderSensorEntityDescription(SensorEntityDescription):
DSMRReaderSensorEntityDescription(
key="dsmr/consumption/quarter-hour-peak-electricity/average_delivered",
name="Previous quarter-hour peak usage",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.POWER,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
),
DSMRReaderSensorEntityDescription(
key="dsmr/consumption/quarter-hour-peak-electricity/read_at_start",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/google/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"dependencies": ["application_credentials"],
"documentation": "https://www.home-assistant.io/integrations/calendar.google/",
"requirements": ["gcal-sync==4.1.0", "oauth2client==4.1.3"],
"requirements": ["gcal-sync==4.1.1", "oauth2client==4.1.3"],
"codeowners": ["@allenporter"],
"iot_class": "cloud_polling",
"loggers": ["googleapiclient"]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/hydrawise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
DOMAIN = "hydrawise"
DEFAULT_WATERING_TIME = 15

SCAN_INTERVAL = timedelta(seconds=30)
SCAN_INTERVAL = timedelta(seconds=120)

SIGNAL_UPDATE_HYDRAWISE = "hydrawise_update"

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/life360/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/life360",
"codeowners": ["@pnbruckner"],
"requirements": ["life360==5.3.0"],
"requirements": ["life360==5.5.0"],
"iot_class": "cloud_polling",
"loggers": ["life360"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/local_calendar/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Local Calendar",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/local_calendar",
"requirements": ["ical==4.2.8"],
"requirements": ["ical==4.2.9"],
"codeowners": ["@allenporter"],
"iot_class": "local_polling",
"loggers": ["ical"]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/number/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class NumberDeviceClass(StrEnum):
POWER_FACTOR = "power_factor"
"""Power factor.
Unit of measurement: `%`
Unit of measurement: `%`, `None`
"""

POWER = "power"
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/philips_js/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async def async_media_next_track(self) -> None:
async def async_media_play_pause(self) -> None:
"""Send pause command to media player."""
if self._tv.quirk_playpause_spacebar:
await self._tv.sendUnicode(" ")
await self._tv.sendKey("Confirm")
else:
await self._tv.sendKey("PlayPause")
await self._async_update_soon()
Expand Down Expand Up @@ -509,6 +509,8 @@ def _update_from_coordinator(self):
self._media_title = self._sources.get(self._tv.source_id)
self._media_channel = None

self._attr_assumed_state = True

@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/reolink/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Reolink IP NVR/camera",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/reolink",
"requirements": ["reolink-aio==0.1.2"],
"requirements": ["reolink-aio==0.1.3"],
"codeowners": ["@starkillerOG"],
"iot_class": "local_polling",
"loggers": ["reolink-aio"]
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class SensorDeviceClass(StrEnum):
POWER_FACTOR = "power_factor"
"""Power factor.
Unit of measurement: `%`
Unit of measurement: `%`, `None`
"""

POWER = "power"
Expand Down Expand Up @@ -521,7 +521,7 @@ class SensorStateClass(StrEnum):
SensorDeviceClass.PM1: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.PM10: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.PM25: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.POWER_FACTOR: {PERCENTAGE},
SensorDeviceClass.POWER_FACTOR: {PERCENTAGE, None},
SensorDeviceClass.POWER: {UnitOfPower.WATT, UnitOfPower.KILO_WATT},
SensorDeviceClass.PRECIPITATION: set(UnitOfPrecipitationDepth),
SensorDeviceClass.PRECIPITATION_INTENSITY: set(UnitOfVolumetricFlux),
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/switchbot/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "switchbot",
"name": "SwitchBot",
"documentation": "https://www.home-assistant.io/integrations/switchbot",
"requirements": ["PySwitchbot==0.36.2"],
"requirements": ["PySwitchbot==0.36.3"],
"config_flow": true,
"dependencies": ["bluetooth"],
"codeowners": [
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/switchbot/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"lock_auth": {
"description": "Please provide your SwitchBot app username and password. This data won't be saved and only used to retrieve your locks encryption key.",
"description": "Please provide your SwitchBot app username and password. This data won't be saved and only used to retrieve your locks encryption key. Usernames and passwords are case sensitive.",
"data": {
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/switchbot/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"password": "Password",
"username": "Username"
},
"description": "Please provide your SwitchBot app username and password. This data won't be saved and only used to retrieve your locks encryption key."
"description": "Please provide your SwitchBot app username and password. This data won't be saved and only used to retrieve your locks encryption key. Usernames and passwords are case sensitive."
},
"lock_choose_method": {
"description": "A SwitchBot lock can be set up in Home Assistant in two different ways.\n\nYou can enter the key id and encryption key yourself, or Home Assistant can import them from your SwitchBot account.",
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/zha/core/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
from zigpy.config import CONF_DEVICE
import zigpy.device
import zigpy.endpoint
import zigpy.exceptions
import zigpy.group
from zigpy.types.named import EUI64

from homeassistant import __path__ as HOMEASSISTANT_PATH
from homeassistant.components.system_log import LogEntry, _figure_out_source
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity import DeviceInfo
Expand Down Expand Up @@ -172,6 +174,8 @@ async def async_initialize(self) -> None:
self.application_controller = await app_controller_cls.new(
app_config, auto_form=True, start_radio=True
)
except zigpy.exceptions.TransientConnectionError as exc:
raise ConfigEntryNotReady from exc
except Exception as exc: # pylint: disable=broad-except
_LOGGER.warning(
"Couldn't start %s coordinator (attempt %s of %s)",
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/zha/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows==0.34.5",
"bellows==0.34.6",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.90",
"zigpy-deconz==0.19.2",
"zigpy==0.52.3",
"zigpy==0.53.0",
"zigpy-xbee==0.16.2",
"zigpy-zigate==0.10.3",
"zigpy-znp==0.9.2"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
APPLICATION_NAME: Final = "HomeAssistant"
MAJOR_VERSION: Final = 2023
MINOR_VERSION: Final = 1
PATCH_VERSION: Final = "1"
PATCH_VERSION: Final = "2"
__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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "homeassistant"
version = "2023.1.1"
version = "2023.1.2"
license = {text = "Apache-2.0"}
description = "Open-source home automation platform running on Python 3."
readme = "README.rst"
Expand Down
14 changes: 7 additions & 7 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PyRMVtransport==0.3.3
PySocks==1.7.1

# homeassistant.components.switchbot
PySwitchbot==0.36.2
PySwitchbot==0.36.3

# homeassistant.components.transport_nsw
PyTransportNSW==0.1.1
Expand Down Expand Up @@ -419,7 +419,7 @@ beautifulsoup4==4.11.1
# beewi_smartclim==0.0.10

# homeassistant.components.zha
bellows==0.34.5
bellows==0.34.6

# homeassistant.components.bmw_connected_drive
bimmer_connected==0.12.0
Expand Down Expand Up @@ -744,7 +744,7 @@ gTTS==2.2.4
gassist-text==0.0.7

# homeassistant.components.google
gcal-sync==4.1.0
gcal-sync==4.1.1

# homeassistant.components.geniushub
geniushub-client==0.6.30
Expand Down Expand Up @@ -930,7 +930,7 @@ ibm-watson==5.2.2
ibmiotf==0.3.4

# homeassistant.components.local_calendar
ical==4.2.8
ical==4.2.9

# homeassistant.components.ping
icmplib==3.0
Expand Down Expand Up @@ -1029,7 +1029,7 @@ librouteros==3.2.0
libsoundtouch==0.8

# homeassistant.components.life360
life360==5.3.0
life360==5.5.0

# homeassistant.components.osramlightify
lightify==1.0.7.3
Expand Down Expand Up @@ -2190,7 +2190,7 @@ regenmaschine==2022.11.0
renault-api==0.1.11

# homeassistant.components.reolink
reolink-aio==0.1.2
reolink-aio==0.1.3

# homeassistant.components.python_script
restrictedpython==5.2
Expand Down Expand Up @@ -2668,7 +2668,7 @@ zigpy-zigate==0.10.3
zigpy-znp==0.9.2

# homeassistant.components.zha
zigpy==0.52.3
zigpy==0.53.0

# homeassistant.components.zoneminder
zm-py==0.5.2
Expand Down
14 changes: 7 additions & 7 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PyRMVtransport==0.3.3
PySocks==1.7.1

# homeassistant.components.switchbot
PySwitchbot==0.36.2
PySwitchbot==0.36.3

# homeassistant.components.transport_nsw
PyTransportNSW==0.1.1
Expand Down Expand Up @@ -346,7 +346,7 @@ base36==0.1.1
beautifulsoup4==4.11.1

# homeassistant.components.zha
bellows==0.34.5
bellows==0.34.6

# homeassistant.components.bmw_connected_drive
bimmer_connected==0.12.0
Expand Down Expand Up @@ -560,7 +560,7 @@ gTTS==2.2.4
gassist-text==0.0.7

# homeassistant.components.google
gcal-sync==4.1.0
gcal-sync==4.1.1

# homeassistant.components.geocaching
geocachingapi==0.2.1
Expand Down Expand Up @@ -695,7 +695,7 @@ iaqualink==0.5.0
ibeacon_ble==1.0.1

# homeassistant.components.local_calendar
ical==4.2.8
ical==4.2.9

# homeassistant.components.ping
icmplib==3.0
Expand Down Expand Up @@ -767,7 +767,7 @@ librouteros==3.2.0
libsoundtouch==0.8

# homeassistant.components.life360
life360==5.3.0
life360==5.5.0

# homeassistant.components.logi_circle
logi_circle==0.2.3
Expand Down Expand Up @@ -1529,7 +1529,7 @@ regenmaschine==2022.11.0
renault-api==0.1.11

# homeassistant.components.reolink
reolink-aio==0.1.2
reolink-aio==0.1.3

# homeassistant.components.python_script
restrictedpython==5.2
Expand Down Expand Up @@ -1869,7 +1869,7 @@ zigpy-zigate==0.10.3
zigpy-znp==0.9.2

# homeassistant.components.zha
zigpy==0.52.3
zigpy==0.53.0

# homeassistant.components.zwave_js
zwave-js-server-python==0.44.0
Expand Down
2 changes: 1 addition & 1 deletion tests/components/zha/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def update_attribute_cache(cluster):
attrid = zigpy.types.uint16_t(attrid)
attrs.append(make_attribute(attrid, value))

hdr = make_zcl_header(zcl_f.Command.Report_Attributes)
hdr = make_zcl_header(zcl_f.GeneralCommand.Report_Attributes)
hdr.frame_control.disable_default_response = True
msg = zcl_f.GENERAL_COMMANDS[zcl_f.GeneralCommand.Report_Attributes].schema(
attribute_reports=attrs
Expand Down
19 changes: 19 additions & 0 deletions tests/components/zha/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
from unittest.mock import AsyncMock, MagicMock, patch

import pytest
import zigpy.exceptions
import zigpy.profiles.zha as zha
import zigpy.zcl.clusters.general as general
import zigpy.zcl.clusters.lighting as lighting

from homeassistant.components.zha.core.group import GroupMember
from homeassistant.const import Platform
from homeassistant.exceptions import ConfigEntryNotReady

from .common import async_find_group_entity_id, get_zha_gateway
from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_PROFILE, SIG_EP_TYPE
Expand Down Expand Up @@ -259,3 +261,20 @@ async def test_gateway_initialize_failure(hass, device_light_1, coordinator):
await zha_gateway.async_initialize()

assert mock_new.call_count == 3


@patch("homeassistant.components.zha.core.gateway.STARTUP_FAILURE_DELAY_S", 0.01)
async def test_gateway_initialize_failure_transient(hass, device_light_1, coordinator):
"""Test ZHA failing to initialize the gateway but with a transient error."""
zha_gateway = get_zha_gateway(hass)
assert zha_gateway is not None

with patch(
"bellows.zigbee.application.ControllerApplication.new",
side_effect=[RuntimeError(), zigpy.exceptions.TransientConnectionError()],
) as mock_new:
with pytest.raises(ConfigEntryNotReady):
await zha_gateway.async_initialize()

# Initialization immediately stops and is retried after TransientConnectionError
assert mock_new.call_count == 2

0 comments on commit b3454bf

Please sign in to comment.