Skip to content
Merged

0.98.3 #26414

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions homeassistant/components/alexa/state_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,15 @@ async def async_send_changereport_message(
_LOGGER.debug("Sent: %s", json.dumps(message_serialized))
_LOGGER.debug("Received (%s): %s", response.status, response_text)

if response.status == 202 and not invalidate_access_token:
if response.status == 202:
return

response_json = json.loads(response_text)

if response_json["payload"]["code"] == "INVALID_ACCESS_TOKEN_EXCEPTION":
if (
response_json["payload"]["code"] == "INVALID_ACCESS_TOKEN_EXCEPTION"
and not invalidate_access_token
):
config.async_invalidate_access_token()
return await async_send_changereport_message(
hass, config, alexa_entity, invalidate_access_token=False
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/deconz/.translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"options": {
"step": {
"async_step_deconz_devices": {
"deconz_devices": {
"data": {
"allow_clip_sensor": "Allow deCONZ CLIP sensors",
"allow_deconz_groups": "Allow deCONZ light groups"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/deconz/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"options": {
"step": {
"async_step_deconz_devices": {
"deconz_devices": {
"description": "Configure visibility of deCONZ device types",
"data": {
"allow_clip_sensor": "Allow deCONZ CLIP sensors",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/harmony/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Harmony",
"documentation": "https://www.home-assistant.io/components/harmony",
"requirements": [
"aioharmony==0.1.11"
"aioharmony==0.1.13"
],
"dependencies": [],
"codeowners": [
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/isy994/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Isy994",
"documentation": "https://www.home-assistant.io/components/isy994",
"requirements": [
"PyISY==1.1.1"
"PyISY==1.1.2"
],
"dependencies": [],
"codeowners": []
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/met/.translations/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"config": {
"error": {
"name_exists": "Name already exists"
"name_exists": "Location already exists"
},
"step": {
"user": {
Expand Down
18 changes: 13 additions & 5 deletions homeassistant/components/met/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
@callback
def configured_instances(hass):
"""Return a set of configured SimpliSafe instances."""
return set(
entry.data[CONF_NAME] for entry in hass.config_entries.async_entries(DOMAIN)
)
entites = []
for entry in hass.config_entries.async_entries(DOMAIN):
if entry.data.get("track_home"):
entites.append("home")
continue
entites.append(
f"{entry.data.get(CONF_LATITUDE)}-{entry.data.get(CONF_LONGITUDE)}"
)
return set(entites)


class MetFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
Expand All @@ -32,11 +38,13 @@ async def async_step_user(self, user_input=None):
self._errors = {}

if user_input is not None:
if user_input[CONF_NAME] not in configured_instances(self.hass):
if (
f"{user_input.get(CONF_LATITUDE)}-{user_input.get(CONF_LONGITUDE)}"
not in configured_instances(self.hass)
):
return self.async_create_entry(
title=user_input[CONF_NAME], data=user_input
)

self._errors[CONF_NAME] = "name_exists"

return await self._show_config_form(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/met/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
},
"error": {
"name_exists": "Name already exists"
"name_exists": "Location already exists"
}
}
}
12 changes: 8 additions & 4 deletions homeassistant/components/sonos/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,16 @@ def __init__(self, player):
async def async_added_to_hass(self):
"""Subscribe sonos events."""
await self.async_seen()

self.hass.data[DATA_SONOS].entities.append(self)

def _rebuild_groups():
"""Build the current group topology."""
for entity in self.hass.data[DATA_SONOS].entities:
entity.update_groups()

self.hass.async_add_executor_job(_rebuild_groups)

@property
def unique_id(self):
"""Return a unique ID."""
Expand Down Expand Up @@ -469,10 +477,6 @@ def _attach_player(self):
self.update_volume()
self._set_favorites()

# New player available, build the current group topology
for entity in self.hass.data[DATA_SONOS].entities:
entity.update_groups()

player = self.soco

def subscribe(service, action):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/version/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Version",
"documentation": "https://www.home-assistant.io/components/version",
"requirements": [
"pyhaversion==3.0.2"
"pyhaversion==3.1.0"
],
"dependencies": [],
"codeowners": [
Expand Down
12 changes: 10 additions & 2 deletions homeassistant/components/version/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"odroid-c2",
"odroid-xu",
]
ALL_SOURCES = ["local", "pypi", "hassio", "docker"]
ALL_SOURCES = ["local", "pypi", "hassio", "docker", "haio"]

CONF_BETA = "beta"
CONF_IMAGE = "image"
Expand All @@ -54,7 +54,13 @@

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Version sensor platform."""
from pyhaversion import LocalVersion, DockerVersion, HassioVersion, PyPiVersion
from pyhaversion import (
LocalVersion,
DockerVersion,
HassioVersion,
PyPiVersion,
HaIoVersion,
)

beta = config.get(CONF_BETA)
image = config.get(CONF_IMAGE)
Expand All @@ -74,6 +80,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
haversion = VersionData(HassioVersion(hass.loop, session, branch, image))
elif source == "docker":
haversion = VersionData(DockerVersion(hass.loop, session, branch, image))
elif source == "haio":
haversion = VersionData(HaIoVersion(hass.loop, session))
else:
haversion = VersionData(LocalVersion(hass.loop, session))

Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/websocket_api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
EVENT_SERVICE_REMOVED,
EVENT_STATE_CHANGED,
EVENT_THEMES_UPDATED,
EVENT_CORE_CONFIG_UPDATE,
)
from homeassistant.components.persistent_notification import (
EVENT_PERSISTENT_NOTIFICATIONS_UPDATED,
Expand All @@ -22,6 +23,7 @@
# Except for state_changed, which is handled accordingly.
SUBSCRIBE_WHITELIST = {
EVENT_COMPONENT_LOADED,
EVENT_CORE_CONFIG_UPDATE,
EVENT_PANELS_UPDATED,
EVENT_PERSISTENT_NOTIFICATIONS_UPDATED,
EVENT_SERVICE_REGISTERED,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 98
PATCH_VERSION = "2"
PATCH_VERSION = "3"
__short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION)
__version__ = "{}.{}".format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 6, 0)
Expand Down
6 changes: 3 additions & 3 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ PyEssent==0.13
PyGithub==1.43.5

# homeassistant.components.isy994
PyISY==1.1.1
PyISY==1.1.2

# homeassistant.components.mvglive
PyMVGLive==1.1.4
Expand Down Expand Up @@ -142,7 +142,7 @@ aiofreepybox==0.0.8
aioftp==0.12.0

# homeassistant.components.harmony
aioharmony==0.1.11
aioharmony==0.1.13

# homeassistant.components.emulated_hue
# homeassistant.components.http
Expand Down Expand Up @@ -1186,7 +1186,7 @@ pygtfs==0.1.5
pygtt==1.1.2

# homeassistant.components.version
pyhaversion==3.0.2
pyhaversion==3.1.0

# homeassistant.components.heos
pyheos==0.6.0
Expand Down
4 changes: 2 additions & 2 deletions tests/components/alexa/test_state_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

async def test_report_state(hass, aioclient_mock):
"""Test proactive state reports."""
aioclient_mock.post(TEST_URL, json={"data": "is irrelevant"}, status=202)
aioclient_mock.post(TEST_URL, text="", status=202)

hass.states.async_set(
"binary_sensor.test_contact",
Expand Down Expand Up @@ -39,7 +39,7 @@ async def test_report_state(hass, aioclient_mock):

async def test_send_add_or_update_message(hass, aioclient_mock):
"""Test sending an AddOrUpdateReport message."""
aioclient_mock.post(TEST_URL, json={"data": "is irrelevant"})
aioclient_mock.post(TEST_URL, text="")

hass.states.async_set(
"binary_sensor.test_contact",
Expand Down
4 changes: 3 additions & 1 deletion tests/components/met/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def test_flow_entry_created_from_user_input():
async def test_flow_entry_config_entry_already_exists():
"""Test that create data from user input and config_entry already exists.

Test when the form should show when user puts existing name
Test when the form should show when user puts existing location
in the config gui. Then the form should show with error
"""
hass = Mock()
Expand All @@ -112,6 +112,8 @@ async def test_flow_entry_config_entry_already_exists():

first_entry = MockConfigEntry(domain="met")
first_entry.data["name"] = "home"
first_entry.data[CONF_LONGITUDE] = "0"
first_entry.data[CONF_LATITUDE] = "0"
first_entry.add_to_hass(hass)

test_data = {
Expand Down