mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Set default name for KNX outgoing telegram source (#124439)
This commit is contained in:
parent
10b3119b4a
commit
41e66edd14
@ -9,7 +9,7 @@ from xknx import XKNX
|
||||
from xknx.dpt import DPTArray, DPTBase, DPTBinary
|
||||
from xknx.dpt.dpt import DPTComplexData, DPTEnumData
|
||||
from xknx.exceptions import XKNXException
|
||||
from xknx.telegram import Telegram
|
||||
from xknx.telegram import Telegram, TelegramDirection
|
||||
from xknx.telegram.apci import GroupValueResponse, GroupValueWrite
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -119,6 +119,8 @@ class Telegrams:
|
||||
device := self.project.devices.get(f"{telegram.source_address}")
|
||||
) is not None:
|
||||
src_name = f"{device['manufacturer_name']} {device['name']}"
|
||||
elif telegram.direction is TelegramDirection.OUTGOING:
|
||||
src_name = "Home Assistant"
|
||||
|
||||
if isinstance(telegram.payload, (GroupValueWrite, GroupValueResponse)):
|
||||
payload_data = telegram.payload.value.value
|
||||
|
@ -39,7 +39,7 @@ MOCK_TELEGRAMS = [
|
||||
"dpt_name": None,
|
||||
"payload": [1, 2, 3, 4],
|
||||
"source": "0.0.0",
|
||||
"source_name": "",
|
||||
"source_name": "Home Assistant",
|
||||
"telegramtype": "GroupValueWrite",
|
||||
"timestamp": MOCK_TIMESTAMP,
|
||||
"unit": None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user