Change notify target property to be a dictionary (#3501)
* Change notify target property to be a dictionary * Make demo target properties unique and fix test to match behavior
This commit is contained in:
1 parent
986873834a
commit
b3d67a7ed9
4 files changed
+10
-7
No files matched your search
@@ -134,14 +134,14 @@ data_template:
|
||||
def test_targets_are_services(self):
|
||||
"""Test that all targets are exposed as individual services."""
|
||||
self.assertIsNotNone(self.hass.services.has_service("notify", "demo"))
|
||||
service = "demo_test_target"
|
||||
service = "demo_test_target_name"
|
||||
self.assertIsNotNone(self.hass.services.has_service("notify", service))
|
||||
|
||||
def test_messages_to_targets_route(self):
|
||||
"""Test message routing to specific target services."""
|
||||
self.hass.bus.listen_once("notify", self.record_calls)
|
||||
|
||||
self.hass.services.call("notify", "demo_test_target",
|
||||
self.hass.services.call("notify", "demo_test_target_name",
|
||||
{'message': 'my message',
|
||||
'title': 'my title',
|
||||
'data': {'hello': 'world'}})
|
||||
@@ -152,7 +152,7 @@ data_template:
|
||||
|
||||
assert {
|
||||
'message': 'my message',
|
||||
'target': 'test target',
|
||||
'target': 'test target id',
|
||||
'title': 'my title',
|
||||
'data': {'hello': 'world'}
|
||||
} == data
|
||||
Reference in new issue
Block a user