mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Notify: Only attach target if in call data (#3831)
* Only pass through the target if it has a value * Target will no longer be none
This commit is contained in:
parent
e135691bd6
commit
d302dbec2d
@ -101,7 +101,7 @@ def setup(hass, config):
|
||||
|
||||
if targets.get(call.service) is not None:
|
||||
kwargs[ATTR_TARGET] = [targets[call.service]]
|
||||
else:
|
||||
elif call.data.get(ATTR_TARGET) is not None:
|
||||
kwargs[ATTR_TARGET] = call.data.get(ATTR_TARGET)
|
||||
|
||||
message.hass = hass
|
||||
|
@ -64,7 +64,6 @@ class TestNotifyDemo(unittest.TestCase):
|
||||
data = self.events[0].data
|
||||
assert {
|
||||
'message': 'my message',
|
||||
'target': None,
|
||||
'title': 'my title',
|
||||
'data': {'hello': 'world'}
|
||||
} == data
|
||||
@ -92,7 +91,6 @@ data_template:
|
||||
self.assertTrue(len(self.events) == 1)
|
||||
assert {
|
||||
'message': 'Test 123 4',
|
||||
'target': None,
|
||||
'data': {
|
||||
'push': {
|
||||
'sound':
|
||||
@ -124,7 +122,6 @@ data_template:
|
||||
assert {
|
||||
'message': 'Test 123 4',
|
||||
'title': 'Test',
|
||||
'target': None,
|
||||
'data': {
|
||||
'push': {
|
||||
'sound':
|
||||
|
Loading…
x
Reference in New Issue
Block a user