3 from PLC.Faults import *
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.PCUProtocolTypes import PCUProtocolType, PCUProtocolTypes
7 from PLC.Auth import Auth
9 class DeletePCUProtocolType(Method):
11 Deletes a PCU protocol type.
13 Returns 1 if successful, faults otherwise.
20 PCUProtocolType.fields['pcu_protocol_type_id']
23 returns = Parameter(int, '1 if successful')
26 def call(self, auth, protocol_type_id):
27 protocol_types = PCUProtocolTypes(self.api, [protocol_type_id])
28 if not protocol_types:
29 raise PLCInvalidArgument, "No such pcu protocol type"
31 protocol_type = protocol_types[0]
32 protocol_type.delete()
33 self.event_objects = {'PCUProtocolType': [protocol_type['pcu_protocol_type_id']]}