Source code for sic_framework.devices.common_nao_stub.nao_stub_leds

"""
NAO stub LEDs component.
"""

from sic_framework.core.actuator_python2 import SICActuator
from sic_framework.core.connector import SICConnector
from sic_framework.core.message_python2 import SICMessage, SICConfMessage, SICRequest


[docs] class NaoStubLEDsActuator(SICActuator): """Stub for NAO LED actuator - logs actions instead of executing them."""
[docs] @staticmethod def get_conf(): return SICConfMessage()
[docs] @staticmethod def get_inputs(): return [SICRequest]
[docs] @staticmethod def get_output(): return SICMessage
[docs] def execute(self, request): """Log the LED request instead of executing it.""" self.logger.info("NaoStub.leds: {}".format(type(request).__name__)) self.logger.debug(" Request details: {}".format(request)) return SICMessage()
[docs] def on_message(self, message): """Log incoming messages.""" self.logger.info("NaoStub.leds message: {}".format(type(message).__name__)) self.logger.debug(" Message details: {}".format(message))
[docs] def stop(self): """Stop the LEDs actuator.""" self._stopped.set() super(NaoStubLEDsActuator, self).stop()
[docs] class NaoStubLEDs(SICConnector): component_class = NaoStubLEDsActuator