Skip to content

Commit fbfd0ec

Browse files
committed
lollox80 manual merge
1 parent 17c10c0 commit fbfd0ec

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Public releases
22

33
## 1.12.2
4+
- Prioritize data from action call over scenario or target derived data
45
- Minor test and lint fixes for 3.14, and improved test coverage
56
## 1.12.1
67
- Translations for Dutch, French, German, Hindi, Italian, Japanese, Polish, Portuguese, Simplified Chinese and Spanish

custom_components/supernotify/notification.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,17 +791,24 @@ def generate_envelopes(self, delivery: Delivery, targets: list[Target]) -> list[
791791
# a target is always generated, even if there are no recipients
792792
if target.has_resolved_target() or delivery.target_required != TargetRequired.ALWAYS:
793793
envelope_data = {}
794+
795+
# least priority - delivery derived data
794796
envelope_data.update(delivery.data)
795-
envelope_data.update({
796-
k: v for k, v in self.extra_data.items() if k not in INTERNAL_DATA_KEYS
797-
}) # action call data
797+
# next least priority - target derived data
798798
if target.target_data:
799799
envelope_data.update(target.target_data)
800+
800801
# scenario applied at cross-delivery level in apply_enabled_scenarios
801802
for scenario in self.enabled_scenarios.values():
802803
customization: DeliveryCustomization | None = scenario.delivery_customization(delivery.name)
803804
if customization and customization.data:
804805
envelope_data.update(customization.data)
806+
807+
# apply data from action call last to prioritize it
808+
envelope_data.update({
809+
k: v for k, v in self.extra_data.items() if k not in INTERNAL_DATA_KEYS
810+
}) # action call data
811+
805812
envelopes.append(Envelope(delivery, self, target, envelope_data, context=self.context))
806813

807814
return envelopes

0 commit comments

Comments
 (0)