MCPcopy Create free account
hub / github.com/StackStorm/st2 / get_sensor_instance

Method get_sensor_instance

st2tests/st2tests/sensors.py:41–54  ·  view source on GitHub ↗

Retrieve instance of the sensor class.

(self, config=None, poll_interval=None)

Source from the content-addressed store, hash-verified

39 self.sensor_service = MockSensorService(sensor_wrapper=sensor_wrapper)
40
41 def get_sensor_instance(self, config=None, poll_interval=None):
42 """
43 Retrieve instance of the sensor class.
44 """
45 kwargs = {"sensor_service": self.sensor_service}
46
47 if config:
48 kwargs["config"] = config
49
50 if poll_interval is not None:
51 kwargs["poll_interval"] = poll_interval
52
53 instance = self.sensor_cls(**kwargs) # pylint: disable=not-callable
54 return instance
55
56 def get_dispatched_triggers(self):
57 return self.sensor_service.dispatched_triggers

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected