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