0

This code snip below is from the actuator agent where I am trying to study the method revert_point:

#@RPC.export
def revert_point(self, requester_id, topic, point=None, **kwargs):
    """
    RPC method
    
    Reverts the value of a specific point on a device to a default state. 
    Requires the device be scheduled by the calling agent.
    
    :param requester_id: Ignored, VIP Identity used internally
    :param topic: The topic of the point to revert in the 
                  format <device topic>/<point name>
    :param \*\*kwargs: Any driver specific parameters
    :type topic: str
    :type requester_id: str
    
    .. warning:: Calling without previously scheduling a device and not
    within
                 the time allotted will raise a LockError"""

    rpc_peer = self.vip.rpc.context.vip_message.peer
    return self._revert_point(rpc_peer, topic, point=point, **kwargs)

I call the revert_point:

for device in revert_topic_devices:
    response = self.vip.rpc.call('platform.actuator', 'revert_point', self.core.identity, final_topic, self.jci_setpoint_topic).get(timeout=3)

This information:

2.0 (self.core.identity) 
slipstream_internal/slipstream_hq/27/OCC-SCHEDULE (final_topic)
2.0
slipstream_internal/slipstream_hq/29/OCC-SCHEDULE
2.0
slipstream_internal/slipstream_hq/30/OCC-SCHEDULE

I get a key error:

volttron.platform.jsonrpc.RemoteError: volttron.platform.jsonrpc.RemoteError("builtins.KeyError('slipstream_internal/slipstream_hq/30/OCC-SCHEDULE')")
bbartling
  • 3,288
  • 9
  • 43
  • 88

1 Answers1

0

I figured this out, call the method like this:

for device in revert_topic_devices:
    response = self.vip.rpc.call('platform.actuator', 'revert_point', self.core.identity, topic, self.jci_setpoint_topic).get(timeout=3)

topics should look like this:

slipstream_internal/slipstream_hq/27
2.0
slipstream_internal/slipstream_hq/29
2.0
slipstream_internal/slipstream_hq/30
bbartling
  • 3,288
  • 9
  • 43
  • 88