Skip to content

Commit

Permalink
2024.3.1 (#113249)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Mar 14, 2024
2 parents 1aa5a07 + 05c0416 commit f7972ce
Show file tree
Hide file tree
Showing 113 changed files with 2,097 additions and 452 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,12 @@ omit =
homeassistant/components/izone/climate.py
homeassistant/components/izone/discovery.py
homeassistant/components/joaoapps_join/*
homeassistant/components/juicenet/__init__.py
homeassistant/components/juicenet/device.py
homeassistant/components/juicenet/entity.py
homeassistant/components/juicenet/number.py
homeassistant/components/juicenet/sensor.py
homeassistant/components/juicenet/switch.py
homeassistant/components/justnimbus/coordinator.py
homeassistant/components/justnimbus/entity.py
homeassistant/components/justnimbus/sensor.py
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@ build.json @home-assistant/supervisor
/tests/components/jellyfin/ @j-stienstra @ctalkington
/homeassistant/components/jewish_calendar/ @tsvi
/tests/components/jewish_calendar/ @tsvi
/homeassistant/components/juicenet/ @jesserockz
/tests/components/juicenet/ @jesserockz
/homeassistant/components/justnimbus/ @kvanzuijlen
/tests/components/justnimbus/ @kvanzuijlen
/homeassistant/components/jvc_projector/ @SteveEasley @msavazzi
Expand Down
3 changes: 1 addition & 2 deletions homeassistant/components/airthings_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data.setdefault(DOMAIN, {})
address = entry.unique_id

elevation = hass.config.elevation
is_metric = hass.config.units is METRIC_SYSTEM
assert address is not None

Expand All @@ -40,7 +39,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
f"Could not find Airthings device with address {address}"
)

airthings = AirthingsBluetoothDeviceData(_LOGGER, elevation, is_metric)
airthings = AirthingsBluetoothDeviceData(_LOGGER, is_metric)

async def _async_update_method() -> AirthingsDevice:
"""Get data from Airthings BLE."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airthings_ble/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/airthings_ble",
"iot_class": "local_polling",
"requirements": ["airthings-ble==0.6.1"]
"requirements": ["airthings-ble==0.7.1"]
}
6 changes: 2 additions & 4 deletions homeassistant/components/airthings_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from homeassistant.const import (
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
LIGHT_LUX,
PERCENTAGE,
EntityCategory,
Platform,
Expand Down Expand Up @@ -106,8 +105,7 @@
),
"illuminance": SensorEntityDescription(
key="illuminance",
device_class=SensorDeviceClass.ILLUMINANCE,
native_unit_of_measurement=LIGHT_LUX,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
),
}
Expand Down Expand Up @@ -222,7 +220,7 @@ def __init__(
manufacturer=airthings_device.manufacturer,
hw_version=airthings_device.hw_version,
sw_version=airthings_device.sw_version,
model=airthings_device.model,
model=airthings_device.model.name,
)

@property
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/aussie_broadband/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async_get_clientsession(hass),
)

# Ignore services that don't support usage data
ignore_types = FETCH_TYPES + ["Hardware"]

try:
await client.login()
services = await client.get_services(drop_types=FETCH_TYPES)
services = await client.get_services(drop_types=ignore_types)
except AuthenticationException as exc:
raise ConfigEntryAuthFailed() from exc
except ClientError as exc:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/axis/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"iot_class": "local_push",
"loggers": ["axis"],
"quality_scale": "platinum",
"requirements": ["axis==50"],
"requirements": ["axis==54"],
"ssdp": [
{
"manufacturer": "AXIS"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bosch_shc/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"documentation": "https://www.home-assistant.io/integrations/bosch_shc",
"iot_class": "local_push",
"loggers": ["boschshcpy"],
"requirements": ["boschshcpy==0.2.75"],
"requirements": ["boschshcpy==0.2.82"],
"zeroconf": [
{
"type": "_http._tcp.local.",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bring/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/bring",
"integration_type": "service",
"iot_class": "cloud_polling",
"requirements": ["bring-api==0.5.5"]
"requirements": ["bring-api==0.5.6"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/brother/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
brother = await Brother.create(
host, printer_type=printer_type, snmp_engine=snmp_engine
)
except (ConnectionError, SnmpError) as error:
except (ConnectionError, SnmpError, TimeoutError) as error:
raise ConfigEntryNotReady from error

coordinator = BrotherDataUpdateCoordinator(hass, brother)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/brother/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"iot_class": "local_polling",
"loggers": ["brother", "pyasn1", "pysmi", "pysnmp"],
"quality_scale": "platinum",
"requirements": ["brother==4.0.0"],
"requirements": ["brother==4.0.2"],
"zeroconf": [
{
"type": "_printer._tcp.local.",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bthome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/bthome",
"iot_class": "local_push",
"requirements": ["bthome-ble==3.6.0"]
"requirements": ["bthome-ble==3.8.0"]
}
13 changes: 11 additions & 2 deletions homeassistant/components/calendar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ def _validate_rrule(value: Any) -> str:
return str(value)


def _empty_as_none(value: str | None) -> str | None:
"""Convert any empty string values to None."""
return value or None


CREATE_EVENT_SERVICE = "create_event"
CREATE_EVENT_SCHEMA = vol.All(
cv.has_at_least_one_key(EVENT_START_DATE, EVENT_START_DATETIME, EVENT_IN),
Expand Down Expand Up @@ -733,7 +738,9 @@ async def handle_calendar_event_create(
vol.Required("type"): "calendar/event/delete",
vol.Required("entity_id"): cv.entity_id,
vol.Required(EVENT_UID): cv.string,
vol.Optional(EVENT_RECURRENCE_ID): cv.string,
vol.Optional(EVENT_RECURRENCE_ID): vol.Any(
vol.All(cv.string, _empty_as_none), None
),
vol.Optional(EVENT_RECURRENCE_RANGE): cv.string,
}
)
Expand Down Expand Up @@ -777,7 +784,9 @@ async def handle_calendar_event_delete(
vol.Required("type"): "calendar/event/update",
vol.Required("entity_id"): cv.entity_id,
vol.Required(EVENT_UID): cv.string,
vol.Optional(EVENT_RECURRENCE_ID): cv.string,
vol.Optional(EVENT_RECURRENCE_ID): vol.Any(
vol.All(cv.string, _empty_as_none), None
),
vol.Optional(EVENT_RECURRENCE_RANGE): cv.string,
vol.Required(CONF_EVENT): WEBSOCKET_EVENT_SCHEMA,
}
Expand Down
16 changes: 12 additions & 4 deletions homeassistant/components/camera/media_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
PlayMedia,
)
from homeassistant.components.stream import FORMAT_CONTENT_TYPE, HLS_PROVIDER
from homeassistant.const import ATTR_FRIENDLY_NAME
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_component import EntityComponent
Expand All @@ -25,13 +26,20 @@ async def async_get_media_source(hass: HomeAssistant) -> CameraMediaSource:
return CameraMediaSource(hass)


def _media_source_for_camera(camera: Camera, content_type: str) -> BrowseMediaSource:
def _media_source_for_camera(
hass: HomeAssistant, camera: Camera, content_type: str
) -> BrowseMediaSource:
camera_state = hass.states.get(camera.entity_id)
title = camera.name
if camera_state:
title = camera_state.attributes.get(ATTR_FRIENDLY_NAME, camera.name)

return BrowseMediaSource(
domain=DOMAIN,
identifier=camera.entity_id,
media_class=MediaClass.VIDEO,
media_content_type=content_type,
title=camera.name,
title=title,
thumbnail=f"/api/camera_proxy/{camera.entity_id}",
can_play=True,
can_expand=False,
Expand Down Expand Up @@ -89,15 +97,15 @@ async def async_browse_media(
async def _filter_browsable_camera(camera: Camera) -> BrowseMediaSource | None:
stream_type = camera.frontend_stream_type
if stream_type is None:
return _media_source_for_camera(camera, camera.content_type)
return _media_source_for_camera(self.hass, camera, camera.content_type)
if not can_stream_hls:
return None

content_type = FORMAT_CONTENT_TYPE[HLS_PROVIDER]
if stream_type != StreamType.HLS and not (await camera.stream_source()):
return None

return _media_source_for_camera(camera, content_type)
return _media_source_for_camera(self.hass, camera, content_type)

component: EntityComponent[Camera] = self.hass.data[DOMAIN]
results = await asyncio.gather(
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/climate/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"fan_mode": {
"default": "mdi:circle-medium",
"state": {
"auto": "mdi:fan-auto",
"diffuse": "mdi:weather-windy",
"focus": "mdi:target",
"high": "mdi:speedometer",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/conversation/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "system",
"iot_class": "local_push",
"quality_scale": "internal",
"requirements": ["hassil==1.6.1", "home-assistant-intents==2024.2.28"]
"requirements": ["hassil==1.6.1", "home-assistant-intents==2024.3.12"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/dhcp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"quality_scale": "internal",
"requirements": [
"aiodhcpwatcher==0.8.0",
"aiodhcpwatcher==0.8.1",
"aiodiscover==1.6.1",
"cached_ipaddress==0.3.0"
]
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/enphase_envoy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"documentation": "https://www.home-assistant.io/integrations/enphase_envoy",
"iot_class": "local_polling",
"loggers": ["pyenphase"],
"requirements": ["pyenphase==1.19.1"],
"requirements": ["pyenphase==1.19.2"],
"zeroconf": [
{
"type": "_enphase-envoy._tcp.local."
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 @@ -20,5 +20,5 @@
"documentation": "https://www.home-assistant.io/integrations/frontend",
"integration_type": "system",
"quality_scale": "internal",
"requirements": ["home-assistant-frontend==20240306.0"]
"requirements": ["home-assistant-frontend==20240307.0"]
}
9 changes: 1 addition & 8 deletions homeassistant/components/gardena_bluetooth/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
)
from gardena_bluetooth.parse import Characteristic, CharacteristicType

from homeassistant.components import bluetooth
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import DeviceInfo
Expand Down Expand Up @@ -117,13 +116,7 @@ def __init__(self, coordinator: Coordinator, context: Any = None) -> None:
@property
def available(self) -> bool:
"""Return if entity is available."""
return (
self.coordinator.last_update_success
and bluetooth.async_address_present(
self.hass, self.coordinator.address, True
)
and self._attr_available
)
return self.coordinator.last_update_success and self._attr_available


class GardenaBluetoothDescriptorEntity(GardenaBluetoothEntity):
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/gios/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ def native_value(self) -> StateType:
@property
def available(self) -> bool:
"""Return if entity is available."""
available = super().available
sensor_data = getattr(self.coordinator.data, self.entity_description.key)
available = super().available and bool(sensor_data)

# Sometimes the API returns sensor data without indexes
if self.entity_description.subkey:
if self.entity_description.subkey and available:
return available and bool(sensor_data.index)

return available and bool(sensor_data)
return available
2 changes: 1 addition & 1 deletion homeassistant/components/google/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"documentation": "https://www.home-assistant.io/integrations/calendar.google",
"iot_class": "cloud_polling",
"loggers": ["googleapiclient"],
"requirements": ["gcal-sync==6.0.3", "oauth2client==4.1.3", "ical==7.0.0"]
"requirements": ["gcal-sync==6.0.3", "oauth2client==4.1.3", "ical==7.0.1"]
}
15 changes: 10 additions & 5 deletions homeassistant/components/google_assistant/trait.py
Original file line number Diff line number Diff line change
Expand Up @@ -2706,10 +2706,9 @@ class SensorStateTrait(_Trait):
name = TRAIT_SENSOR_STATE
commands: list[str] = []

def _air_quality_description_for_aqi(self, aqi):
if aqi is None or aqi.isnumeric() is False:
def _air_quality_description_for_aqi(self, aqi: float | None) -> str:
if aqi is None or aqi < 0:
return "unknown"
aqi = int(aqi)
if aqi <= 50:
return "healthy"
if aqi <= 100:
Expand Down Expand Up @@ -2764,11 +2763,17 @@ def query_attributes(self):
if device_class is None or data is None:
return {}

sensor_data = {"name": data[0], "rawValue": self.state.state}
try:
value = float(self.state.state)
except ValueError:
value = None
if self.state.state == STATE_UNKNOWN:
value = None
sensor_data = {"name": data[0], "rawValue": value}

if device_class == sensor.SensorDeviceClass.AQI:
sensor_data["currentSensorState"] = self._air_quality_description_for_aqi(
self.state.state
value
)

return {"currentSensorStateData": [sensor_data]}
1 change: 1 addition & 0 deletions homeassistant/components/hassio/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ATTR_HOMEASSISTANT_EXCLUDE_DATABASE = "homeassistant_exclude_database"
ATTR_INPUT = "input"
ATTR_ISSUES = "issues"
ATTR_MESSAGE = "message"
ATTR_METHOD = "method"
ATTR_PANELS = "panels"
ATTR_PASSWORD = "password"
Expand Down
Loading

0 comments on commit f7972ce

Please sign in to comment.