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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
rev: v0.15.15
hooks:
- id: ruff-check
args:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/indevolt/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"integration_type": "device",
"iot_class": "local_polling",
"quality_scale": "platinum",
"requirements": ["indevolt-api==1.8.3"],
"requirements": ["indevolt-api==1.8.5"],
"zeroconf": [{ "name": "igen_fw*", "type": "_http._tcp.local." }]
}
2 changes: 1 addition & 1 deletion homeassistant/components/powerwall/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"integration_type": "device",
"iot_class": "local_polling",
"loggers": ["tesla_powerwall"],
"requirements": ["tesla-powerwall==0.5.2"]
"requirements": ["tesla-powerwall==0.5.3"]
}
21 changes: 7 additions & 14 deletions homeassistant/components/zone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
CONF_RADIUS,
EVENT_CORE_CONFIG_UPDATE,
SERVICE_RELOAD,
STATE_HOME,
STATE_NOT_HOME,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from homeassistant.core import (
Event,
Expand Down Expand Up @@ -432,7 +429,6 @@ def _set_attrs_from_config(self) -> None:
config = self._config
name: str = config[CONF_NAME]
self._attr_name = name
self._case_folded_name = name.casefold()
self._attr_unique_id = config.get(CONF_ID)
self._attr_icon = config.get(CONF_ICON)

Expand Down Expand Up @@ -514,16 +510,13 @@ def _generate_attrs(self) -> None:
@callback
def _state_is_in_zone(self, state: State | None) -> bool:
"""Return if given state is in zone."""

from homeassistant.components.device_tracker import ( # noqa: PLC0415
ATTR_IN_ZONES,
)

return (
state is not None
and state.state
not in (
STATE_NOT_HOME,
STATE_UNKNOWN,
STATE_UNAVAILABLE,
)
and (
state.state.casefold() == self._case_folded_name
or (state.state == STATE_HOME and self.entity_id == ENTITY_ID_HOME)
)
and ATTR_IN_ZONES in state.attributes
and self.entity_id in state.attributes[ATTR_IN_ZONES]
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ exclude_lines = [
]

[tool.ruff]
required-version = ">=0.15.14"
required-version = ">=0.15.15"

[tool.ruff.lint]
select = [
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.

2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt

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

7 changes: 5 additions & 2 deletions tests/components/zone/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,11 @@ async def test_state(hass: HomeAssistant) -> None:

state = hass.states.get("zone.test_zone")
assert state
assert state.state == "1"
assert state.attributes[ATTR_PERSONS] == ["person.person2"]
assert state.state == "2"
assert sorted(state.attributes[ATTR_PERSONS]) == [
"person.person1",
"person.person2",
]

state = hass.states.get("zone.home")
assert state
Expand Down
2 changes: 2 additions & 0 deletions tests/helpers/template/extensions/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ async def test_expand(hass: HomeAssistant) -> None:
hass.states.async_set(
"person.person1",
"test",
{"in_zones": ["zone.test"]},
)
await hass.async_block_till_done()

Expand All @@ -900,6 +901,7 @@ async def test_expand(hass: HomeAssistant) -> None:
hass.states.async_set(
"person.person2",
"test",
{"in_zones": ["zone.test"]},
)
await hass.async_block_till_done()

Expand Down
Loading