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 .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Dependency review
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
with:
license-check: false # We use our own license audit checks

Expand Down
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Initialize CodeQL
uses: github/codeql-action/init@303c0aef88fc2fe5ff6d63d3b1596bfd83dfa1f9 # v3.30.4
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@303c0aef88fc2fe5ff6d63d3b1596bfd83dfa1f9 # v3.30.4
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
with:
category: "/language:python"
2 changes: 1 addition & 1 deletion homeassistant/components/alexa_devices/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"loggers": ["aioamazondevices"],
"quality_scale": "platinum",
"requirements": ["aioamazondevices==6.2.6"]
"requirements": ["aioamazondevices==6.2.7"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/analytics/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ async def async_devices_payload(hass: HomeAssistant) -> dict:
for domain, integration_info in integration_inputs.items()
if (integration := integrations.get(domain)) is not None
and integration.is_built_in
and integration.integration_type in ("device", "hub")
and integration.manifest.get("integration_type") in ("device", "hub")
}

# Call integrations that implement the analytics platform
Expand Down
21 changes: 17 additions & 4 deletions homeassistant/components/dnsip/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import asyncio
from datetime import timedelta
from ipaddress import IPv4Address, IPv6Address
import logging
Expand Down Expand Up @@ -88,8 +89,8 @@ def __init__(
self._attr_name = "IPv6" if ipv6 else None
self._attr_unique_id = f"{hostname}_{ipv6}"
self.hostname = hostname
self.resolver = aiodns.DNSResolver(tcp_port=port, udp_port=port)
self.resolver.nameservers = [resolver]
self.port = port
self._resolver = resolver
self.querytype: Literal["A", "AAAA"] = "AAAA" if ipv6 else "A"
self._retries = DEFAULT_RETRIES
self._attr_extra_state_attributes = {
Expand All @@ -103,14 +104,26 @@ def __init__(
model=aiodns.__version__,
name=name,
)
self.resolver: aiodns.DNSResolver
self.create_dns_resolver()

def create_dns_resolver(self) -> None:
"""Create the DNS resolver."""
self.resolver = aiodns.DNSResolver(tcp_port=self.port, udp_port=self.port)
self.resolver.nameservers = [self._resolver]

async def async_update(self) -> None:
"""Get the current DNS IP address for hostname."""
if self.resolver._closed: # noqa: SLF001
self.create_dns_resolver()
response = None
try:
response = await self.resolver.query(self.hostname, self.querytype)
async with asyncio.timeout(10):
response = await self.resolver.query(self.hostname, self.querytype)
except TimeoutError:
await self.resolver.close()
except DNSError as err:
_LOGGER.warning("Exception while resolving host: %s", err)
response = None

if response:
sorted_ips = sort_ips(
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/ebusd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def write(self, call: ServiceCall) -> None:
try:
_LOGGER.debug("Opening socket to ebusd %s", name)
command_result = ebusdpy.write(self._address, self._circuit, name, value)
if command_result is not None and "done" not in command_result:
if (
command_result is not None
and "done" not in command_result
and "empty" not in command_result
):
_LOGGER.warning("Write command failed: %s", name)
except RuntimeError as err:
_LOGGER.error(err)
6 changes: 5 additions & 1 deletion homeassistant/components/hue/v2/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ def is_on(self) -> bool | None:
if not self.resource.enabled:
# Force None (unknown) if the sensor is set to disabled in Hue
return None
return self.resource.motion.value
if not (motion_feature := self.resource.motion):
return None
if motion_feature.motion_report is not None:
return motion_feature.motion_report.motion
return motion_feature.motion


# pylint: disable-next=hass-enforce-class-module
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mealie/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "local_polling",
"quality_scale": "silver",
"requirements": ["aiomealie==0.10.2"]
"requirements": ["aiomealie==0.11.0"]
}
7 changes: 2 additions & 5 deletions homeassistant/components/number/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class NumberDeviceClass(StrEnum):
CO = "carbon_monoxide"
"""Carbon Monoxide gas concentration.

Unit of measurement: `ppm` (parts per million), mg/m³
Unit of measurement: `ppm` (parts per million)
"""

CO2 = "carbon_dioxide"
Expand Down Expand Up @@ -475,10 +475,7 @@ class NumberDeviceClass(StrEnum):
NumberDeviceClass.ATMOSPHERIC_PRESSURE: set(UnitOfPressure),
NumberDeviceClass.BATTERY: {PERCENTAGE},
NumberDeviceClass.BLOOD_GLUCOSE_CONCENTRATION: set(UnitOfBloodGlucoseConcentration),
NumberDeviceClass.CO: {
CONCENTRATION_PARTS_PER_MILLION,
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
},
NumberDeviceClass.CO: {CONCENTRATION_PARTS_PER_MILLION},
NumberDeviceClass.CO2: {CONCENTRATION_PARTS_PER_MILLION},
NumberDeviceClass.CONDUCTIVITY: set(UnitOfConductivity),
NumberDeviceClass.CURRENT: set(UnitOfElectricCurrent),
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/recorder/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
AreaConverter,
BaseUnitConverter,
BloodGlucoseConcentrationConverter,
CarbonMonoxideConcentrationConverter,
ConductivityConverter,
DataRateConverter,
DistanceConverter,
Expand Down Expand Up @@ -205,10 +204,6 @@ def query_circular_mean(table: type[StatisticsBase]) -> tuple[Label, Label]:
**dict.fromkeys(
MassVolumeConcentrationConverter.VALID_UNITS, MassVolumeConcentrationConverter
),
**dict.fromkeys(
CarbonMonoxideConcentrationConverter.VALID_UNITS,
CarbonMonoxideConcentrationConverter,
),
**dict.fromkeys(ConductivityConverter.VALID_UNITS, ConductivityConverter),
**dict.fromkeys(DataRateConverter.VALID_UNITS, DataRateConverter),
**dict.fromkeys(DistanceConverter.VALID_UNITS, DistanceConverter),
Expand Down
4 changes: 0 additions & 4 deletions homeassistant/components/recorder/websocket_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
ApparentPowerConverter,
AreaConverter,
BloodGlucoseConcentrationConverter,
CarbonMonoxideConcentrationConverter,
ConductivityConverter,
DataRateConverter,
DistanceConverter,
Expand Down Expand Up @@ -67,9 +66,6 @@
vol.Optional("blood_glucose_concentration"): vol.In(
BloodGlucoseConcentrationConverter.VALID_UNITS
),
vol.Optional("carbon_monoxide"): vol.In(
CarbonMonoxideConcentrationConverter.VALID_UNITS
),
vol.Optional("concentration"): vol.In(
MassVolumeConcentrationConverter.VALID_UNITS
),
Expand Down
9 changes: 9 additions & 0 deletions homeassistant/components/reolink/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,15 @@
},
"sd_storage": {
"default": "mdi:micro-sd"
},
"person_type": {
"default": "mdi:account"
},
"vehicle_type": {
"default": "mdi:car"
},
"animal_type": {
"default": "mdi:paw"
}
},
"siren": {
Expand Down
34 changes: 34 additions & 0 deletions homeassistant/components/reolink/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from decimal import Decimal

from reolink_aio.api import Host
from reolink_aio.const import YOLO_DETECT_TYPES
from reolink_aio.enums import BatteryEnum

from homeassistant.components.sensor import (
Expand Down Expand Up @@ -135,6 +136,39 @@ class ReolinkHostSensorEntityDescription(
value=lambda api, ch: api.wifi_signal(ch),
supported=lambda api, ch: api.supported(ch, "wifi"),
),
ReolinkSensorEntityDescription(
key="person_type",
cmd_id=696,
translation_key="person_type",
device_class=SensorDeviceClass.ENUM,
options=YOLO_DETECT_TYPES["people"],
value=lambda api, ch: api.baichuan.ai_detect_type(ch, "person"),
supported=lambda api, ch: (
api.supported(ch, "ai_yolo_type") and api.supported(ch, "ai_people")
),
),
ReolinkSensorEntityDescription(
key="vehicle_type",
cmd_id=696,
translation_key="vehicle_type",
device_class=SensorDeviceClass.ENUM,
options=YOLO_DETECT_TYPES["vehicle"],
value=lambda api, ch: api.baichuan.ai_detect_type(ch, "vehicle"),
supported=lambda api, ch: (
api.supported(ch, "ai_yolo_type") and api.supported(ch, "ai_vehicle")
),
),
ReolinkSensorEntityDescription(
key="animal_type",
cmd_id=696,
translation_key="animal_type",
device_class=SensorDeviceClass.ENUM,
options=YOLO_DETECT_TYPES["dog_cat"],
value=lambda api, ch: api.baichuan.ai_detect_type(ch, "dog_cat"),
supported=lambda api, ch: (
api.supported(ch, "ai_yolo_type") and api.supported(ch, "ai_dog_cat")
),
),
)

HOST_SENSORS = (
Expand Down
23 changes: 23 additions & 0 deletions homeassistant/components/reolink/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,29 @@
},
"sd_storage": {
"name": "SD {hdd_index} storage"
},
"person_type": {
"name": "Person type",
"state": {
"man": "Man",
"woman": "Woman"
}
},
"vehicle_type": {
"name": "Vehicle type",
"state": {
"sedan": "Sedan",
"suv": "SUV",
"pickup_truck": "Pickup truck",
"motorcycle": "Motorcycle"
}
},
"animal_type": {
"name": "Animal type",
"state": {
"dog": "Dog",
"cat": "Cat"
}
}
},
"siren": {
Expand Down
9 changes: 2 additions & 7 deletions homeassistant/components/sensor/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
AreaConverter,
BaseUnitConverter,
BloodGlucoseConcentrationConverter,
CarbonMonoxideConcentrationConverter,
ConductivityConverter,
DataRateConverter,
DistanceConverter,
Expand Down Expand Up @@ -157,7 +156,7 @@ class SensorDeviceClass(StrEnum):
CO = "carbon_monoxide"
"""Carbon Monoxide gas concentration.

Unit of measurement: `ppm` (parts per million), `mg/m³`
Unit of measurement: `ppm` (parts per million)
"""

CO2 = "carbon_dioxide"
Expand Down Expand Up @@ -544,7 +543,6 @@ class SensorStateClass(StrEnum):
SensorDeviceClass.AREA: AreaConverter,
SensorDeviceClass.ATMOSPHERIC_PRESSURE: PressureConverter,
SensorDeviceClass.BLOOD_GLUCOSE_CONCENTRATION: BloodGlucoseConcentrationConverter,
SensorDeviceClass.CO: CarbonMonoxideConcentrationConverter,
SensorDeviceClass.CONDUCTIVITY: ConductivityConverter,
SensorDeviceClass.CURRENT: ElectricCurrentConverter,
SensorDeviceClass.DATA_RATE: DataRateConverter,
Expand Down Expand Up @@ -586,10 +584,7 @@ class SensorStateClass(StrEnum):
SensorDeviceClass.ATMOSPHERIC_PRESSURE: set(UnitOfPressure),
SensorDeviceClass.BATTERY: {PERCENTAGE},
SensorDeviceClass.BLOOD_GLUCOSE_CONCENTRATION: set(UnitOfBloodGlucoseConcentration),
SensorDeviceClass.CO: {
CONCENTRATION_PARTS_PER_MILLION,
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
},
SensorDeviceClass.CO: {CONCENTRATION_PARTS_PER_MILLION},
SensorDeviceClass.CO2: {CONCENTRATION_PARTS_PER_MILLION},
SensorDeviceClass.CONDUCTIVITY: set(UnitOfConductivity),
SensorDeviceClass.CURRENT: set(UnitOfElectricCurrent),
Expand Down
Loading
Loading