mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Update xknx to version 0.18.1 (#49609)
This commit is contained in:
parent
9a7d500b80
commit
671148b6ca
@ -15,7 +15,8 @@ from xknx.io import (
|
||||
ConnectionConfig,
|
||||
ConnectionType,
|
||||
)
|
||||
from xknx.telegram import AddressFilter, GroupAddress, Telegram
|
||||
from xknx.telegram import AddressFilter, Telegram
|
||||
from xknx.telegram.address import parse_device_group_address
|
||||
from xknx.telegram.apci import GroupValueRead, GroupValueResponse, GroupValueWrite
|
||||
|
||||
from homeassistant.const import (
|
||||
@ -412,7 +413,7 @@ class KNXModule:
|
||||
async def service_event_register_modify(self, call: ServiceCall) -> None:
|
||||
"""Service for adding or removing a GroupAddress to the knx_event filter."""
|
||||
attr_address = call.data[KNX_ADDRESS]
|
||||
group_addresses = map(GroupAddress, attr_address)
|
||||
group_addresses = map(parse_device_group_address, attr_address)
|
||||
|
||||
if call.data.get(SERVICE_KNX_ATTR_REMOVE):
|
||||
for group_address in group_addresses:
|
||||
@ -483,7 +484,7 @@ class KNXModule:
|
||||
|
||||
for address in attr_address:
|
||||
telegram = Telegram(
|
||||
destination_address=GroupAddress(address),
|
||||
destination_address=parse_device_group_address(address),
|
||||
payload=GroupValueWrite(payload),
|
||||
)
|
||||
await self.xknx.telegrams.put(telegram)
|
||||
@ -492,7 +493,7 @@ class KNXModule:
|
||||
"""Service for sending a GroupValueRead telegram to the KNX bus."""
|
||||
for address in call.data[KNX_ADDRESS]:
|
||||
telegram = Telegram(
|
||||
destination_address=GroupAddress(address),
|
||||
destination_address=parse_device_group_address(address),
|
||||
payload=GroupValueRead(),
|
||||
)
|
||||
await self.xknx.telegrams.put(telegram)
|
||||
|
@ -2,7 +2,7 @@
|
||||
"domain": "knx",
|
||||
"name": "KNX",
|
||||
"documentation": "https://www.home-assistant.io/integrations/knx",
|
||||
"requirements": ["xknx==0.18.0"],
|
||||
"requirements": ["xknx==0.18.1"],
|
||||
"codeowners": ["@Julius2342", "@farmio", "@marvin-w"],
|
||||
"quality_scale": "silver",
|
||||
"iot_class": "local_push"
|
||||
|
@ -1,8 +1,13 @@
|
||||
"""Voluptuous schemas for the KNX integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import voluptuous as vol
|
||||
from xknx.devices.climate import SetpointShiftMode
|
||||
from xknx.exceptions import CouldNotParseAddress
|
||||
from xknx.io import DEFAULT_MCAST_PORT
|
||||
from xknx.telegram.address import GroupAddress, IndividualAddress
|
||||
from xknx.telegram.address import IndividualAddress, parse_device_group_address
|
||||
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICE_CLASS,
|
||||
@ -29,11 +34,20 @@ from .const import (
|
||||
# KNX VALIDATORS
|
||||
##################
|
||||
|
||||
ga_validator = vol.Any(
|
||||
cv.matches_regex(GroupAddress.ADDRESS_RE.pattern),
|
||||
vol.All(vol.Coerce(int), vol.Range(min=1, max=65535)),
|
||||
msg="value does not match pattern for KNX group address '<main>/<middle>/<sub>', '<main>/<sub>' or '<free>' (eg.'1/2/3', '9/234', '123')",
|
||||
|
||||
def ga_validator(value: Any) -> str | int:
|
||||
"""Validate that value is parsable as GroupAddress or InternalGroupAddress."""
|
||||
if isinstance(value, (str, int)):
|
||||
try:
|
||||
parse_device_group_address(value)
|
||||
return value
|
||||
except CouldNotParseAddress:
|
||||
pass
|
||||
raise vol.Invalid(
|
||||
f"value '{value}' is not a valid KNX group address '<main>/<middle>/<sub>', '<main>/<sub>' or '<free>' (eg.'1/2/3', '9/234', '123'), nor xknx internal address 'i-<string>'."
|
||||
)
|
||||
|
||||
|
||||
ga_list_validator = vol.All(cv.ensure_list, [ga_validator])
|
||||
|
||||
ia_validator = vol.Any(
|
||||
|
@ -2353,7 +2353,7 @@ xbox-webapi==2.0.8
|
||||
xboxapi==2.0.1
|
||||
|
||||
# homeassistant.components.knx
|
||||
xknx==0.18.0
|
||||
xknx==0.18.1
|
||||
|
||||
# homeassistant.components.bluesound
|
||||
# homeassistant.components.rest
|
||||
|
@ -1244,7 +1244,7 @@ wolf_smartset==0.1.8
|
||||
xbox-webapi==2.0.8
|
||||
|
||||
# homeassistant.components.knx
|
||||
xknx==0.18.0
|
||||
xknx==0.18.1
|
||||
|
||||
# homeassistant.components.bluesound
|
||||
# homeassistant.components.rest
|
||||
|
Loading…
x
Reference in New Issue
Block a user