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%
A system that monitors multiple IoT device endpoints asynchronously and reports their status updates in real-time.
@generates
Implement a DeviceMonitor class that manages concurrent device status monitoring using Home Assistant's background task management capabilities.
The monitor should:
Simulated device polling should use time.sleep() to represent blocking I/O operations.
from homeassistant.core import HomeAssistant
from typing import Dict, List
class DeviceMonitor:
"""Monitors multiple device endpoints and reports their status."""
def __init__(self, hass: HomeAssistant):
"""Initialize the device monitor.
Args:
hass: Home Assistant instance
"""
pass
def start_monitoring(self, device_urls: List[str]) -> None:
"""Start monitoring the specified device URLs.
Args:
device_urls: List of device endpoint URLs to monitor
"""
pass
def get_device_status(self) -> Dict[str, str]:
"""Get the latest status for all monitored devices.
Returns:
Dictionary mapping device URL to its latest status
"""
pass
async def stop_monitoring(self) -> None:
"""Stop monitoring all devices and cleanup background tasks."""
passProvides home automation platform capabilities including background task management.