Skip to content

[pull] dev from home-assistant:dev #763

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 8 commits into from
Jun 4, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@v4.2.2

- name: Initialize CodeQL
uses: github/codeql-action/init@v3.28.18
uses: github/codeql-action/init@v3.28.19
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.28.18
uses: github/codeql-action/analyze@v3.28.19
with:
category: "/language:python"
5 changes: 5 additions & 0 deletions homeassistant/components/eddystone_temperature/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
"""The eddystone_temperature component."""

DOMAIN = "eddystone_temperature"
CONF_BEACONS = "beacons"
CONF_INSTANCE = "instance"
CONF_NAMESPACE = "namespace"
24 changes: 20 additions & 4 deletions homeassistant/components/eddystone_temperature/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@
STATE_UNKNOWN,
UnitOfTemperature,
)
from homeassistant.core import Event, HomeAssistant
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, Event, HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from . import CONF_BEACONS, CONF_INSTANCE, CONF_NAMESPACE, DOMAIN

_LOGGER = logging.getLogger(__name__)

CONF_BEACONS = "beacons"
CONF_BT_DEVICE_ID = "bt_device_id"
CONF_INSTANCE = "instance"
CONF_NAMESPACE = "namespace"


BEACON_SCHEMA = vol.Schema(
{
Expand All @@ -58,6 +59,21 @@ def setup_platform(
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Validate configuration, create devices and start monitoring thread."""
create_issue(
hass,
HOMEASSISTANT_DOMAIN,
f"deprecated_system_packages_yaml_integration_{DOMAIN}",
breaks_in_ha_version="2025.12.0",
is_fixable=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_system_packages_yaml_integration",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "Eddystone",
},
)

bt_device_id: int = config[CONF_BT_DEVICE_ID]

beacons: dict[str, dict[str, str]] = config[CONF_BEACONS]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"mqtt": ["esphome/discover/#"],
"quality_scale": "platinum",
"requirements": [
"aioesphomeapi==31.1.0",
"aioesphomeapi==32.0.0",
"esphome-dashboard-api==1.3.0",
"bleak-esphome==2.16.0"
],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/modbus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/modbus",
"iot_class": "local_polling",
"loggers": ["pymodbus"],
"requirements": ["pymodbus==3.8.3"]
"requirements": ["pymodbus==3.9.2"]
}
2 changes: 2 additions & 0 deletions homeassistant/components/ollama/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
CONF_MODEL,
CONF_NUM_CTX,
CONF_PROMPT,
CONF_THINK,
DEFAULT_TIMEOUT,
DOMAIN,
)
Expand All @@ -33,6 +34,7 @@
"CONF_MODEL",
"CONF_NUM_CTX",
"CONF_PROMPT",
"CONF_THINK",
"CONF_URL",
"DOMAIN",
]
Expand Down
9 changes: 9 additions & 0 deletions homeassistant/components/ollama/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from homeassistant.core import HomeAssistant
from homeassistant.helpers import llm
from homeassistant.helpers.selector import (
BooleanSelector,
NumberSelector,
NumberSelectorConfig,
NumberSelectorMode,
Expand All @@ -41,10 +42,12 @@
CONF_MODEL,
CONF_NUM_CTX,
CONF_PROMPT,
CONF_THINK,
DEFAULT_KEEP_ALIVE,
DEFAULT_MAX_HISTORY,
DEFAULT_MODEL,
DEFAULT_NUM_CTX,
DEFAULT_THINK,
DEFAULT_TIMEOUT,
DOMAIN,
MAX_NUM_CTX,
Expand Down Expand Up @@ -280,6 +283,12 @@ def ollama_config_option_schema(
min=-1, max=sys.maxsize, step=1, mode=NumberSelectorMode.BOX
)
),
vol.Optional(
CONF_THINK,
description={
"suggested_value": options.get("think", DEFAULT_THINK),
},
): BooleanSelector(),
}


Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/ollama/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

CONF_MODEL = "model"
CONF_PROMPT = "prompt"
CONF_THINK = "think"

CONF_KEEP_ALIVE = "keep_alive"
DEFAULT_KEEP_ALIVE = -1 # seconds. -1 = indefinite, 0 = never
Expand All @@ -15,6 +16,7 @@
DEFAULT_NUM_CTX = 8192
MIN_NUM_CTX = 2048
MAX_NUM_CTX = 131072
DEFAULT_THINK = False

CONF_MAX_HISTORY = "max_history"
DEFAULT_MAX_HISTORY = 20
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/ollama/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
CONF_MODEL,
CONF_NUM_CTX,
CONF_PROMPT,
CONF_THINK,
DEFAULT_KEEP_ALIVE,
DEFAULT_MAX_HISTORY,
DEFAULT_NUM_CTX,
Expand Down Expand Up @@ -256,6 +257,7 @@ async def _async_handle_message(
# keep_alive requires specifying unit. In this case, seconds
keep_alive=f"{settings.get(CONF_KEEP_ALIVE, DEFAULT_KEEP_ALIVE)}s",
options={CONF_NUM_CTX: settings.get(CONF_NUM_CTX, DEFAULT_NUM_CTX)},
think=settings.get(CONF_THINK),
)
except (ollama.RequestError, ollama.ResponseError) as err:
_LOGGER.error("Unexpected error talking to Ollama server: %s", err)
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/ollama/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
"llm_hass_api": "[%key:common::config_flow::data::llm_hass_api%]",
"max_history": "Max history messages",
"num_ctx": "Context window size",
"keep_alive": "Keep alive"
"keep_alive": "Keep alive",
"think": "Think before responding"
},
"data_description": {
"prompt": "Instruct how the LLM should respond. This can be a template.",
"keep_alive": "Duration in seconds for Ollama to keep model in memory. -1 = indefinite, 0 = never.",
"num_ctx": "Maximum number of text tokens the model can process. Lower to reduce Ollama RAM, or increase for a large number of exposed entities."
"num_ctx": "Maximum number of text tokens the model can process. Lower to reduce Ollama RAM, or increase for a large number of exposed entities.",
"think": "If enabled, the LLM will think before responding. This can improve response quality but may increase latency."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/vera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/vera",
"iot_class": "local_polling",
"loggers": ["pyvera"],
"requirements": ["pyvera==0.3.15"]
"requirements": ["pyvera==0.3.16"]
}
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ iso4217!=1.10.20220401

# protobuf must be in package constraints for the wheel
# builder to build binary wheels
protobuf==6.30.2
protobuf==6.31.1

# faust-cchardet: Ensure we have a version we can build wheels
# 2.1.18 is the first version that works with our wheel builder
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
"error::sqlalchemy.exc.SAWarning",
"error:usefixtures\\(\\) in .* without arguments has no effect:UserWarning", # pytest

# -- HomeAssistant - aiohttp
# Overwrite web.Application to pass a custom default argument to _make_request
Expand Down
6 changes: 3 additions & 3 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.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pytest-timeout==2.4.0
pytest-unordered==0.6.1
pytest-picked==0.5.1
pytest-xdist==3.7.0
pytest==8.3.5
pytest==8.4.0
requests-mock==1.12.1
respx==0.22.0
syrupy==4.9.1
Expand Down
9 changes: 6 additions & 3 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 script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@

# protobuf must be in package constraints for the wheel
# builder to build binary wheels
protobuf==6.30.2
protobuf==6.31.1

# faust-cchardet: Ensure we have a version we can build wheels
# 2.1.18 is the first version that works with our wheel builder
Expand Down
1 change: 0 additions & 1 deletion script/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ def from_dict(cls, data: PackageMetadata) -> PackageDefinition:
"pymitv", # MIT
"pybbox", # https://github.com/HydrelioxGitHub/pybbox/pull/5
"pysabnzbd", # https://github.com/jeradM/pysabnzbd/pull/6
"pyvera", # https://github.com/maximvelichko/pyvera/pull/164
"sharp_aquos_rc", # https://github.com/jmoore987/sharp_aquos_rc/pull/14
"tapsaff", # https://github.com/bazwilliams/python-taps-aff/pull/5
}
Expand Down
4 changes: 2 additions & 2 deletions tests/components/backup/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1866,15 +1866,15 @@ async def _mock_step(hass: HomeAssistant) -> None:
BackupManagerExceptionGroup,
(
"Multiple errors when creating backup: Error during pre-backup: Boom, "
"Error during post-backup: Test exception (2 sub-exceptions)"
"Error during post-backup: Test exception"
),
),
(
Exception("Boom"),
BackupManagerExceptionGroup,
(
"Multiple errors when creating backup: Error during pre-backup: Boom, "
"Error during post-backup: Test exception (2 sub-exceptions)"
"Error during post-backup: Test exception"
),
),
],
Expand Down
1 change: 1 addition & 0 deletions tests/components/eddystone_temperature/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for eddystone temperature."""
45 changes: 45 additions & 0 deletions tests/components/eddystone_temperature/test_sensor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Tests for eddystone temperature."""

from unittest.mock import Mock, patch

from homeassistant.components.eddystone_temperature import (
CONF_BEACONS,
CONF_INSTANCE,
CONF_NAMESPACE,
DOMAIN,
)
from homeassistant.components.sensor import DOMAIN as PLATFORM_DOMAIN
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.setup import async_setup_component


@patch.dict("sys.modules", beacontools=Mock())
async def test_repair_issue_is_created(
hass: HomeAssistant,
issue_registry: ir.IssueRegistry,
) -> None:
"""Test repair issue is created."""
assert await async_setup_component(
hass,
PLATFORM_DOMAIN,
{
PLATFORM_DOMAIN: [
{
CONF_PLATFORM: DOMAIN,
CONF_BEACONS: {
"living_room": {
CONF_NAMESPACE: "112233445566778899AA",
CONF_INSTANCE: "000000000001",
}
},
}
],
},
)
await hass.async_block_till_done()
assert (
HOMEASSISTANT_DOMAIN,
f"deprecated_system_packages_yaml_integration_{DOMAIN}",
) in issue_registry.issues
2 changes: 2 additions & 0 deletions tests/components/ollama/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async def test_options(
ollama.CONF_PROMPT: "test prompt",
ollama.CONF_MAX_HISTORY: 100,
ollama.CONF_NUM_CTX: 32768,
ollama.CONF_THINK: True,
},
)
await hass.async_block_till_done()
Expand All @@ -176,6 +177,7 @@ async def test_options(
ollama.CONF_PROMPT: "test prompt",
ollama.CONF_MAX_HISTORY: 100,
ollama.CONF_NUM_CTX: 32768,
ollama.CONF_THINK: True,
}


Expand Down
Loading