tessl install tessl/pypi-homeassistant@2025.9.0Open-source home automation platform running on Python 3.
Agent Success
Agent success rate when using this tile
69%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
58%
Build a simple event-driven notification system that tracks device state changes and sends notifications when specific conditions are met.
Your system should:
Create a NotificationManager class with the following functionality:
"notification_ready" event (with device name in event data) when a device reaches 3 state changes"notification_ready" event is fired with the device name @test@generates
from homeassistant.core import HomeAssistant, Event
class NotificationManager:
"""Manages device state change notifications using the event bus."""
def __init__(self, hass: HomeAssistant) -> None:
"""
Initialize the notification manager.
Args:
hass: Home Assistant instance with access to the event bus
"""
pass
async def start_tracking(self) -> None:
"""Start listening for state change events."""
pass
def register_one_time_listener(self, callback) -> None:
"""
Register a listener that will be called once when notification_ready event fires.
Args:
callback: Async function to call when the event fires
"""
pass
def fire_test_event(self, event_type: str, event_data: dict) -> None:
"""
Fire an event from a synchronous context.
Args:
event_type: Type of event to fire
event_data: Data to include with the event
"""
passProvides the event bus system for event-driven communication.