8000 2021.6.1 by balloob · Pull Request #51449 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

2021.6.1 #51449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 4, 2021
Merged

2021.6.1 #51449

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
21 changes: 11 additions & 10 deletions homeassistant/components/fritz/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,22 @@ def update(self, dev_info, dev_home, consider_home):
"""Update device info."""
utc_point_in_time = dt_util.utcnow()

if not self._name:
self._name = dev_info.name or self._mac.replace(":", "_")

if not dev_home and self._last_activity:
self._connected = (
if self._last_activity:
consider_home_evaluated = (
utc_point_in_time - self._last_activity
).total_seconds() < consider_home
else:
self._connected = dev_home
consider_home_evaluated = dev_home

if self._connected:
self._ip_address = dev_info.ip_address
if not self._name:
self._name = dev_info.name or self._mac.replace(":", "_")

self._connected = dev_home or consider_home_evaluated

if dev_home:
self._last_activity = utc_point_in_time
else:
self._ip_address = None

self._ip_address = dev_info.ip_address if self._connected else None

@property
def is_connected(self):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/integrations/frontend",
"requirements": [
"home-assistant-frontend==20210601.1"
"home-assistant-frontend==20210603.0"
],
"dependencies": [
"api",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "HomeKit Controller",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
"requirements": ["aiohomekit==0.2.66"],
"requirements": ["aiohomekit==0.2.67"],
"zeroconf": ["_hap._tcp.local."],
"after_dependencies": ["zeroconf"],
"codeowners": ["@Jc2k", "@bdraco"],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/shopping_list/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ incomplete_item:
text:

complete_all:
name: Complete call
name: Complete all
description: Marks all items as completed in the shopping list. It does not remove the items.

incomplete_all:
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/sonos/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging

from pysonos.core import SoCo
from pysonos.exceptions import SoCoException

import homeassistant.helpers.device_registry as dr
from homeassistant.helpers.dispatcher import (
Expand Down Expand Up @@ -70,7 +71,10 @@ async def async_poll(self, now: datetime.datetime) -> None:
self.speaker.subscription_address,
)
self.speaker.is_first_poll = False
await self.async_update() # pylint: disable=no-member
try:
await self.async_update() # pylint: disable=no-member
except (OSError, SoCoException) as ex:
_LOGGER.debug("Error connecting to %s: %s", self.entity_id, ex)

@property
def soco(self) -> SoCo:
Expand Down
17 changes: 7 additions & 10 deletions homeassistant/components/sonos/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
PLAY_MODE_BY_MEANING,
PLAY_MODES,
)
from pysonos.exceptions import SoCoException, SoCoUPnPException
from pysonos.exceptions import SoCoUPnPException
import voluptuous as vol

from homeassistant.components.media_player import MediaPlayerEntity
Expand Down Expand Up @@ -293,18 +293,15 @@ def state(self) -> str:
return STATE_IDLE

async def async_update(self) -> None:
"""Retrieve latest state."""
"""Retrieve latest state by polling."""
await self.hass.async_add_executor_job(self._update)

def _update(self) -> None:
"""Retrieve latest state."""
try:
self.speaker.update_groups()
self.speaker.update_volume()
if self.speaker.is_coordinator:
self.speaker.update_media()
except SoCoException:
pass
"""Retrieve latest state by polling."""
self.speaker.update_groups()
self.speaker.update_volume()
if self.speaker.is_coordinator:
self.speaker.update_media()

@property
def volume_level(self) -> float | None:
Expand Down
14 changes: 9 additions & 5 deletions homeassistant/components/tibber/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def __init__(self, tibber_home):
"""Initialize the sensor."""
self._tibber_home = tibber_home
self._home_name = tibber_home.info["viewer"]["home"]["appNickname"]
self._device_name = None
if self._home_name is None:
self._home_name = tibber_home.info["viewer"]["home"]["address"].get(
"address1", ""
Expand All @@ -202,7 +203,7 @@ def device_info(self):
"""Return the device_info of the device."""
device_info = {
"identifiers": {(TIBBER_DOMAIN, self.device_id)},
"name": self.name,
"name": self._device_name,
"manufacturer": MANUFACTURER,
}
if self._model is not None:
Expand Down Expand Up @@ -237,6 +238,8 @@ def __init__(self, tibber_home):
self._attr_unique_id = f"{self._tibber_home.home_id}"
self._model = "Price Sensor"

self._device_name = self._attr_name

async def async_update(self):
"""Get the latest data and updates the states."""
now = dt_util.now()
Expand Down Expand Up @@ -295,6 +298,7 @@ def __init__(
super().__init__(tibber_home)
self._sensor_name = sensor_name
self._model = "Tibber Pulse"
self._device_name = f"{self._model} {self._home_name}"

self._attr_device_class = device_class
self._attr_name = f"{self._sensor_name} {self._home_name}"
Expand Down Expand Up @@ -330,7 +334,7 @@ async def async_added_to_hass(self):
self.async_on_remove(
async_dispatcher_connect(
self.hass,
SIGNAL_UPDATE_ENTITY.format(self._sensor_name),
SIGNAL_UPDATE_ENTITY.format(self.unique_id),
self._set_state,
)
)
Expand Down Expand Up @@ -370,7 +374,7 @@ def __init__(self, async_add_entities, tibber_home, hass):
self._async_add_entities = async_add_entities
self._tibber_home = tibber_home
self.hass = hass
self._entities = set()
self._entities = {}

async def async_callback(self, payload):
"""Handle received data."""
Expand All @@ -393,7 +397,7 @@ async def async_callback(self, payload):
if sensor_type in self._entities:
async_dispatcher_send(
self.hass,
SIGNAL_UPDATE_ENTITY.format(RT_SENSOR_MAP[sensor_type][0]),
SIGNAL_UPDATE_ENTITY.format(self._entities[sensor_type]),
state,
timestamp,
)
Expand All @@ -412,6 +416,6 @@ async def async_callback(self, payload):
state_class,
)
new_entities.append(entity)
self._entities.add(sensor_type)
self._entities[sensor_type] = entity.unique_id
if new_entities:
self._async_add_entities(new_entities)
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def current_temperature_value(resolved_data: dict[str, Any]) -> ZwaveValue | Non
lookup_table: dict[str | int, ZwaveValue | None] = resolved_data["lookup_table"]
dependent_value: ZwaveValue | None = resolved_data["dependent_value"]

if dependent_value:
if dependent_value and dependent_value.value is not None:
lookup_key = dependent_value.metadata.states[
str(dependent_value.value)
].split("-")[0]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/zwave_js/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Z-Wave JS",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zwave_js",
"requirements": ["zwave-js-server-python==0.26.0"],
"requirements": ["zwave-js-server-python==0.26.1"],
"codeowners": ["@home-assistant/z-wave"],
"dependencies": ["http", "websocket_api"],
"iot_class": "local_push"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

MAJOR_VERSION: Final = 2021
MINOR_VERSION: Final = 6
PATCH_VERSION: Final = "0"
PATCH_VERSION: Final = "1"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 8, 0)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defusedxml==0.7.1
distro==1.5.0
emoji==1.2.0
hass-nabucasa==0.43.0
home-assistant-frontend==20210601.1
home-assistant-frontend==20210603.0
httpx==0.18.0
ifaddr==0.1.7
jinja2>=3.0.1
Expand Down
6 changes: 3 additions & 3 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ aioguardian==1.0.4
aioharmony==0.2.7

# homeassistant.components.homekit_controller
aiohomekit==0.2.66
aiohomekit==0.2.67

# homeassistant.components.emulated_hue
# homeassistant.components.http
Expand Down Expand Up @@ -765,7 +765,7 @@ hole==0.5.1
holidays==0.11.1

# homeassistant.components.frontend
home-assistant-frontend==20210601.1
home-assistant-frontend==20210603.0

# homeassistant.components.zwave
homeassistant-pyozw==0.1.10
Expand Down Expand Up @@ -2442,4 +2442,4 @@ zigpy==0.33.0
zm-py==0.5.2

# homeassistant.components.zwave_js
zwave-js-server-python==0.26.0
zwave-js-server-python==0.26.1
6 changes: 3 additions & 3 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ aioguardian==1.0.4
aioharmony==0.2.7

# homeassistant.components.homekit_controller
aiohomekit==0.2.66
aiohomekit==0.2.67

# homeassistant.components.emulated_hue
# homeassistant.components.http
Expand Down Expand Up @@ -429,7 +429,7 @@ hole==0.5.1
holidays==0.11.1

# homeassistant.components.frontend
home-assistant-frontend==20210601.1
home-assistant-frontend==20210603.0

# homeassistant.components.zwave
homeassistant-pyozw==0.1.10
Expand Down Expand Up @@ -1324,4 +1324,4 @@ zigpy-znp==0.5.1
zigpy==0.33.0

# homeassistant.components.zwave_js
zwave-js-server-python==0.26.0
zwave-js-server-python==0.26.1
18 changes: 18 additions & 0 deletions tests/components/zwave_js/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@ def climate_heatit_z_trm2fx_state_fixture():
return json.loads(load_fixture("zwave_js/climate_heatit_z_trm2fx_state.json"))


@pytest.fixture(name="climate_heatit_z_trm3_no_value_state", scope="session")
def climate_heatit_z_trm3_no_value_state_fixture():
"""Load the climate HEATIT Z-TRM3 thermostat node w/no value state fixture data."""
return json.loads(
load_fixture("zwave_js/climate_heatit_z_trm3_no_value_state.json")
)


@pytest.fixture(name="nortek_thermostat_state", scope="session")
def nortek_thermostat_state_fixture():
"""Load the nortek thermostat node state fixture data."""
Expand Down Expand Up @@ -517,6 +525,16 @@ def climate_eurotronic_spirit_z_fixture(client, climate_eurotronic_spirit_z_stat
return node


@pytest.fixture(name="climate_heatit_z_trm3_no_value")
def climate_heatit_z_trm3_no_value_fixture(
client, climate_heatit_z_trm3_no_value_state
):
"""Mock a climate radio HEATIT Z-TRM3 node."""
node = Node(client, copy.deepcopy(climate_heatit_z_trm3_no_value_state))
client.driver.controller.nodes[node.node_id] = node
return node


@pytest.fixture(name="climate_heatit_z_trm3")
def climate_heatit_z_trm3_fixture(client, climate_heatit_z_trm3_state):
"""Mock a climate radio HEATIT Z-TRM3 node."""
Expand Down
10 changes: 10 additions & 0 deletions tests/components/zwave_js/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,16 @@ async def test_setpoint_thermostat(hass, client, climate_danfoss_lc_13, integrat
client.async_send_command_no_wait.reset_mock()


async def test_thermostat_heatit_z_trm3_no_value(
hass, client, climate_heatit_z_trm3_no_value, integration
):
"""Test a heatit Z-TRM3 entity that is missing a value."""
# When the config parameter that specifies what sensor to use has no value, we fall
# back to the first temperature sensor found on the device
state = hass.states.get(CLIMATE_FLOOR_THERMOSTAT_ENTITY)
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 22.5


async def test_thermostat_heatit_z_trm3(
hass, client, climate_heatit_z_trm3, integration
):
Expand Down
Loading
0