Skip to content
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

2024.12.5 #133636

Merged
merged 16 commits into from
Dec 20, 2024
Merged

2024.12.5 #133636

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
3 changes: 0 additions & 3 deletions homeassistant/components/fjaraskupan/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from typing import Any

from fjaraskupan import COMMAND_LIGHT_ON_OFF

from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -62,7 +60,6 @@ async def async_turn_off(self, **kwargs: Any) -> None:
if self.is_on:
async with self.coordinator.async_connect_and_update() as device:
await device.send_dim(0)
await device.send_command(COMMAND_LIGHT_ON_OFF)

@property
def is_on(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fjaraskupan/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"documentation": "https://www.home-assistant.io/integrations/fjaraskupan",
"iot_class": "local_polling",
"loggers": ["bleak", "fjaraskupan"],
"requirements": ["fjaraskupan==2.3.0"]
"requirements": ["fjaraskupan==2.3.2"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/freebox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"documentation": "https://www.home-assistant.io/integrations/freebox",
"iot_class": "local_polling",
"loggers": ["freebox_api"],
"requirements": ["freebox-api==1.1.0"],
"requirements": ["freebox-api==1.2.1"],
"zeroconf": ["_fbx-api._tcp.local."]
}
2 changes: 1 addition & 1 deletion homeassistant/components/gardena_bluetooth/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"documentation": "https://www.home-assistant.io/integrations/gardena_bluetooth",
"iot_class": "local_polling",
"loggers": ["bleak", "bleak_esphome", "gardena_bluetooth"],
"requirements": ["gardena-bluetooth==1.4.4"]
"requirements": ["gardena-bluetooth==1.5.0"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/integration/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def _schedule_max_sub_interval_exceeded_if_state_is_numeric(
if (
self._max_sub_interval is not None
and source_state is not None
and (source_state_dec := _decimal_state(source_state.state))
and (source_state_dec := _decimal_state(source_state.state)) is not None
):

@callback
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ async def async_connect(self, client_available: asyncio.Future[bool]) -> None:
self.conf.get(CONF_PORT, DEFAULT_PORT),
self.conf.get(CONF_KEEPALIVE, DEFAULT_KEEPALIVE),
)
except OSError as err:
except (OSError, mqtt.WebsocketConnectionError) as err:
_LOGGER.error("Failed to connect to MQTT server due to exception: %s", err)
self._async_connection_result(False)
finally:
Expand Down
8 changes: 2 additions & 6 deletions homeassistant/components/music_assistant/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,13 @@ def _update_media_attributes(
# shuffle and repeat are not (yet) supported for external sources
self._attr_shuffle = None
self._attr_repeat = None
if TYPE_CHECKING:
assert player.elapsed_time is not None
self._attr_media_position = int(player.elapsed_time)
self._attr_media_position = int(player.elapsed_time or 0)
self._attr_media_position_updated_at = (
utc_from_timestamp(player.elapsed_time_last_updated)
if player.elapsed_time_last_updated
else None
)
if TYPE_CHECKING:
assert player.elapsed_time is not None
self._prev_time = player.elapsed_time
self._prev_time = player.elapsed_time or 0
return

if queue is None:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/nice_go/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
REFRESH_TOKEN_EXPIRY_TIME = timedelta(days=30)

SUPPORTED_DEVICE_TYPES = {
Platform.LIGHT: ["WallStation"],
Platform.SWITCH: ["WallStation"],
Platform.LIGHT: ["WallStation", "WallStation_ESP32"],
Platform.SWITCH: ["WallStation", "WallStation_ESP32"],
}
KNOWN_UNSUPPORTED_DEVICE_TYPES = {
Platform.LIGHT: ["Mms100"],
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/nice_go/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ async def on_data(self, data: dict[str, Any]) -> None:
].type, # Device type is not sent in device state update, and it can't change, so we just reuse the existing one
BarrierState(
deviceId=raw_data["deviceId"],
desired=json.loads(raw_data["desired"]),
reported=json.loads(raw_data["reported"]),
connectionState=ConnectionState(
connected=raw_data["connectionState"]["connected"],
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/nice_go/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
DEVICE_CLASSES = {
"WallStation": CoverDeviceClass.GARAGE,
"Mms100": CoverDeviceClass.GATE,
"WallStation_ESP32": CoverDeviceClass.GARAGE,
}
PARALLEL_UPDATES = 1

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/nice_go/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "hub",
"iot_class": "cloud_push",
"loggers": ["nice_go"],
"requirements": ["nice-go==0.3.10"]
"requirements": ["nice-go==1.0.0"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/overkiz/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def async_validate_input(self, user_input: dict[str, Any]) -> dict[str, An
for gateway in gateways:
if is_overkiz_gateway(gateway.id):
gateway_id = gateway.id
await self.async_set_unique_id(gateway_id)
await self.async_set_unique_id(gateway_id, raise_on_progress=False)

return user_input

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/overkiz/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"integration_type": "hub",
"iot_class": "local_polling",
"loggers": ["boto3", "botocore", "pyhumps", "pyoverkiz", "s3transfer"],
"requirements": ["pyoverkiz==1.15.0"],
"requirements": ["pyoverkiz==1.15.3"],
"zeroconf": [
{
"type": "_kizbox._tcp.local.",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/roborock/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"iot_class": "local_polling",
"loggers": ["roborock"],
"requirements": [
"python-roborock==2.7.2",
"python-roborock==2.8.1",
"vacuum-map-parser-roborock==0.1.2"
]
}
3 changes: 2 additions & 1 deletion homeassistant/components/screenlogic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any

from screenlogicpy import ScreenLogicError, ScreenLogicGateway
from screenlogicpy.const.common import ScreenLogicConnectionError
from screenlogicpy.const.data import SHARED_VALUES

from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -64,7 +65,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ScreenLogicConfigEntry)
try:
await gateway.async_connect(**connect_info)
await gateway.async_update()
except ScreenLogicError as ex:
except (ScreenLogicConnectionError, ScreenLogicError) as ex:
raise ConfigEntryNotReady(ex.msg) from ex

coordinator = ScreenlogicDataUpdateCoordinator(
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/twinkly/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ async def async_step_user(
except (TimeoutError, ClientError):
errors[CONF_HOST] = "cannot_connect"
else:
await self.async_set_unique_id(device_info[DEV_ID])
await self.async_set_unique_id(
device_info[DEV_ID], raise_on_progress=False
)
self._abort_if_unique_id_configured()

return self._create_entry_from_device(device_info, host)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
APPLICATION_NAME: Final = "HomeAssistant"
MAJOR_VERSION: Final = 2024
MINOR_VERSION: Final = 12
PATCH_VERSION: Final = "4"
PATCH_VERSION: Final = "5"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 12, 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 @@ -5,7 +5,7 @@ aiodiscover==2.1.0
aiodns==3.2.0
aiohasupervisor==0.2.1
aiohttp-fast-zlib==0.2.0
aiohttp==3.11.10
aiohttp==3.11.11
aiohttp_cors==0.7.0
aiozoneinfo==0.2.1
astral==2.2
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "homeassistant"
version = "2024.12.4"
version = "2024.12.5"
license = {text = "Apache-2.0"}
description = "Open-source home automation platform running on Python 3."
readme = "README.rst"
Expand All @@ -29,7 +29,7 @@ dependencies = [
# change behavior based on presence of supervisor. Deprecated with #127228
# Lib can be removed with 2025.11
"aiohasupervisor==0.2.1",
"aiohttp==3.11.10",
"aiohttp==3.11.11",
"aiohttp_cors==0.7.0",
"aiohttp-fast-zlib==0.2.0",
"aiozoneinfo==0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Home Assistant Core
aiodns==3.2.0
aiohasupervisor==0.2.1
aiohttp==3.11.10
aiohttp==3.11.11
aiohttp_cors==0.7.0
aiohttp-fast-zlib==0.2.0
aiozoneinfo==0.2.1
Expand Down
12 changes: 6 additions & 6 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ fivem-api==0.1.2
fixerio==1.0.0a0

# homeassistant.components.fjaraskupan
fjaraskupan==2.3.0
fjaraskupan==2.3.2

# homeassistant.components.flexit_bacnet
flexit_bacnet==2.2.1
Expand All @@ -937,7 +937,7 @@ forecast-solar==4.0.0
fortiosapi==1.0.5

# homeassistant.components.freebox
freebox-api==1.1.0
freebox-api==1.2.1

# homeassistant.components.free_mobile
freesms==0.2.0
Expand All @@ -953,7 +953,7 @@ fyta_cli==0.7.0
gTTS==2.2.4

# homeassistant.components.gardena_bluetooth
gardena-bluetooth==1.4.4
gardena-bluetooth==1.5.0

# homeassistant.components.google_assistant_sdk
gassist-text==0.0.11
Expand Down Expand Up @@ -1460,7 +1460,7 @@ nextdns==4.0.0
nibe==2.13.0

# homeassistant.components.nice_go
nice-go==0.3.10
nice-go==1.0.0

# homeassistant.components.niko_home_control
niko-home-control==0.2.1
Expand Down Expand Up @@ -2149,7 +2149,7 @@ pyotgw==2.2.2
pyotp==2.8.0

# homeassistant.components.overkiz
pyoverkiz==1.15.0
pyoverkiz==1.15.3

# homeassistant.components.onewire
pyownet==0.10.0.post1
Expand Down Expand Up @@ -2402,7 +2402,7 @@ python-rabbitair==0.0.8
python-ripple-api==0.0.3

# homeassistant.components.roborock
python-roborock==2.7.2
python-roborock==2.8.1

# homeassistant.components.smarttub
python-smarttub==0.0.38
Expand Down
12 changes: 6 additions & 6 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ fitbit==0.3.1
fivem-api==0.1.2

# homeassistant.components.fjaraskupan
fjaraskupan==2.3.0
fjaraskupan==2.3.2

# homeassistant.components.flexit_bacnet
flexit_bacnet==2.2.1
Expand All @@ -793,7 +793,7 @@ foobot_async==1.0.0
forecast-solar==4.0.0

# homeassistant.components.freebox
freebox-api==1.1.0
freebox-api==1.2.1

# homeassistant.components.fritz
# homeassistant.components.fritzbox_callmonitor
Expand All @@ -806,7 +806,7 @@ fyta_cli==0.7.0
gTTS==2.2.4

# homeassistant.components.gardena_bluetooth
gardena-bluetooth==1.4.4
gardena-bluetooth==1.5.0

# homeassistant.components.google_assistant_sdk
gassist-text==0.0.11
Expand Down Expand Up @@ -1220,7 +1220,7 @@ nextdns==4.0.0
nibe==2.13.0

# homeassistant.components.nice_go
nice-go==0.3.10
nice-go==1.0.0

# homeassistant.components.nfandroidtv
notifications-android-tv==0.1.5
Expand Down Expand Up @@ -1736,7 +1736,7 @@ pyotgw==2.2.2
pyotp==2.8.0

# homeassistant.components.overkiz
pyoverkiz==1.15.0
pyoverkiz==1.15.3

# homeassistant.components.onewire
pyownet==0.10.0.post1
Expand Down Expand Up @@ -1923,7 +1923,7 @@ python-picnic-api==1.1.0
python-rabbitair==0.0.8

# homeassistant.components.roborock
python-roborock==2.7.2
python-roborock==2.8.1

# homeassistant.components.smarttub
python-smarttub==0.0.38
Expand Down
33 changes: 33 additions & 0 deletions tests/components/integration/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,39 @@ async def test_on_valid_source_expect_update_on_time(
assert float(state.state) < 1.8


async def test_on_0_source_expect_0_and_update_when_source_gets_positive(
hass: HomeAssistant,
) -> None:
"""Test whether time based integration updates the integral on a valid zero source."""
start_time = dt_util.utcnow()

with freeze_time(start_time) as freezer:
await _setup_integral_sensor(hass, max_sub_interval=DEFAULT_MAX_SUB_INTERVAL)
await _update_source_sensor(hass, 0)
await hass.async_block_till_done()

# wait one minute and one second
freezer.tick(61)
async_fire_time_changed(hass, dt_util.now())
await hass.async_block_till_done()

state = hass.states.get("sensor.integration")

assert condition.async_numeric_state(hass, state) is True
assert float(state.state) == 0 # integral is 0 after integration of 0

# wait one second and update state
freezer.tick(1)
async_fire_time_changed(hass, dt_util.now())
await _update_source_sensor(hass, 100)
await hass.async_block_till_done()

state = hass.states.get("sensor.integration")

# approx 100*1/3600 (right method after 1 second since last integration)
assert 0.027 < float(state.state) < 0.029


async def test_on_unvailable_source_expect_no_update_on_time(
hass: HomeAssistant,
) -> None:
Expand Down
11 changes: 9 additions & 2 deletions tests/components/mqtt/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,8 +1403,15 @@ def _mock_ack(topic: str, qos: int = 0) -> tuple[int, int]:
assert not mock_debouncer.is_set()


@pytest.mark.parametrize(
"exception",
[
OSError("Connection error"),
paho_mqtt.WebsocketConnectionError("Connection error"),
],
)
async def test_setup_raises_config_entry_not_ready_if_no_connect_broker(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
hass: HomeAssistant, caplog: pytest.LogCaptureFixture, exception: Exception
) -> None:
"""Test for setup failure if connection to broker is missing."""
entry = MockConfigEntry(domain=mqtt.DOMAIN, data={mqtt.CONF_BROKER: "test-broker"})
Expand All @@ -1413,7 +1420,7 @@ async def test_setup_raises_config_entry_not_ready_if_no_connect_broker(
with patch(
"homeassistant.components.mqtt.async_client.AsyncMQTTClient"
) as mock_client:
mock_client().connect = MagicMock(side_effect=OSError("Connection error"))
mock_client().connect = MagicMock(side_effect=exception)
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
assert "Failed to connect to MQTT server due to exception:" in caplog.text
Expand Down
2 changes: 1 addition & 1 deletion tests/components/music_assistant/fixtures/players.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"power",
"enqueue"
],
"elapsed_time": 0,
"elapsed_time": null,
"elapsed_time_last_updated": 0,
"state": "idle",
"volume_level": 20,
Expand Down
Loading
Loading