mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 15:16:33 +00:00
Bugfix message handling (#735)
This commit is contained in:
parent
bf75a8a439
commit
94fd24c251
@ -57,7 +57,7 @@ class Discovery(CoreSysAttributes, JsonConfig):
|
||||
"""Return list of available discovery messages."""
|
||||
return list(self.message_obj.values())
|
||||
|
||||
def send(self, addon, service, component, platform, config):
|
||||
def send(self, addon, service, config):
|
||||
"""Send a discovery message to Home Assistant."""
|
||||
try:
|
||||
DISCOVERY_SERVICES[service](config)
|
||||
@ -67,7 +67,7 @@ class Discovery(CoreSysAttributes, JsonConfig):
|
||||
raise DiscoveryError() from None
|
||||
|
||||
# Create message
|
||||
message = Message(addon.slug, service, component, platform, config)
|
||||
message = Message(addon.slug, service, config)
|
||||
|
||||
# Already exists?
|
||||
for old_message in self.list_messages:
|
||||
@ -115,7 +115,7 @@ class Discovery(CoreSysAttributes, JsonConfig):
|
||||
@attr.s
|
||||
class Message:
|
||||
"""Represent a single Discovery message."""
|
||||
uuid = attr.ib(factory=lambda: uuid4().hex, cmp=False)
|
||||
uuid = attr.ib(factory=lambda: uuid4().hex, cmp=False, init=False)
|
||||
addon = attr.ib()
|
||||
service = attr.ib()
|
||||
config = attr.ib(cmp=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user