Can I get a tip on how to use the actuator agent set_multiple_points
?
In the actuator agent code, I can see the method:
def set_multiple_points(self, requester_id, topics_values, **kwargs):
"""RPC method
Set multiple points on multiple devices. Makes a single
RPC call to the platform driver per device.
:param requester_id: Ignored, VIP Identity used internally
:param topics_values: List of (topic, value) tuples
:param \*\*kwargs: Any driver specific parameters
:returns: Dictionary of points to exceptions raised.
If all points were set successfully an empty
dictionary will be returned.
.. warning:: calling without previously scheduling *all* devices
and not within the time allotted will raise a LockError
"""
In my CSV agent driver that I am experimenting with, I have 4 devices
defined in the init, as well as a point_topic
that is the same across all devices, and a change_setpoint
to apply to all of the devices.
def __init__(self, csv_topic="", **kwargs):
# Configure the base agent
super(Csvdriveragent, self).__init__(**kwargs)
_log.debug("vip_identity: " + self.core.identity)
# This agent is for testing purposes, so we'll default our ID
self.agent_id = "csv_actuation_agent"
# Get the topic that the Driver will publish to from the configuration file
devices = {device1:'201201',
device2:'201202',
device3:'201203',
device4:'201204'
}
self.point_topic = self.topic + "/" + "RmTmpSpt"
# This value will be used to send requests to the Driver to set a point on the device with an alternating value
self.change_setpoint = 85
Can I get a tip on what the rpc
call would look like for set_multiple_points
?
I know the comments state in a dictionary format, is this at all close below for how to put the rpc call together?
result = self.vip.rpc.call(
'platform.actuator', 'set_multiple_points', devices, point_topic, self.change_setpoint).get(
timeout=4)
Any tips for how to revert_multiple points back also greatly appreciated too. For example if a timer expires (gevent.sleep()
) how would I revert all the point back to prior values?