Skip to content
Merged
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
24 changes: 8 additions & 16 deletions homeassistant/components/honeywell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import (
async_create_clientsession,
async_get_clientsession,
)

from .const import (
_LOGGER,
CONF_COOL_AWAY_TEMPERATURE,
CONF_HEAT_AWAY_TEMPERATURE,
DOMAIN,
)
from homeassistant.helpers.aiohttp_client import async_create_clientsession

from .const import _LOGGER, CONF_COOL_AWAY_TEMPERATURE, CONF_HEAT_AWAY_TEMPERATURE

UPDATE_LOOP_SLEEP_TIME = 5
PLATFORMS = [Platform.CLIMATE, Platform.HUMIDIFIER, Platform.SENSOR, Platform.SWITCH]
Expand Down Expand Up @@ -56,11 +48,11 @@ async def async_setup_entry(
username = config_entry.data[CONF_USERNAME]
password = config_entry.data[CONF_PASSWORD]

if len(hass.config_entries.async_entries(DOMAIN)) > 1:
session = async_create_clientsession(hass)
else:
session = async_get_clientsession(hass)

# Always create a new session for Honeywell to prevent cookie injection
# issues. Even with response_url handling in aiosomecomfort 0.0.33+,
# cookies can still leak into other integrations when using the shared
# session. See issue #147395.
session = async_create_clientsession(hass)
client = aiosomecomfort.AIOSomeComfort(username, password, session=session)
try:
await client.login()
Expand Down
8 changes: 6 additions & 2 deletions homeassistant/components/honeywell/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession

from .const import (
CONF_COOL_AWAY_TEMPERATURE,
Expand Down Expand Up @@ -114,10 +114,14 @@ async def async_step_user(self, user_input=None) -> ConfigFlowResult:

async def is_valid(self, **kwargs) -> bool:
"""Check if login credentials are valid."""
# Always create a new session for Honeywell to prevent cookie injection
# issues. Even with response_url handling in aiosomecomfort 0.0.33+,
# cookies can still leak into other integrations when using the shared
# session. See issue #147395.
client = aiosomecomfort.AIOSomeComfort(
kwargs[CONF_USERNAME],
kwargs[CONF_PASSWORD],
session=async_get_clientsession(self.hass),
session=async_create_clientsession(self.hass),
)

await client.login()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/lcn/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"iot_class": "local_push",
"loggers": ["pypck"],
"quality_scale": "bronze",
"requirements": ["pypck==0.8.9", "lcn-frontend==0.2.5"]
"requirements": ["pypck==0.8.10", "lcn-frontend==0.2.5"]
}
24 changes: 12 additions & 12 deletions homeassistant/components/proximity/strings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"title": "Proximity",
"config": {
"flow_title": "Proximity",
"flow_title": "[%key:component::proximity::title%]",
"step": {
"user": {
"data": {
"zone": "Zone to track distance to",
"ignored_zones": "Zones to ignore",
"tracked_entities": "Devices or Persons to track",
"tracked_entities": "Devices or persons to track",
"tolerance": "Tolerance distance"
}
}
Expand All @@ -21,34 +21,34 @@
"step": {
"init": {
"data": {
"zone": "Zone to track distance to",
"ignored_zones": "Zones to ignore",
"tracked_entities": "Devices or Persons to track",
"tolerance": "Tolerance distance"
"zone": "[%key:component::proximity::config::step::user::data::zone%]",
"ignored_zones": "[%key:component::proximity::config::step::user::data::ignored_zones%]",
"tracked_entities": "[%key:component::proximity::config::step::user::data::tracked_entities%]",
"tolerance": "[%key:component::proximity::config::step::user::data::tolerance%]"
}
}
}
},
"entity": {
"sensor": {
"dir_of_travel": {
"name": "{tracked_entity} Direction of travel",
"name": "{tracked_entity} direction of travel",
"state": {
"arrived": "Arrived",
"away_from": "Away from",
"stationary": "Stationary",
"towards": "Towards"
}
},
"dist_to_zone": { "name": "{tracked_entity} Distance" },
"dist_to_zone": { "name": "{tracked_entity} distance" },
"nearest": { "name": "Nearest device" },
"nearest_dir_of_travel": {
"name": "Nearest direction of travel",
"state": {
"arrived": "Arrived",
"away_from": "Away from",
"stationary": "Stationary",
"towards": "Towards"
"arrived": "[%key:component::proximity::entity::sensor::dir_of_travel::state::arrived%]",
"away_from": "[%key:component::proximity::entity::sensor::dir_of_travel::state::away_from%]",
"stationary": "[%key:component::proximity::entity::sensor::dir_of_travel::state::stationary%]",
"towards": "[%key:component::proximity::entity::sensor::dir_of_travel::state::towards%]"
}
},
"nearest_dist_to_zone": { "name": "Nearest distance" }
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/shelly/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"iot_class": "local_push",
"loggers": ["aioshelly"],
"quality_scale": "silver",
"requirements": ["aioshelly==13.7.0"],
"requirements": ["aioshelly==13.7.1"],
"zeroconf": [
{
"type": "_http._tcp.local.",
Expand Down
4 changes: 2 additions & 2 deletions requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/components/proximity/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ async def test_sensor_unique_ids(
assert entity
assert entity.unique_id == f"{mock_config.entry_id}_{t1.id}_dist_to_zone"
state = hass.states.get(sensor_t1)
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Home Test tracker 1 Distance"
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Home Test tracker 1 distance"

entity = entity_registry.async_get("sensor.home_test2_distance")
assert entity
Expand Down
Loading