Allow sending GroupValueResponse telegrams with knx.send service (#62639)

* Add knx.respond service

* Combine knx.send and knx.respond services

* Rename knx attribute and fix tests

* Use parametrization in tests

Co-authored-by: Marvin Wichmann <marvin.wichmann@unic.com>
This commit is contained in:
Mirko Lenz 2021-12-29 18:15:48 +01:00 committed by GitHub
parent 7185e1140d
commit ab4effc7e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 119 additions and 41 deletions

View file

@ -109,7 +109,7 @@ class KNXTestKit:
# APCI Service tests
####################
async def _assert_telegram(
async def assert_telegram(
self,
group_address: str,
payload: int | tuple[int, ...] | None,
@ -141,19 +141,19 @@ class KNXTestKit:
async def assert_read(self, group_address: str) -> None:
"""Assert outgoing GroupValueRead telegram. One by one in timely order."""
await self._assert_telegram(group_address, None, GroupValueRead)
await self.assert_telegram(group_address, None, GroupValueRead)
async def assert_response(
self, group_address: str, payload: int | tuple[int, ...]
) -> None:
"""Assert outgoing GroupValueResponse telegram. One by one in timely order."""
await self._assert_telegram(group_address, payload, GroupValueResponse)
await self.assert_telegram(group_address, payload, GroupValueResponse)
async def assert_write(
self, group_address: str, payload: int | tuple[int, ...]
) -> None:
"""Assert outgoing GroupValueWrite telegram. One by one in timely order."""
await self._assert_telegram(group_address, payload, GroupValueWrite)
await self.assert_telegram(group_address, payload, GroupValueWrite)
####################
# Incoming telegrams