(self, device, mode)
device can be any object that has parentId == deviceId. i.e., not a camera
device can be any object that has parentId == deviceId. i.e., not a camera
device can be any object that has parentId == deviceId . i . e . not a camera
def DeleteMode(self, device, mode):
        """ device can be any object that has parentId == deviceId. i.e., not a camera """
        parentId = device.get('parentId', None)
        if device.get('deviceType') == 'arlobridge':
            return self.request.delete(f'https://{self.BASE_URL}/hmsweb/users/locations/'+device.get('uniqueId')+'/modes/'+mode)
        elif not parentId or device.get('deviceId') == parentId:
            return self.NotifyAndGetResponse(device, {"action":"delete","resource":"modes/"+mode,"publishResponse":True})
        else:
            raise Exception('Only parent device modes and schedules can be deleted.')
def DeleteMode ( self , device , mode ) : parentId = device . get ( 'parentId' , None ) if device . get ( 'deviceType' ) == 'arlobridge' : return self . request . delete ( f'https://{self.BASE_URL}/hmsweb/users/locations/' + device . get ( 'uniqueId' ) + '/modes/' + mode ) elif not parentId or device . get ( 'deviceId' ) == parentId : return self . NotifyAndGetResponse ( device , { "action" : "delete" , "resource" : "modes/" + mode , "publishResponse" : True } ) else : raise Exception ( 'Only parent device modes and schedules can be deleted.' )