Skip to content

Commit 33192ab

Browse files
committed
Add more attributes to binary sensor and events
1 parent c4caf66 commit 33192ab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

custom_components/maint/binary_sensor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .models import MaintConfigEntry, MaintTask
2020

2121
_LOGGER = logging.getLogger(__name__)
22+
2223
EVENT_TASK_DUE = "maint_task_due"
2324

2425

@@ -118,6 +119,8 @@ def is_on(self) -> bool:
118119
def extra_state_attributes(self) -> dict[str, Any]:
119120
"""Return extra state data."""
120121
return {
122+
"entry_id": self._entry.entry_id,
123+
"task_id": self._task.task_id,
121124
"description": self._task.description,
122125
"last_completed": self._task.last_completed.isoformat(),
123126
}
@@ -152,6 +155,8 @@ def _fire_task_due_event(self) -> None:
152155
EVENT_TASK_DUE,
153156
{
154157
"entity_id": self.entity_id,
158+
"entry_id": self._entry.entry_id,
159+
"task_id": self._task.task_id,
155160
"description": self._task.description,
156161
"last_completed": self._task.last_completed.isoformat(),
157162
"next_scheduled": self._task.next_scheduled.isoformat(),

0 commit comments

Comments
 (0)