tessl install tessl/pypi-comtypes@1.4.0Pure Python COM package for Windows COM automation and interoperability
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.99x
Baseline
Agent success rate without this tile
89%
A Windows COM server that monitors temperature changes and notifies connected clients through COM events.
Build a COM server that acts as a temperature monitoring system with the following capabilities:
Create a COM server class that:
The server should support an event interface that notifies clients when:
The implementation should:
@generates
"""Temperature monitoring COM server with event support."""
# COM server class that implements temperature monitoring
class TemperatureMonitor:
"""COM server that monitors temperature and fires events to connected clients."""
def set_temperature(self, celsius: float) -> None:
"""Update the current temperature and fire events to connected clients.
Args:
celsius: The new temperature value in Celsius
"""
pass
def get_temperature(self) -> float:
"""Get the current temperature value.
Returns:
The current temperature in Celsius
"""
pass
# Event sink interface that clients implement to receive events
class ITemperatureEvents:
"""Interface that clients implement to receive temperature events."""
def on_temperature_changed(self, old_temp: float, new_temp: float) -> None:
"""Called when temperature changes.
Args:
old_temp: Previous temperature value
new_temp: New temperature value
"""
pass
def on_temperature_warning(self, temp: float) -> None:
"""Called when temperature exceeds 75°C.
Args:
temp: Current temperature that triggered the warning
"""
pass
def on_temperature_normal(self, temp: float) -> None:
"""Called when temperature returns below 75°C after a warning.
Args:
temp: Current temperature
"""
passProvides COM interoperability support for implementing event sources.