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 homeassistant/components/energieleser/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"integration_type": "device",
"iot_class": "local_polling",
"quality_scale": "platinum",
"requirements": ["energieleser==0.1.5"],
"requirements": ["energieleser==0.1.6"],
"zeroconf": [
{
"type": "_stromleser._tcp.local."
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 @@ -18,7 +18,7 @@
"quality_scale": "platinum",
"requirements": [
"aioesphomeapi==45.6.1",
"esphome-dashboard-api==1.3.0",
"esphome-dashboard-api==1.4.0",
"bleak-esphome==3.9.7"
],
"zeroconf": ["_esphomelib._tcp.local."]
Expand Down
57 changes: 52 additions & 5 deletions homeassistant/components/hue/v2/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
)
from aiohue.v2.models.camera_motion import CameraMotion
from aiohue.v2.models.contact import Contact, ContactState
from aiohue.v2.models.convenience_area_motion import ConvenienceAreaMotion
from aiohue.v2.models.entertainment_configuration import EntertainmentStatus
from aiohue.v2.models.grouped_motion import GroupedMotion
from aiohue.v2.models.motion import Motion
from aiohue.v2.models.motion_area_configuration import MotionAreaHealth
from aiohue.v2.models.resource import ResourceTypes
from aiohue.v2.models.security_area_motion import SecurityAreaMotion
from aiohue.v2.models.tamper import Tamper, TamperState
Expand Down Expand Up @@ -181,11 +183,10 @@ def __init__(
class HueMotionAwareSensor(HueMotionSensor):
"""Representation of a Motion sensor based on Hue Motion Aware.

Note that we only create sensors for the SecurityAreaMotion resource
and not for the ConvenienceAreaMotion resource, because the latter
does not have a state when it's not directly controlling lights.
The SecurityAreaMotion resource is always available with a state, allowing
Home Assistant users to actually use it as a motion sensor in their HA automations.
A MotionAware zone owns both a ConvenienceAreaMotion and a SecurityAreaMotion
service, and which of the two carries the motion state depends on how the zone
is set up in the Hue app. The source is therefore resolved from the zone, and
the state is unknown while neither service reports a valid one.
"""

controller: SecurityAreaMotionController
Expand All @@ -201,6 +202,26 @@ def name(self) -> str:
"""Return sensor name."""
return self.controller.get_motion_area_configuration(self.resource.id).name

@property
@override
def is_on(self) -> bool | None:
"""Return true if the binary sensor is on."""
zone = self._motion_area_configuration
# switching a zone off leaves the `enabled` flag of its services untouched,
# so the zone is the only reliable signal that it stopped reporting motion
if not zone.enabled or zone.health == MotionAreaHealth.NOT_RUNNING:
return None
# either service can be the one reporting a zone, with the other left holding
# a reading that no longer changes, so take the first that has a valid one.
# The convenience service comes first because a zone that is bound to lights
# reports on that service.
for source in (self._convenience_service, self.resource):
if source is None or not source.enabled or source.motion is None:
continue
if (value := source.motion.value) is not None:
return value
return None

def __init__(
self,
bridge: HueBridge,
Expand Down Expand Up @@ -229,6 +250,32 @@ async def async_added_to_hass(self) -> None:
self._handle_event, self._motion_area_configuration.id
)
)
# zones that are bound to lights report their motion on the convenience service
if (service_id := self._convenience_service_id) is not None:
self.async_on_remove(
self.bridge.api.sensors.convenience_area_motion.subscribe(
self._handle_event, service_id
)
)

@property
def _convenience_service_id(self) -> str | None:
"""Return the id of this zone's ConvenienceAreaMotion service, if it has one."""
return next(
(
service.rid
for service in self._motion_area_configuration.services
if service.rtype == ResourceTypes.CONVENIENCE_AREA_MOTION
),
None,
)

@property
def _convenience_service(self) -> ConvenienceAreaMotion | None:
"""Return this zone's ConvenienceAreaMotion resource, if the bridge has it."""
if (service_id := self._convenience_service_id) is None:
return None
return self.bridge.api.sensors.convenience_area_motion.get(service_id)


# pylint: disable-next=home-assistant-enforce-class-module
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/knx/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"loggers": ["xknx", "xknxproject"],
"quality_scale": "platinum",
"requirements": [
"xknx==3.17.0",
"xknxproject==3.9.0",
"xknx==3.18.0",
"xknxproject==3.10.0",
"knx-frontend==2026.7.23.145751",
"knx-telegram-store[sqlite,postgres]==0.11.1"
"knx-telegram-store[sqlite,postgres]==0.11.2"
],
"single_config_entry": true
}
10 changes: 5 additions & 5 deletions requirements_all.txt

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

Loading
Loading